Models API
Every major AI model. One API key.
Use Claude, GPT, Gemini, Grok, DeepSeek and more through the OpenAI and Anthropic formats your code already speaks. Change the base URL and the key; keep your SDK.
- Anthropic, OpenAI and Google models at the providers' own prices
- Fallback to another model when a provider fails
- Nothing stored by default
curl https://api.sparrowcodes.com/v1/chat/completions \
-H "Authorization: Bearer $SPARROW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-5.5",
"messages": [{"role": "user", "content": "Explain rate limiting in one paragraph."}]
}'23
Chat and coding models
10
Image models
2
Text to speech models
4
Transcription models
2
Embedding models
Reliability
Built for production traffic
The same models and the same API format. The difference is everything around the request.
- Automatic fallback
- List up to five backup models in
models. If a provider errors or rate-limits, the next one answers, and you pay only for the answer. - Provider routing
- Many models run on several providers. Sort by price, latency or throughput, pin an order, or block providers with
provider. - Sparrow Auto
- Send
sparrow/autoand we pick a model for each request: fast ones for short prompts, stronger ones for code, tools and hard tasks. - Response cache
- Identical requests answered from cache in milliseconds at no token cost, for up to 24 hours. Marked in the headers.
- Spend limits per key
- Lifetime or monthly limits on every key, plus alerts before your balance runs low.
- Bring your own keys
- Add your Anthropic, OpenAI or xAI key to use your own rates and quotas, with our routing and logs on top.
Fallback
When a provider fails, the next model answers
Errors caused by your request come straight back. Outages, rate limits and overloads move on to the next model, and the response headers tell you which one answered.
{
"model": "anthropic/claude-sonnet-5.5",
"models": ["openai/gpt-6.1-sol", "x-ai/grok-4.7"],
"provider": { "sort": "price", "data_collection": "deny" },
"messages": [{ "role": "user", "content": "…" }]
}
← X-Sparrow-Model: openai/gpt-6.1-sol
← X-Sparrow-Provider: openaiEndpoints
One base URL for chat, images, speech and more
OpenAI's Chat Completions and Responses formats and Anthropic's Messages format all work, on every chat model. Claude tools can run on GPT, and the other way round.
Chat models from Anthropic, DeepSeek, Google, OpenAI, qwen, xiaomi, z-ai.
| Endpoint | What it does |
|---|---|
| /v1/chat/completions | Chat, tools, vision, streaming. OpenAI format. |
| /v1/messages | Claude's native format. Works with the Anthropic SDK and Claude Code. |
| /v1/responses | OpenAI Responses format, stateless. |
| /v1/embeddings | Text embeddings for search and RAG. |
| /v1/images/generations | Image generation. |
| /v1/audio/speech | Text to speech. |
| /v1/audio/transcriptions | Speech to text. |
| /v1/videos | Video generation, polled until ready. |
Visibility
Know what every request cost
- Cost on every response
usage.costin US dollars on every response, and in the last streamed chunk.- Searchable activity log
- Tokens, latency, provider, each fallback attempt and the exact cost, exportable to CSV.
- Refused up front, not halfway
- The worst-case cost is reserved before a request starts, so a request never stops mid-answer for lack of credit.
- Webhooks and Slack
- Low-balance, limit and key events in your own systems or a Slack channel.
- Leaked key protection
- If GitHub finds one of your keys in public code, we disable it within seconds and tell you.
- Teams and roles
- Owner, admin, developer and billing roles, two-factor sign-in and an audit log.
Make your first request in minutes
Sign in with your email, create a key and start on the free plan. Change two lines of code.