Auto Router
Returns the optimal model recommendation for a given prompt without making the actual completion request. Uses FastRouter's intelligent routing engine.
Available at both:
POST https://api.fastrouter.ai/api/v1/model/selectionPOST https://api.fastrouter.ai/v1/model/selection
Set model to fastrouter/auto for automatic selection.
FastRouter API Key. Get yours at https://fastrouter.ai
Format: Authorization: Bearer YOUR_API_KEY
Set to fastrouter/auto for auto selection, or provide a specific model ID.
fastrouter/autoModel selection result
The recommended model ID
openai/gpt-4oTags assigned to the prompt
["complex","coding"]Top candidate models
["openai/gpt-4o","anthropic/claude-sonnet-4-20250514"]autoPossible values: Error message if selection encountered issues
Bad Request - The request is malformed. This could be due to missing parameters, invalid formats, or routing errors.
Note: the 400 body shape is not uniform. Validation errors return the structured object below, but routing/model errors may instead return a plain string: { "error": "<message>" }. A few endpoints (e.g. some file operations) may return a plain-text body rather than JSON.
Invalid Credentials - Your API key is invalid, missing, or disabled. Check your credentials.
Note: the 401 error body uses code, message, param, and type (there is no status field), and type is invalid_request_error.
Internal Error - Something went wrong on our side. Retry the request, and contact support if the issue persists.
POST /api/v1/model/selection HTTP/1.1
Host: api.fastrouter.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 141
{
"model": "fastrouter/auto",
"messages": [
{
"role": "user",
"content": "Write a complex recursive algorithm to solve the Tower of Hanoi problem."
}
]
}{
"selected_model": "openai/gpt-4o",
"assigned_tags": [
"complex",
"coding",
"reasoning"
],
"top_candidates": [
"openai/gpt-4o",
"anthropic/claude-sonnet-4-20250514",
"google/gemini-2.5-pro"
],
"selection_strategy": "auto"
}Last updated
