Virtual Models
Creates a virtual model — a named list of [provider, model, weight] entries plus a routing strategy — and returns its model_list_id, which updateVirtualModel and deleteVirtualModel need.
Access: createVirtualModel with project_id — org owner or project admin. createVirtualModel without project_id (org-level) — org owner only.
Rules: the key must be valid and belong to org_id; a key works only on its own project's virtual models; the key's creator must still be a member of the org and project.
Known issue: a project member's key calling create is rejected with 500 An internal error occurred instead of a 403.
FastRouter API Key. Get yours at https://fastrouter.ai
Format: Authorization: Bearer YOUR_API_KEY
Must match the key's org.
Must be the key's project. Leave out to create an org-level model (org owner key only).
Unique within the project.
Hyphen forms (e.g. lowest-price) are accepted and stored with underscores.
random_shufflePossible values: Must not be sent on create; returns 400.
Virtual model created.
b7248b2e-bb43-11f1-9932-de4251ea43fcBad Request. Includes: unknown strategy (default_strategy_name must be one of: ...), missing model_list_id on update/delete (model_list_id is required), wrong model_list_id (Virtual model not found for model_list_id: ...), unknown project_id (Project not found for org_id=..., project_id=...), model_list_id sent on create (model_list_id not allowed), unknown model (Invalid model 'x': model not found), or provider not serving the model (Invalid provider 'x' for model 'y').
Missing or invalid API key.
Forbidden. Includes: key from another org (API key does not belong to this organization), another project's model or project_id (API key does not belong to this project), or an org-level action without an org owner's key (API key must belong to an organization owner to perform this operation).
POST /prod/createVirtualModel HTTP/1.1
Host: api.fastrouter.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 218
{
"org_id": "<ORG_ID>",
"project_id": "<PROJECT_ID>",
"model_list_name": "frontier-router",
"default_strategy_name": "random_shuffle",
"model_provider_list": [
[
"openai",
"openai/gpt-5.1",
0.7
],
[
"openai",
"openai/gpt-5.5-pro",
0.3
]
]
}{
"model_list_id": "b7248b2e-bb43-11f1-9932-de4251ea43fc",
"model_list_name": "frontier-router",
"project_id": "<PROJECT_ID>"
}Returns the virtual models of the key's project plus org-level ones, newest first. Any role (org owner, project admin, project member) can call it.
FastRouter API Key. Get yours at https://fastrouter.ai
Format: Authorization: Bearer YOUR_API_KEY
Must match the key's org.
Optional. If sent, must exist (else 400 Project not found) and be the key's project (else 403). If omitted, returns the key's project's models plus org-level ones.
List of virtual models.
"NULL" for org-level models.
Bad Request. Includes: unknown strategy (default_strategy_name must be one of: ...), missing model_list_id on update/delete (model_list_id is required), wrong model_list_id (Virtual model not found for model_list_id: ...), unknown project_id (Project not found for org_id=..., project_id=...), model_list_id sent on create (model_list_id not allowed), unknown model (Invalid model 'x': model not found), or provider not serving the model (Invalid provider 'x' for model 'y').
Missing or invalid API key.
Forbidden. Includes: key from another org (API key does not belong to this organization), another project's model or project_id (API key does not belong to this project), or an org-level action without an org owner's key (API key must belong to an organization owner to perform this operation).
POST /prod/showVirtualModels HTTP/1.1
Host: api.fastrouter.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 21
{
"org_id": "<ORG_ID>"
}[
{
"org_id": "<ORG_ID>",
"project_id": "<PROJECT_ID>",
"model_list_id": "<MODEL_LIST_ID>",
"model_list_name": "frontier-router-v2",
"default_strategy_name": "priority_routing",
"model_provider_list": [
[
"openai",
"openai/gpt-5.1",
"1"
],
[
"ALL",
"anthropic/claude-4.5-sonnet",
"2"
]
],
"model_provider_list_jsonb": null,
"created_by": "owner@example.com",
"created_on": "2026-09-28T10:15:02.123456",
"updated_by": "owner@example.com",
"updated_on": "2026-09-28T10:20:41.654321"
}
]Replaces a virtual model's name, strategy and entries. The full model_provider_list is sent each time; it is not merged with the old one. project_id is not needed — it comes from the saved virtual model, and a different project_id returns 400 (a model can't be moved to another project).
Access: project-level model — org owner or project admin. org-level model — org owner only.
Known issue: a project member's key calling update is rejected with 500 An internal error occurred instead of a 403.
FastRouter API Key. Get yours at https://fastrouter.ai
Format: Authorization: Bearer YOUR_API_KEY
Replaces a virtual model's name, strategy and entries. The full model_provider_list is replaced, not merged with the old one.
Must match the key's org.
Must exist in the org, else 400 Virtual model not found. project_id is derived from the saved model and cannot be changed here.
New name. The old name is read from the saved row, so old_model_list_name is not needed.
Hyphen forms (e.g. lowest-price) are accepted and stored with underscores.
random_shufflePossible values: Virtual model updated.
b7248b2e-bb43-11f1-9932-de4251ea43fcBad Request. Includes: unknown strategy (default_strategy_name must be one of: ...), missing model_list_id on update/delete (model_list_id is required), wrong model_list_id (Virtual model not found for model_list_id: ...), unknown project_id (Project not found for org_id=..., project_id=...), model_list_id sent on create (model_list_id not allowed), unknown model (Invalid model 'x': model not found), or provider not serving the model (Invalid provider 'x' for model 'y').
Missing or invalid API key.
Forbidden. Includes: key from another org (API key does not belong to this organization), another project's model or project_id (API key does not belong to this project), or an org-level action without an org owner's key (API key must belong to an organization owner to perform this operation).
POST /prod/updateVirtualModel HTTP/1.1
Host: api.fastrouter.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 241
{
"org_id": "<ORG_ID>",
"model_list_id": "<MODEL_LIST_ID>",
"model_list_name": "frontier-router-v2",
"default_strategy_name": "priority_routing",
"model_provider_list": [
[
"openai",
"openai/gpt-5.1",
1
],
[
"All Providers",
"anthropic/claude-4.5-sonnet",
2
]
]
}{
"model_list_id": "<MODEL_LIST_ID>",
"model_list_name": "frontier-router-v2",
"project_id": "<PROJECT_ID>"
}Deletes a virtual model. Only an org owner's key can call it, and the model must be in the key's project or org-level. project_id is not needed.
FastRouter API Key. Get yours at https://fastrouter.ai
Format: Authorization: Bearer YOUR_API_KEY
Must match the key's org.
Virtual model deleted.
Bad Request. Includes: unknown strategy (default_strategy_name must be one of: ...), missing model_list_id on update/delete (model_list_id is required), wrong model_list_id (Virtual model not found for model_list_id: ...), unknown project_id (Project not found for org_id=..., project_id=...), model_list_id sent on create (model_list_id not allowed), unknown model (Invalid model 'x': model not found), or provider not serving the model (Invalid provider 'x' for model 'y').
Missing or invalid API key.
Forbidden. Includes: key from another org (API key does not belong to this organization), another project's model or project_id (API key does not belong to this project), or an org-level action without an org owner's key (API key must belong to an organization owner to perform this operation).
POST /prod/deleteVirtualModel HTTP/1.1
Host: api.fastrouter.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 55
{
"org_id": "<ORG_ID>",
"model_list_id": "<MODEL_LIST_ID>"
}{
"model_list_id": "<MODEL_LIST_ID>",
"deleted": true
}Last updated
