API reference
Add Provider Endpoint
Add a provider endpoint.
Request Body schema: application/jsonrequired
Id (string) or Id (null) (Id) Default: "" | |
name required | string (Name) >= 3 characters |
description | string (Description) Default: "" |
provider_type required | string (ProviderType) Enum: "openai" "anthropic" "vllm" "ollama" "lm_studio" "llamacpp" "openrouter" Represents the different types of providers we support. |
endpoint | string (Endpoint) Default: "" |
auth_type | string (ProviderAuthType) Default: "none" Enum: "none" "passthrough" "api_key" Represents the different types of auth we support for providers. |
Api Key (string) or Api Key (null) (Api Key) |
Responses
Request samples
- Payload
{- "id": "",
- "name": "string",
- "description": "",
- "provider_type": "openai",
- "endpoint": "",
- "auth_type": "none",
- "api_key": "string"
}
Response samples
- 201
- 422
{- "id": "",
- "name": "string",
- "description": "",
- "provider_type": "openai",
- "endpoint": "",
- "auth_type": "none"
}
Update Provider Endpoint
Update a provider endpoint by name.
path Parameters
provider_name required | string (Provider Name) |
Request Body schema: application/jsonrequired
Id (string) or Id (null) (Id) Default: "" | |
name required | string (Name) >= 3 characters |
description | string (Description) Default: "" |
provider_type required | string (ProviderType) Enum: "openai" "anthropic" "vllm" "ollama" "lm_studio" "llamacpp" "openrouter" Represents the different types of providers we support. |
endpoint | string (Endpoint) Default: "" |
auth_type | string (ProviderAuthType) Default: "none" Enum: "none" "passthrough" "api_key" Represents the different types of auth we support for providers. |
Responses
Request samples
- Payload
{- "id": "",
- "name": "string",
- "description": "",
- "provider_type": "openai",
- "endpoint": "",
- "auth_type": "none"
}
Response samples
- 200
- 422
{- "id": "",
- "name": "string",
- "description": "",
- "provider_type": "openai",
- "endpoint": "",
- "auth_type": "none"
}
Configure Auth Material
Configure auth material for a provider.
path Parameters
provider_name required | string (Provider Name) |
Request Body schema: application/jsonrequired
auth_type required | string (ProviderAuthType) Enum: "none" "passthrough" "api_key" Represents the different types of auth we support for providers. |
Api Key (string) or Api Key (null) (Api Key) |
Responses
Request samples
- Payload
{- "auth_type": "none",
- "api_key": "string"
}
Response samples
- 422
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
]
}
List Workspaces
List all workspaces.
Args: provider_name (Optional[str]): Filter workspaces by provider name. If provided, will return workspaces where models from the specified provider (e.g., OpenAI, Anthropic) have been used in workspace muxing rules.
Returns: ListWorkspacesResponse: A response object containing the list of workspaces.
query Parameters
Provider Name (string) or Provider Name (null) (Provider Name) |
Responses
Response samples
- 200
- 422
{- "workspaces": [
- {
- "name": "string",
- "is_active": true
}
]
}
Create Workspace
Create a new workspace.
Request Body schema: application/jsonrequired
name required | string (Name) |
WorkspaceConfig (object) or null |
Responses
Request samples
- Payload
{- "name": "string",
- "config": {
- "custom_instructions": "string",
- "muxing_rules": [
- {
- "provider_name": "string",
- "provider_type": "openai",
- "model": "string",
- "matcher_type": "catch_all",
- "matcher": "string"
}
]
}
}
Response samples
- 201
- 422
{- "name": "string",
- "config": {
- "custom_instructions": "string",
- "muxing_rules": [
- {
- "provider_name": "string",
- "provider_type": "openai",
- "model": "string",
- "matcher_type": "catch_all",
- "matcher": "string"
}
]
}
}
Activate Workspace
Activate a workspace by name.
query Parameters
status_code | any (Status Code) Default: 204 |
Request Body schema: application/jsonrequired
name required | string (Name) |
Responses
Request samples
- Payload
{- "name": "string"
}
Response samples
- 200
- 422
null
Update Workspace
Update a workspace.
path Parameters
workspace_name required | string (Workspace Name) |
Request Body schema: application/jsonrequired
name required | string (Name) |
WorkspaceConfig (object) or null |
Responses
Request samples
- Payload
{- "name": "string",
- "config": {
- "custom_instructions": "string",
- "muxing_rules": [
- {
- "provider_name": "string",
- "provider_type": "openai",
- "model": "string",
- "matcher_type": "catch_all",
- "matcher": "string"
}
]
}
}
Response samples
- 200
- 422
{- "name": "string",
- "config": {
- "custom_instructions": "string",
- "muxing_rules": [
- {
- "provider_name": "string",
- "provider_type": "openai",
- "model": "string",
- "matcher_type": "catch_all",
- "matcher": "string"
}
]
}
}
Get Workspace By Name
List workspaces by provider ID.
path Parameters
workspace_name required | string (Workspace Name) |
Responses
Response samples
- 200
- 422
{- "name": "string",
- "config": {
- "custom_instructions": "string",
- "muxing_rules": [
- {
- "provider_name": "string",
- "provider_type": "openai",
- "model": "string",
- "matcher_type": "catch_all",
- "matcher": "string"
}
]
}
}
Get Workspace Alerts
Get alerts for a workspace.
path Parameters
workspace_name required | string (Workspace Name) |
Responses
Response samples
- 200
- 422
[- {
- "conversation": {
- "question_answers": [
- {
- "question": {
- "message": "string",
- "timestamp": "2019-08-24T14:15:22Z",
- "message_id": "string"
}, - "answer": {
- "message": "string",
- "timestamp": "2019-08-24T14:15:22Z",
- "message_id": "string"
}
}
], - "provider": "string",
- "type": "chat",
- "chat_id": "string",
- "conversation_timestamp": "2019-08-24T14:15:22Z",
- "token_usage_agg": {
- "tokens_by_model": {
- "property1": {
- "provider_type": "openai",
- "model": "string",
- "token_usage": {
- "input_tokens": 0,
- "output_tokens": 0,
- "input_cost": 0,
- "output_cost": 0
}
}, - "property2": {
- "provider_type": "openai",
- "model": "string",
- "token_usage": {
- "input_tokens": 0,
- "output_tokens": 0,
- "input_cost": 0,
- "output_cost": 0
}
}
}, - "token_usage": {
- "input_tokens": 0,
- "output_tokens": 0,
- "input_cost": 0,
- "output_cost": 0
}
}, - "alerts": [ ]
}, - "alert_id": "string",
- "code_snippet": {
- "code": "string",
- "language": "string",
- "filepath": "string",
- "libraries": [ ],
- "file_extension": "string"
}, - "trigger_string": "string",
- "trigger_type": "string",
- "trigger_category": "string",
- "timestamp": "2019-08-24T14:15:22Z"
}
]
Get Workspace Messages
Get messages for a workspace.
path Parameters
workspace_name required | string (Workspace Name) |
query Parameters
page | integer (Page) >= 1 Default: 1 |
page_size | integer (Page Size) [ 1 .. 100 ] Default: 50 |
Array of Filter By Ids (strings) or Filter By Ids (null) (Filter By Ids) | |
Array of Filter By Alert Trigger Types (strings) or Filter By Alert Trigger Types (null) (Filter By Alert Trigger Types) |
Responses
Response samples
- 200
- 422
{- "data": [
- {
- "chat_id": "string",
- "prompt": {
- "message": "string",
- "timestamp": "2019-08-24T14:15:22Z",
- "message_id": "string"
}, - "alerts_summary": {
- "malicious_packages": 0,
- "pii": 0,
- "secrets": 0,
- "total_alerts": 0
}, - "token_usage_agg": {
- "tokens_by_model": {
- "property1": {
- "provider_type": "openai",
- "model": "string",
- "token_usage": {
- "input_tokens": 0,
- "output_tokens": 0,
- "input_cost": 0,
- "output_cost": 0
}
}, - "property2": {
- "provider_type": "openai",
- "model": "string",
- "token_usage": {
- "input_tokens": 0,
- "output_tokens": 0,
- "input_cost": 0,
- "output_cost": 0
}
}
}, - "token_usage": {
- "input_tokens": 0,
- "output_tokens": 0,
- "input_cost": 0,
- "output_cost": 0
}
}, - "provider": "string",
- "type": "chat",
- "conversation_timestamp": "2019-08-24T14:15:22Z"
}
], - "limit": 0,
- "offset": 0,
- "total": 0
}
Get Messages By Prompt Id
Get messages for a workspace.
path Parameters
workspace_name required | string (Workspace Name) |
prompt_id required | string (Prompt Id) |
Responses
Response samples
- 200
- 422
{- "question_answers": [
- {
- "question": {
- "message": "string",
- "timestamp": "2019-08-24T14:15:22Z",
- "message_id": "string"
}, - "answer": {
- "message": "string",
- "timestamp": "2019-08-24T14:15:22Z",
- "message_id": "string"
}
}
], - "provider": "string",
- "type": "chat",
- "chat_id": "string",
- "conversation_timestamp": "2019-08-24T14:15:22Z",
- "token_usage_agg": {
- "tokens_by_model": {
- "property1": {
- "provider_type": "openai",
- "model": "string",
- "token_usage": {
- "input_tokens": 0,
- "output_tokens": 0,
- "input_cost": 0,
- "output_cost": 0
}
}, - "property2": {
- "provider_type": "openai",
- "model": "string",
- "token_usage": {
- "input_tokens": 0,
- "output_tokens": 0,
- "input_cost": 0,
- "output_cost": 0
}
}
}, - "token_usage": {
- "input_tokens": 0,
- "output_tokens": 0,
- "input_cost": 0,
- "output_cost": 0
}
}, - "alerts": [ ]
}
Set Workspace Custom Instructions
path Parameters
workspace_name required | string (Workspace Name) |
Request Body schema: application/jsonrequired
prompt required | string (Prompt) |
Responses
Request samples
- Payload
{- "prompt": "string"
}
Response samples
- 422
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
]
}
Get Workspace Muxes
Get the mux rules of a workspace.
The list is ordered in order of priority. That is, the first rule in the list has the highest priority.
path Parameters
workspace_name required | string (Workspace Name) |
Responses
Response samples
- 200
- 422
[- {
- "provider_name": "string",
- "provider_type": "openai",
- "model": "string",
- "matcher_type": "catch_all",
- "matcher": "string"
}
]
Set Workspace Muxes
Set the mux rules of a workspace.
path Parameters
workspace_name required | string (Workspace Name) |
Request Body schema: application/jsonrequired
provider_name required | string (Provider Name) |
provider_type required | string (ProviderType) Enum: "openai" "anthropic" "vllm" "ollama" "lm_studio" "llamacpp" "openrouter" Represents the different types of providers we support. |
model required | string (Model) |
matcher_type required | string (MuxMatcherType) Enum: "catch_all" "filename_match" "fim_filename" "chat_filename" Represents the different types of matchers we support. The 3 rules present match filenames and request types. They're used in conjunction with the matcher field in the MuxRule model. E.g.
NOTE: Removing or updating fields from this enum will require a migration. Adding new fields is safe. |
Matcher (string) or Matcher (null) (Matcher) |
Responses
Request samples
- Payload
[- {
- "provider_name": "string",
- "provider_type": "openai",
- "model": "string",
- "matcher_type": "catch_all",
- "matcher": "string"
}
]
Response samples
- 422
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
]
}
Get Workspace Token Usage
Get the token usage of a workspace.
path Parameters
workspace_name required | string (Workspace Name) |
Responses
Response samples
- 200
- 422
{- "tokens_by_model": {
- "property1": {
- "provider_type": "openai",
- "model": "string",
- "token_usage": {
- "input_tokens": 0,
- "output_tokens": 0,
- "input_cost": 0,
- "output_cost": 0
}
}, - "property2": {
- "provider_type": "openai",
- "model": "string",
- "token_usage": {
- "input_tokens": 0,
- "output_tokens": 0,
- "input_cost": 0,
- "output_cost": 0
}
}
}, - "token_usage": {
- "input_tokens": 0,
- "output_tokens": 0,
- "input_cost": 0,
- "output_cost": 0
}
}
Create Persona
Create a new persona.
Request Body schema: application/jsonrequired
name required | string (Name) |
description required | string (Description) |
Responses
Request samples
- Payload
{- "name": "string",
- "description": "string"
}
Response samples
- 201
- 422
{- "id": "string",
- "name": "string",
- "description": "string"
}
Update Persona
Update an existing persona.
path Parameters
persona_name required | string (Persona Name) |
Request Body schema: application/jsonrequired
new_name required | string (New Name) |
new_description required | string (New Description) |
Responses
Request samples
- Payload
{- "new_name": "string",
- "new_description": "string"
}
Response samples
- 200
- 422
{- "id": "string",
- "name": "string",
- "description": "string"
}
Add Provider Endpoint
Add a provider endpoint.
Request Body schema: application/jsonrequired
Id (string) or Id (null) (Id) Default: "" | |
name required | string (Name) >= 3 characters |
description | string (Description) Default: "" |
provider_type required | string (ProviderType) Enum: "openai" "anthropic" "vllm" "ollama" "lm_studio" "llamacpp" "openrouter" Represents the different types of providers we support. |
endpoint | string (Endpoint) Default: "" |
auth_type | string (ProviderAuthType) Default: "none" Enum: "none" "passthrough" "api_key" Represents the different types of auth we support for providers. |
Api Key (string) or Api Key (null) (Api Key) |
Responses
Request samples
- Payload
{- "id": "",
- "name": "string",
- "description": "",
- "provider_type": "openai",
- "endpoint": "",
- "auth_type": "none",
- "api_key": "string"
}
Response samples
- 201
- 422
{- "id": "",
- "name": "string",
- "description": "",
- "provider_type": "openai",
- "endpoint": "",
- "auth_type": "none"
}
Update Provider Endpoint
Update a provider endpoint by name.
path Parameters
provider_name required | string (Provider Name) |
Request Body schema: application/jsonrequired
Id (string) or Id (null) (Id) Default: "" | |
name required | string (Name) >= 3 characters |
description | string (Description) Default: "" |
provider_type required | string (ProviderType) Enum: "openai" "anthropic" "vllm" "ollama" "lm_studio" "llamacpp" "openrouter" Represents the different types of providers we support. |
endpoint | string (Endpoint) Default: "" |
auth_type | string (ProviderAuthType) Default: "none" Enum: "none" "passthrough" "api_key" Represents the different types of auth we support for providers. |
Responses
Request samples
- Payload
{- "id": "",
- "name": "string",
- "description": "",
- "provider_type": "openai",
- "endpoint": "",
- "auth_type": "none"
}
Response samples
- 200
- 422
{- "id": "",
- "name": "string",
- "description": "",
- "provider_type": "openai",
- "endpoint": "",
- "auth_type": "none"
}
Configure Auth Material
Configure auth material for a provider.
path Parameters
provider_name required | string (Provider Name) |
Request Body schema: application/jsonrequired
auth_type required | string (ProviderAuthType) Enum: "none" "passthrough" "api_key" Represents the different types of auth we support for providers. |
Api Key (string) or Api Key (null) (Api Key) |
Responses
Request samples
- Payload
{- "auth_type": "none",
- "api_key": "string"
}
Response samples
- 422
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
]
}
List Workspaces
List all workspaces.
Args: provider_name (Optional[str]): Filter workspaces by provider name. If provided, will return workspaces where models from the specified provider (e.g., OpenAI, Anthropic) have been used in workspace muxing rules.
Returns: ListWorkspacesResponse: A response object containing the list of workspaces.
query Parameters
Provider Name (string) or Provider Name (null) (Provider Name) |
Responses
Response samples
- 200
- 422
{- "workspaces": [
- {
- "name": "string",
- "is_active": true
}
]
}
Create Workspace
Create a new workspace.
Request Body schema: application/jsonrequired
name required | string (Name) |
WorkspaceConfig (object) or null |
Responses
Request samples
- Payload
{- "name": "string",
- "config": {
- "custom_instructions": "string",
- "muxing_rules": [
- {
- "provider_name": "string",
- "provider_type": "openai",
- "model": "string",
- "matcher_type": "catch_all",
- "matcher": "string"
}
]
}
}
Response samples
- 201
- 422
{- "name": "string",
- "config": {
- "custom_instructions": "string",
- "muxing_rules": [
- {
- "provider_name": "string",
- "provider_type": "openai",
- "model": "string",
- "matcher_type": "catch_all",
- "matcher": "string"
}
]
}
}
Activate Workspace
Activate a workspace by name.
query Parameters
status_code | any (Status Code) Default: 204 |
Request Body schema: application/jsonrequired
name required | string (Name) |
Responses
Request samples
- Payload
{- "name": "string"
}
Response samples
- 200
- 422
null
Update Workspace
Update a workspace.
path Parameters
workspace_name required | string (Workspace Name) |
Request Body schema: application/jsonrequired
name required | string (Name) |
WorkspaceConfig (object) or null |
Responses
Request samples
- Payload
{- "name": "string",
- "config": {
- "custom_instructions": "string",
- "muxing_rules": [
- {
- "provider_name": "string",
- "provider_type": "openai",
- "model": "string",
- "matcher_type": "catch_all",
- "matcher": "string"
}
]
}
}
Response samples
- 200
- 422
{- "name": "string",
- "config": {
- "custom_instructions": "string",
- "muxing_rules": [
- {
- "provider_name": "string",
- "provider_type": "openai",
- "model": "string",
- "matcher_type": "catch_all",
- "matcher": "string"
}
]
}
}
Get Workspace By Name
List workspaces by provider ID.
path Parameters
workspace_name required | string (Workspace Name) |
Responses
Response samples
- 200
- 422
{- "name": "string",
- "config": {
- "custom_instructions": "string",
- "muxing_rules": [
- {
- "provider_name": "string",
- "provider_type": "openai",
- "model": "string",
- "matcher_type": "catch_all",
- "matcher": "string"
}
]
}
}
Get Workspace Alerts
Get alerts for a workspace.
path Parameters
workspace_name required | string (Workspace Name) |
Responses
Response samples
- 200
- 422
[- {
- "conversation": {
- "question_answers": [
- {
- "question": {
- "message": "string",
- "timestamp": "2019-08-24T14:15:22Z",
- "message_id": "string"
}, - "answer": {
- "message": "string",
- "timestamp": "2019-08-24T14:15:22Z",
- "message_id": "string"
}
}
], - "provider": "string",
- "type": "chat",
- "chat_id": "string",
- "conversation_timestamp": "2019-08-24T14:15:22Z",
- "token_usage_agg": {
- "tokens_by_model": {
- "property1": {
- "provider_type": "openai",
- "model": "string",
- "token_usage": {
- "input_tokens": 0,
- "output_tokens": 0,
- "input_cost": 0,
- "output_cost": 0
}
}, - "property2": {
- "provider_type": "openai",
- "model": "string",
- "token_usage": {
- "input_tokens": 0,
- "output_tokens": 0,
- "input_cost": 0,
- "output_cost": 0
}
}
}, - "token_usage": {
- "input_tokens": 0,
- "output_tokens": 0,
- "input_cost": 0,
- "output_cost": 0
}
}, - "alerts": [ ]
}, - "alert_id": "string",
- "code_snippet": {
- "code": "string",
- "language": "string",
- "filepath": "string",
- "libraries": [ ],
- "file_extension": "string"
}, - "trigger_string": "string",
- "trigger_type": "string",
- "trigger_category": "string",
- "timestamp": "2019-08-24T14:15:22Z"
}
]
Get Workspace Messages
Get messages for a workspace.
path Parameters
workspace_name required | string (Workspace Name) |
query Parameters
page | integer (Page) >= 1 Default: 1 |
page_size | integer (Page Size) [ 1 .. 100 ] Default: 50 |
Array of Filter By Ids (strings) or Filter By Ids (null) (Filter By Ids) | |
Array of Filter By Alert Trigger Types (strings) or Filter By Alert Trigger Types (null) (Filter By Alert Trigger Types) |
Responses
Response samples
- 200
- 422
{- "data": [
- {
- "chat_id": "string",
- "prompt": {
- "message": "string",
- "timestamp": "2019-08-24T14:15:22Z",
- "message_id": "string"
}, - "alerts_summary": {
- "malicious_packages": 0,
- "pii": 0,
- "secrets": 0,
- "total_alerts": 0
}, - "token_usage_agg": {
- "tokens_by_model": {
- "property1": {
- "provider_type": "openai",
- "model": "string",
- "token_usage": {
- "input_tokens": 0,
- "output_tokens": 0,
- "input_cost": 0,
- "output_cost": 0
}
}, - "property2": {
- "provider_type": "openai",
- "model": "string",
- "token_usage": {
- "input_tokens": 0,
- "output_tokens": 0,
- "input_cost": 0,
- "output_cost": 0
}
}
}, - "token_usage": {
- "input_tokens": 0,
- "output_tokens": 0,
- "input_cost": 0,
- "output_cost": 0
}
}, - "provider": "string",
- "type": "chat",
- "conversation_timestamp": "2019-08-24T14:15:22Z"
}
], - "limit": 0,
- "offset": 0,
- "total": 0
}
Get Messages By Prompt Id
Get messages for a workspace.
path Parameters
workspace_name required | string (Workspace Name) |
prompt_id required | string (Prompt Id) |
Responses
Response samples
- 200
- 422
{- "question_answers": [
- {
- "question": {
- "message": "string",
- "timestamp": "2019-08-24T14:15:22Z",
- "message_id": "string"
}, - "answer": {
- "message": "string",
- "timestamp": "2019-08-24T14:15:22Z",
- "message_id": "string"
}
}
], - "provider": "string",
- "type": "chat",
- "chat_id": "string",
- "conversation_timestamp": "2019-08-24T14:15:22Z",
- "token_usage_agg": {
- "tokens_by_model": {
- "property1": {
- "provider_type": "openai",
- "model": "string",
- "token_usage": {
- "input_tokens": 0,
- "output_tokens": 0,
- "input_cost": 0,
- "output_cost": 0
}
}, - "property2": {
- "provider_type": "openai",
- "model": "string",
- "token_usage": {
- "input_tokens": 0,
- "output_tokens": 0,
- "input_cost": 0,
- "output_cost": 0
}
}
}, - "token_usage": {
- "input_tokens": 0,
- "output_tokens": 0,
- "input_cost": 0,
- "output_cost": 0
}
}, - "alerts": [ ]
}
Set Workspace Custom Instructions
path Parameters
workspace_name required | string (Workspace Name) |
Request Body schema: application/jsonrequired
prompt required | string (Prompt) |
Responses
Request samples
- Payload
{- "prompt": "string"
}
Response samples
- 422
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
]
}
Get Workspace Muxes
Get the mux rules of a workspace.
The list is ordered in order of priority. That is, the first rule in the list has the highest priority.
path Parameters
workspace_name required | string (Workspace Name) |
Responses
Response samples
- 200
- 422
[- {
- "provider_name": "string",
- "provider_type": "openai",
- "model": "string",
- "matcher_type": "catch_all",
- "matcher": "string"
}
]
Set Workspace Muxes
Set the mux rules of a workspace.
path Parameters
workspace_name required | string (Workspace Name) |
Request Body schema: application/jsonrequired
provider_name required | string (Provider Name) |
provider_type required | string (ProviderType) Enum: "openai" "anthropic" "vllm" "ollama" "lm_studio" "llamacpp" "openrouter" Represents the different types of providers we support. |
model required | string (Model) |
matcher_type required | string (MuxMatcherType) Enum: "catch_all" "filename_match" "fim_filename" "chat_filename" Represents the different types of matchers we support. The 3 rules present match filenames and request types. They're used in conjunction with the matcher field in the MuxRule model. E.g.
NOTE: Removing or updating fields from this enum will require a migration. Adding new fields is safe. |
Matcher (string) or Matcher (null) (Matcher) |
Responses
Request samples
- Payload
[- {
- "provider_name": "string",
- "provider_type": "openai",
- "model": "string",
- "matcher_type": "catch_all",
- "matcher": "string"
}
]
Response samples
- 422
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
]
}
Get Workspace Token Usage
Get the token usage of a workspace.
path Parameters
workspace_name required | string (Workspace Name) |
Responses
Response samples
- 200
- 422
{- "tokens_by_model": {
- "property1": {
- "provider_type": "openai",
- "model": "string",
- "token_usage": {
- "input_tokens": 0,
- "output_tokens": 0,
- "input_cost": 0,
- "output_cost": 0
}
}, - "property2": {
- "provider_type": "openai",
- "model": "string",
- "token_usage": {
- "input_tokens": 0,
- "output_tokens": 0,
- "input_cost": 0,
- "output_cost": 0
}
}
}, - "token_usage": {
- "input_tokens": 0,
- "output_tokens": 0,
- "input_cost": 0,
- "output_cost": 0
}
}
Get Workspace Muxes
Get the mux rules of a workspace.
The list is ordered in order of priority. That is, the first rule in the list has the highest priority.
path Parameters
workspace_name required | string (Workspace Name) |
Responses
Response samples
- 200
- 422
[- {
- "provider_name": "string",
- "provider_type": "openai",
- "model": "string",
- "matcher_type": "catch_all",
- "matcher": "string"
}
]
Set Workspace Muxes
Set the mux rules of a workspace.
path Parameters
workspace_name required | string (Workspace Name) |
Request Body schema: application/jsonrequired
provider_name required | string (Provider Name) |
provider_type required | string (ProviderType) Enum: "openai" "anthropic" "vllm" "ollama" "lm_studio" "llamacpp" "openrouter" Represents the different types of providers we support. |
model required | string (Model) |
matcher_type required | string (MuxMatcherType) Enum: "catch_all" "filename_match" "fim_filename" "chat_filename" Represents the different types of matchers we support. The 3 rules present match filenames and request types. They're used in conjunction with the matcher field in the MuxRule model. E.g.
NOTE: Removing or updating fields from this enum will require a migration. Adding new fields is safe. |
Matcher (string) or Matcher (null) (Matcher) |
Responses
Request samples
- Payload
[- {
- "provider_name": "string",
- "provider_type": "openai",
- "model": "string",
- "matcher_type": "catch_all",
- "matcher": "string"
}
]
Response samples
- 422
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
]
}
Get Workspace Token Usage
Get the token usage of a workspace.
path Parameters
workspace_name required | string (Workspace Name) |
Responses
Response samples
- 200
- 422
{- "tokens_by_model": {
- "property1": {
- "provider_type": "openai",
- "model": "string",
- "token_usage": {
- "input_tokens": 0,
- "output_tokens": 0,
- "input_cost": 0,
- "output_cost": 0
}
}, - "property2": {
- "provider_type": "openai",
- "model": "string",
- "token_usage": {
- "input_tokens": 0,
- "output_tokens": 0,
- "input_cost": 0,
- "output_cost": 0
}
}
}, - "token_usage": {
- "input_tokens": 0,
- "output_tokens": 0,
- "input_cost": 0,
- "output_cost": 0
}
}
Create Persona
Create a new persona.
Request Body schema: application/jsonrequired
name required | string (Name) |
description required | string (Description) |
Responses
Request samples
- Payload
{- "name": "string",
- "description": "string"
}
Response samples
- 201
- 422
{- "id": "string",
- "name": "string",
- "description": "string"
}
Update Persona
Update an existing persona.
path Parameters
persona_name required | string (Persona Name) |
Request Body schema: application/jsonrequired
new_name required | string (New Name) |
new_description required | string (New Description) |
Responses
Request samples
- Payload
{- "new_name": "string",
- "new_description": "string"
}
Response samples
- 200
- 422
{- "id": "string",
- "name": "string",
- "description": "string"
}