SPARROWCODES

OpenAI- and Anthropic-compatible API

Every major AI model. One API key.

Anthropic, OpenAI, Google, xAI, DeepSeek, Mistral, and Moonshot AI models, plus speech, transcription, image and video, through one endpoint your SDK already speaks. Pay as you go at the providers' list prices.

  • No subscription
  • Automatic fallback
  • Invoice for every top-up
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."}]
  }'
Example response200 OK
x-sparrow-provideranthropic
x-sparrow-modelanthropic/claude-sonnet-5.5
x-sparrow-cost-usd0.001676
usage18 in · 164 out

Models from

  • Anthropic
  • OpenAI
  • Google
  • xAI
  • DeepSeek
  • Mistral
  • Moonshot AI

23 chat models, 4 more model types

How it works

What happens to every request

Your code sends one request. SparrowCodes checks it, applies your privacy and routing rules, and keeps trying providers until one answers.

1

Your app

POST /v1/chat/completions
{
  "model": "anthropic/claude-sonnet-5.5",
  "models": ["openai/gpt-6.1-sol"],
  "provider": { "sort": "price" },
  "messages": [ … ]
}

Your normal SDK call, with an optional backup model and routing preference.

2

SparrowCodes

  1. Key, limits and balance

    Rejected before any provider is called if a limit would be passed.

  2. Privacy rules

    Personal data masked if you turned masking on. Nothing stored by default.

  3. Cache

    An identical recent request is answered instantly, at no token cost.

  4. Routing

    Providers ordered by your preferences and their live health.

3

Providers

  • Anthropic429 rate limited
    anthropic/claude-sonnet-5.5Not charged
  • OpenAI200 answered
    openai/gpt-6.1-solCharged at list price

Each attempt is logged. You see which provider answered and exactly what it cost.

Why SparrowCodes

Built for production traffic

The same models and the same API format. The difference is everything around the request.

Automatic fallback
List backup models in a request. If a provider errors or rate-limits, the next one answers, and you pay only for the answer.
Routing you control
Pin a provider order, allow or exclude providers, sort by price or speed, and cap the price you're willing to pay per request.
Response cache
Identical requests can be answered from cache in milliseconds at no token cost. Every cached response is marked in its headers.
Zero retention
Prompts and answers are not stored unless you turn logging on. Optional masking strips emails, phone numbers and card numbers before they leave.
Bring your own keys
Already have a provider account? Add its key and keep your own rates and limits, with SparrowCodes routing, logs and fallback on top.
Teams and roles
Owner, admin, developer and billing roles, two-factor sign-in, and an audit log of every change to keys, members and settings.
Spend limits
Monthly limits per key and alerts before your balance runs low, so a runaway script or a leaked key always has a ceiling.
Every request, itemised
Tokens, latency, provider, each fallback attempt and the exact cost, searchable and exportable to CSV.
Webhooks and Slack
Get low-balance, limit and key events in your own systems or a Slack channel as they happen.

Drop-in

Works with the SDKs you already use

Point your client at SparrowCodes by changing the base URL and the key. Streaming, tools, images and structured output work the way your SDK expects.

  • OpenAI SDK for Python
  • OpenAI SDK for Node.js
  • Anthropic SDK for Python
  • Vercel AI SDK
Setup guides
EndpointWhat it does
/v1/chat/completionsChat, tools, vision, streaming. OpenAI format.
/v1/messagesClaude's native format. Works with the Anthropic SDK.
/v1/responsesOpenAI Responses format, stateless.
/v1/embeddingsText embeddings for search and RAG.
/v1/images/generationsImage generation.
/v1/videosVideo generation, polled until ready.
/v1/audio/speechText to speech.
/v1/audio/transcriptionsSpeech to text.

Models

Provider list prices, per million tokens

No markup on tokens: you pay what the provider charges. The top model from each provider is below; the full catalog has 23 chat models, 5 image models, 3 video models, 5 transcription models, and 2 embedding models.

All models
ModelProviderContextInput / 1MOutput / 1MSupports
Claude Fable 5.1
anthropic/claude-fable-5.1
Anthropic1M$10$50Tools, Images
GPT-6 Astra
openai/gpt-6-astra
OpenAI1.05M$10$50Tools
Gemini 3.1 Pro (preview)
google/gemini-3.1-pro
Google1.05M$2$12Tools, Images
Grok 4.7
x-ai/grok-4.7
xAI500K$2$6Tools, Images
DeepSeek V4 Pro
deepseek/deepseek-v4-pro
DeepSeek1.05M$1.32$3.96Tools
Mistral Large 4
mistral/mistral-large-4
Mistral1.05M$0.70$2.10Tools, Images
Kimi K3
moonshotai/kimi-k3
Moonshot AI262K$3$15Tools

Pricing

Prepaid credits. No plans.

You add credits and each request spends exactly what it uses, at the provider's list price. A 5.5% platform fee applies when you buy credits. That's the whole pricing model.

Credits added to your balance
$100.00
Platform fee (5.5%)
$5.50
You pay
$105.50
Pricing calculator

Make your first request in minutes

Sign in with your email, add credits, create a key. Change two lines of code.

SparrowCodes: one API for Claude, GPT, Gemini, Grok and more