# Quick start (/docs/quickstart)

> For AI agents, the [documentation index](https://bitrouter.ai/llms.txt) lists all pages. Append .md to a documentation URL to read its Markdown.

## 1. Get a key \[#1-get-a-key]

Sign in and copy your API key. New accounts get $5 of free tokens.

```bash
export SPARE_API_KEY="sk-..."
```

## 2. Change the base URL \[#2-change-the-base-url]

**Python**

```python
from openai import OpenAI
import os

client = OpenAI(
    base_url="https://api.spareinference.ai/v1",  # [!code highlight]
    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)
```

**TypeScript**

```ts
import OpenAI from 'openai';

const client = new OpenAI({
  baseURL: 'https://api.spareinference.ai/v1', // [!code highlight]
  apiKey: process.env.SPARE_API_KEY,
});

const resp = await client.chat.completions.create({
  model: 'deepseek-v4.1-flash',
  messages: [{ role: 'user', content: 'Hello' }],
});
console.log(resp.choices[0].message.content);
```

**curl**

```bash
curl -i https://api.spareinference.ai/v1/chat/completions \
  -H "Authorization: Bearer $SPARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek-v4.1-flash","messages":[{"role":"user","content":"Hello"}]}'
```

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](https://bitrouter.ai/docs/integrations) for the exact setup.

## 3. See what you paid \[#3-see-what-you-paid]

Every response carries an `x-bitrouter-request-id` header. Look it up with
[settlement](https://bitrouter.ai/docs/api/settlement) to see the tokens it used and what it cost, or open **Activity** in the
console. See [Pricing](https://bitrouter.ai/docs/pricing).

## Coming from another provider \[#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` |

{/\* TODO: verify each provider's id against its live /v1/models before launch. \*/}