from portkey_ai import Portkey
# Initialize the Portkey client
portkey = Portkey(
api_key="PORTKEY_API_KEY",
)
# Add a workspace
workspace = portkey.admin.workspaces.create(
name='WORKSPACE_NAME_0909',
description="WORKSPACE_DESCRIPTION",
defaults={
"metadata": {
"environment": "production",
"foo": "bar"
}
}
)
print(workspace){
"id": "ws-test-a-174eb1",
"slug": "ws-test-a-174eb1",
"name": "New Workspace",
"description": null,
"created_at": "2024-07-30T13:27:29.000Z",
"last_updated_at": "2024-07-30T13:27:29.000Z",
"defaults": {
"metadata": {
"foo": "bar"
},
"is_default": 0
},
"usage_limits": [
{
"credit_limit": 10,
"periodic_reset": "monthly",
"alert_threshold": 8
}
],
"rate_limits": [
{
"value": 123
}
]
}Create Workspace
POST
/
admin
/
workspaces
from portkey_ai import Portkey
# Initialize the Portkey client
portkey = Portkey(
api_key="PORTKEY_API_KEY",
)
# Add a workspace
workspace = portkey.admin.workspaces.create(
name='WORKSPACE_NAME_0909',
description="WORKSPACE_DESCRIPTION",
defaults={
"metadata": {
"environment": "production",
"foo": "bar"
}
}
)
print(workspace){
"id": "ws-test-a-174eb1",
"slug": "ws-test-a-174eb1",
"name": "New Workspace",
"description": null,
"created_at": "2024-07-30T13:27:29.000Z",
"last_updated_at": "2024-07-30T13:27:29.000Z",
"defaults": {
"metadata": {
"foo": "bar"
},
"is_default": 0
},
"usage_limits": [
{
"credit_limit": 10,
"periodic_reset": "monthly",
"alert_threshold": 8
}
],
"rate_limits": [
{
"value": 123
}
]
}Documentation Index
Fetch the complete documentation index at: https://portkey-docs-feat-byteplus-provider.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
Body
application/json
Response
200 - application/json
OK
Example:
"ws-test-a-174eb1"
Example:
"ws-test-a-174eb1"
Example:
"New Workspace"
Example:
null
Example:
"2024-07-30T13:27:29.000Z"
Example:
"2024-07-30T13:27:29.000Z"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Last modified on May 24, 2026
Was this page helpful?
⌘I

