For the complete documentation index, see llms.txt. This page is also available as Markdown.

Auto Router

Get Model Selection

post

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/selection

  • POST https://api.fastrouter.ai/v1/model/selection

Set model to fastrouter/auto for automatic selection.

Authorizations
AuthorizationstringRequired

FastRouter API Key. Get yours at https://fastrouter.ai

Format: Authorization: Bearer YOUR_API_KEY

Body
modelstringRequired

Set to fastrouter/auto for auto selection, or provide a specific model ID.

Example: fastrouter/auto
Responses
200

Model selection result

application/json
selected_modelstringOptional

The recommended model ID

Example: openai/gpt-4o
assigned_tagsstring[]Optional

Tags assigned to the prompt

Example: ["complex","coding"]
top_candidatesstring[]Optional

Top candidate models

Example: ["openai/gpt-4o","anthropic/claude-sonnet-4-20250514"]
selection_strategystring · enumOptionalExample: autoPossible values:
errorstringOptional

Error message if selection encountered issues

post/api/v1/model/selection
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