Python
Default
from portkey_ai import Portkey# Initialize the Portkey clientportkey = Portkey( api_key="PORTKEY_API_KEY",)# Add a workspaceworkspace = 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, "object": "workspace" }, "usage_limits": [ { "credit_limit": 10, "periodic_reset": "monthly", "alert_threshold": 8 } ], "rate_limits": [ { "type": "requests", "unit": "rpd", "value": 123 } ] }
Show child attributes
OK
"ws-test-a-174eb1"
"New Workspace"
null
"2024-07-30T13:27:29.000Z"
Was this page helpful?