from portkey_ai import Portkey
# Initialize the Portkey client
portkey = Portkey(
api_key="PORTKEY_API_KEY",
)
# List workspaces
workspaces = portkey.admin.workspaces.list()
print(workspaces){
"total": 2,
"object": "list",
"data": [
{
"id": "test-prod-ws-12345",
"name": "Test prod workspace",
"description": "This is a production workspace",
"created_at": "2023-07-13 13:51:27",
"last_updated_at": "2023-07-13 14:51:27",
"object": "workspace"
},
{
"id": "test-prod-ws-12345",
"name": "Test prod workspace",
"description": "This is a production workspace",
"created_at": "2023-07-13 13:51:27",
"last_updated_at": "2023-07-13 14:51:27",
"object": "workspace"
}
]
}Retrieve all Workspaces
GET
/
admin
/
workspaces
from portkey_ai import Portkey
# Initialize the Portkey client
portkey = Portkey(
api_key="PORTKEY_API_KEY",
)
# List workspaces
workspaces = portkey.admin.workspaces.list()
print(workspaces){
"total": 2,
"object": "list",
"data": [
{
"id": "test-prod-ws-12345",
"name": "Test prod workspace",
"description": "This is a production workspace",
"created_at": "2023-07-13 13:51:27",
"last_updated_at": "2023-07-13 14:51:27",
"object": "workspace"
},
{
"id": "test-prod-ws-12345",
"name": "Test prod workspace",
"description": "This is a production workspace",
"created_at": "2023-07-13 13:51:27",
"last_updated_at": "2023-07-13 14:51:27",
"object": "workspace"
}
]
}Portkey is now PRISMA AIRS AI Gateway. See it in action.
Contact Us
Authorizations
Query Parameters
Workspace name to filter results, case sensitive
Workspace name filter with strict check
Workspace status to filter results, comma separated
Available options:
active, archived Last modified on August 3, 2026
Was this page helpful?
⌘I

