Quick start
Point your existing OpenAI SDK at Spare Inference.
1 min readEdit this page
1. Get a key
Sign in and copy your API key. New accounts get $5 of free tokens.
export SPARE_API_KEY="sk-..."2. Change the base URL
from openai import OpenAI
import os
client = OpenAI(
base_url="https://api.spareinference.ai/v1",
api_key=os.environ["SPARE_API_KEY"],
)
resp = client.chat.completions.create(
model="deepseek-v4.1-flash",
messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)That's the whole migration. Streaming, tool calls and JSON mode work as they do with OpenAI.
Using Claude Code, Codex, OpenCode or the Anthropic SDK? See Integrations for the exact setup.
3. See what you paid
Every response carries an x-bitrouter-request-id header. Look it up with
settlement to see the tokens it used and what it cost, or open Activity in the
console. See Pricing.
Coming from another provider
| From | Their model id | Ours |
|---|---|---|
| DeepSeek API | deepseek-flash | deepseek-v4.1-flash |
| Together | deepseek-ai/DeepSeek-V4.1-Flash-1017 | deepseek-v4.1-flash |
| Fireworks | accounts/fireworks/models/deepseek-v4p1-flash | deepseek-v4.1-flash |
| Baseten | deepseek-ai/DeepSeek-V4.1-Flash | deepseek-v4.1-flash |
How is this guide?