Update a route
https://api.respan.ai/api/routes/{name}/Send mode, entries or both. A field you leave out keeps its value, and entries replaces the whole list.
Servers
https://api.respan.ai — Respan API Server
Authentication
RespanApiKey
Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.
HTTP scheme: bearer; format: Respan API key.
Authorization: Bearer $RESPAN_API_KEYOr:
DashboardJwt
Use a dashboard JWT only for dashboard-authenticated endpoints. Respan API-key endpoints use the respanApiKey auth field instead.
HTTP scheme: bearer; format: Dashboard JWT.
Authorization: Bearer $RESPAN_DASHBOARD_JWTPath parameters
name string Requiredopenai/gpt-6-luna.Request body
A request body is required.
application/json
$ object Required body
{"entries":[{"name":"gpt-5.5","weight":1},{"name":"claude-sonnet-4-5-20250929","weight":1}]}mode string Optionalfallback tries the entries in order. split picks one by weight, then tries the others.Allowed:
"fallback", "split"entries array<object> Optional
Minimum items:
1entries[] object Array item
#/components/schemas/RouteEntryentries[].name string Required in parent<provider>/<model> name, or a Respan route.Maximum length:
255entries[].weight number Optionalsplit route. A fallback route ignores it.Default:
1Minimum:
0OpenAPI request schema
{
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"fallback",
"split"
],
"description": "`fallback` tries the entries in order. `split` picks one by weight, then tries the others."
},
"entries": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/components/schemas/RouteEntry"
},
"description": "The route's entries, in order."
}
},
"example": {
"entries": [
{
"name": "gpt-5.5",
"weight": 1
},
{
"name": "claude-sonnet-4-5-20250929",
"weight": 1
}
]
}
}Responses
200
The updated route.
application/json
$ object Body
#/components/schemas/RouteExample:
{"name":"support-bot","mode":"fallback","entries":[{"name":"gpt-5.5","weight":1},{"name":"claude-sonnet-4-5-20250929","weight":1}]}name string Required in parentmodel. It may contain slashes.Maximum length:
255mode string Required in parentfallback tries the entries in order. split picks one by weight, then tries the others.Allowed:
"fallback", "split"entries array<object> Required in parent
Minimum items:
1entries[] object Array item
#/components/schemas/RouteEntryentries[].name string Required in parent<provider>/<model> name, or a Respan route.Maximum length:
255entries[].weight number Optionalsplit route. A fallback route ignores it.Default:
1Minimum:
0OpenAPI response schema
{
"$ref": "#/components/schemas/Route"
}400
The route is invalid, for example an entry your project can’t call.
application/json
$ object BodyOpenAPI response schema
{
"type": "object"
}Example
{
"entries": [
"Entries must name a model, foundation model or Respan route this project can call. Not found: gpt-unknown."
]
}404
No route of that name.
application/json
$ object BodyOpenAPI response schema
{
"type": "object"
}Example
{
"detail": "Route not found."
}OpenAPI source
The operation and referenced components below retain the complete OpenAPI definitions, including constraints and examples.
OpenAPI operation
{
"summary": "Update a route",
"operationId": "updateRoute",
"tags": [
"Routes"
],
"parameters": [
{
"name": "name",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "The route's name. It may contain slashes, as in `openai/gpt-6-luna`."
}
],
"description": "Send `mode`, `entries` or both. A field you leave out keeps its value, and `entries` replaces the whole list.",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": [
"fallback",
"split"
],
"description": "`fallback` tries the entries in order. `split` picks one by weight, then tries the others."
},
"entries": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/components/schemas/RouteEntry"
},
"description": "The route's entries, in order."
}
},
"example": {
"entries": [
{
"name": "gpt-5.5",
"weight": 1
},
{
"name": "claude-sonnet-4-5-20250929",
"weight": 1
}
]
}
}
}
}
},
"responses": {
"200": {
"description": "The updated route.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Route"
}
}
}
},
"400": {
"description": "The route is invalid, for example an entry your project can't call.",
"content": {
"application/json": {
"schema": {
"type": "object"
},
"example": {
"entries": [
"Entries must name a model, foundation model or Respan route this project can call. Not found: gpt-unknown."
]
}
}
}
},
"404": {
"description": "No route of that name.",
"content": {
"application/json": {
"schema": {
"type": "object"
},
"example": {
"detail": "Route not found."
}
}
}
}
},
"security": [
{
"RespanApiKey": []
},
{
"DashboardJwt": []
}
]
}OpenAPI path metadata
{}Referenced OpenAPI components
{
"schemas": {
"Route": {
"type": "object",
"properties": {
"name": {
"type": "string",
"maxLength": 255,
"description": "The name you send as `model`. It may contain slashes."
},
"mode": {
"type": "string",
"enum": [
"fallback",
"split"
],
"description": "`fallback` tries the entries in order. `split` picks one by weight, then tries the others."
},
"entries": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/components/schemas/RouteEntry"
},
"description": "The route's entries, in order."
}
},
"required": [
"name",
"mode",
"entries"
],
"example": {
"name": "support-bot",
"mode": "fallback",
"entries": [
{
"name": "gpt-5.5",
"weight": 1
},
{
"name": "claude-sonnet-4-5-20250929",
"weight": 1
}
]
}
},
"RouteEntry": {
"type": "object",
"properties": {
"name": {
"type": "string",
"maxLength": 255,
"description": "A model, a foundation model, a `<provider>/<model>` name, or a Respan route."
},
"weight": {
"type": "number",
"minimum": 0,
"default": 1,
"description": "Share of traffic in a `split` route. A `fallback` route ignores it."
}
},
"required": [
"name"
]
}
},
"securitySchemes": {
"DashboardJwt": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "Dashboard JWT",
"description": "Use a dashboard JWT only for dashboard-authenticated endpoints. Respan API-key endpoints use the respanApiKey auth field instead.",
"x-fern-bearer": {
"name": "dashboardJwt",
"env": "RESPAN_DASHBOARD_JWT"
}
},
"RespanApiKey": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "Respan API key",
"description": "Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.",
"x-fern-bearer": {
"name": "respanApiKey",
"env": "RESPAN_API_KEY"
}
}
}
}