For AI agents, the documentation index lists all pages. Append .md to a documentation URL for Markdown, or request text/markdown.

Skip to Content
spare inference

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

FromTheir model idOurs
DeepSeek APIdeepseek-flashdeepseek-v4.1-flash
Togetherdeepseek-ai/DeepSeek-V4.1-Flash-1017deepseek-v4.1-flash
Fireworksaccounts/fireworks/models/deepseek-v4p1-flashdeepseek-v4.1-flash
Basetendeepseek-ai/DeepSeek-V4.1-Flashdeepseek-v4.1-flash

How is this guide?