Routing and usage
Workspace routing and consumption.
Return routing overrides for a workspace owned by the authenticated tenant.
Path Parameters
Response Body
application/json
application/json
curl -X GET "https://example.com/api/workspaces/string/routing"{}Clear the workspace-wide or usage-specific override and requeue routing.
Path Parameters
Query Parameters
Response Body
application/json
application/json
curl -X DELETE "https://example.com/api/workspaces/string/routing"{}Assign a tenant-owned profile and requeue the workspace routing path.
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X PUT "https://example.com/api/workspaces/string/routing" \ -H "Content-Type: application/json" \ -d '{ "profile_id": "string" }'{}Assign an allowed model for one usage and requeue workspace routing.
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X PUT "https://example.com/api/workspaces/string/routing/model" \ -H "Content-Type: application/json" \ -d '{ "model_config_id": "string", "usage_type": "string" }'{}Return workspace cost and execution totals per usage type.
Path Parameters
Query Parameters
Response Body
application/json
application/json
curl -X GET "https://example.com/api/workspaces/string/usage/by-type"[ { "execution_count": 0, "percentage": 0, "total_cost": 0, "usage_type": "string" }]Return workspace cost and execution totals per user for the time range.
Path Parameters
Query Parameters
Response Body
application/json
application/json
curl -X GET "https://example.com/api/workspaces/string/usage/by-user"[ { "execution_count": 0, "percentage": 0, "total_cost": 0, "user_display_name": "string", "user_has_avatar": false, "user_id": "string", "user_name": "string", "user_role": "string" }]Return newest-first usage records with pagination metadata.
Path Parameters
Query Parameters
120Response Body
application/json
application/json
curl -X GET "https://example.com/api/workspaces/string/usage/logs"{ "logs": [ { "agent_run_id": "string", "conversation_id": "string", "cost_usd": 0, "created_at": "string", "id": "string", "input_tokens": 0, "model": "string", "output_tokens": 0, "user_id": "string" } ], "page": 0, "per_page": 0, "total": 0}Return aggregate token, cost, and execution totals for the time range.
Path Parameters
Query Parameters
Response Body
application/json
application/json
curl -X GET "https://example.com/api/workspaces/string/usage/summary"{ "avg_cost_per_execution": 0, "cache_creation_tokens": 0, "cache_read_tokens": 0, "execution_count": 0, "input_tokens": 0, "output_tokens": 0, "total_cost": 0, "total_tokens": 0}Return zero-filled hourly or daily usage buckets for the time range.
Path Parameters
Query Parameters
Response Body
application/json
application/json
curl -X GET "https://example.com/api/workspaces/string/usage/timeseries"{ "data": [ { "cost": 0, "date": "string", "executions": 0, "input_tokens": 0, "output_tokens": 0 } ], "granularity": "string"}