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,
"object": "workspace"
}
}
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,
"object": "workspace"
}
}
OK
The response is of type object
.
Was this page helpful?