Documentation Index
Fetch the complete documentation index at: https://docs.anyapi.ai/llms.txt
Use this file to discover all available pages before exploring further.
Tag Routing
Guarantee the capabilities your request needs Not every backend supports every feature for a given model. Tag routing lets you declare exactly which capabilities your request requires — and AnyAPI guarantees it lands on a backend that supports them all. No more random failures because a backend can’t handle your PDFs, audio, or tool calls.How It Works
Add thetags parameter to your request with the capabilities you need. AnyAPI filters available backends to only those that match all your requested tags, then routes to the best one.
- All tags must match — if you send
["vision", "streaming"], the backend must support both - No match = 503 — if no backend supports all your tags, you’ll get a clear error instead of a cryptic failure
- Fully optional — skip tags entirely and AnyAPI routes as usual
🏷️ Tag Format
Tags use a simple two-level naming scheme:Endpoint Prefixes
| Prefix | API Endpoint |
|---|---|
chat_completions | /v1/chat/completions |
messages | /v1/messages |
responses | /v1/responses |
Available Capabilities
| Tag | What it guarantees |
|---|---|
vision | Image input support |
pdf_input | PDF file input support |
audio_input | Audio file input support |
reasoning | Extended thinking / chain-of-thought |
streaming | Streaming response support |
function_calling | Function / tool calling |
parallel_function_calling | Multiple tool calls in one turn |
tool_choice | Explicit tool selection (auto, required, none, named) |
computer_use | Computer use tool support |
assistant_prefill | Pre-fill assistant response |
prompt_caching | Prompt caching support |
web_search | Built-in web search |
url_context | URL context fetching |
vision) and as an endpoint-scoped tag (chat_completions:vision, messages:vision, responses:vision).
📨 Sending Tags
Request Body (recommended)
Pass atags array alongside your usual parameters:
HTTP Header
Use thex-router-tags header with comma-separated values:
If bothtagsin the body andx-router-tagsheader are present, the body takes precedence.
🧪 Examples
Vision — analyze an image
PDF — summarize a document
Streaming + Tool Calling
Reasoning via header
⚠️ Error Handling
When no backend matches your tags, AnyAPI returns a 503 with a clear message:- The model doesn’t support this capability on any backend
- Typo in a tag name — check the tag list above
- You’re using a generic tag but the capability is only available on specific endpoints
🔍 Discovering Tags for a Model
Query which tags any model supports:tags field.
Tips
- Start without tags — only add them when you need a specific capability that isn’t available everywhere
- Use endpoint-scoped tags —
chat_completions:visionis safer than justvisionbecause it guarantees the capability on the exact endpoint you’re calling - Combine with fallback chains — use the
modelsparameter alongside tags for maximum reliability - Check before you build — query
/v1/modelsto see which tags your target model supports before hardcoding them