> ## Documentation Index
> Fetch the complete documentation index at: https://docs.refillapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Create an API key and send your first request in a few minutes.

RefillAPI gives you one OpenAI-compatible API for text, video, image and audio models — DeepSeek, Kimi, GLM, Qwen, MAGI-2, MiniMax-H3, Wan and more. One API key works for all of them, and you pay per use in US dollars.

## What you need

| Item | Value | Where to get it |
| - | - | - |
| Base URL | `https://refillapi.com/v1` | Same for every model |
| API key | Starts with `sk-` | [Console → API Keys](https://refillapi.com/keys) |
| Model ID | For example `deepseek-v4-pro` or `magi-2` | [Models & pricing](https://refillapi.com/pricing) — use the copy button next to the model name |

> [!WARNING]
>
> Use the exact model ID, not the display name. `DeepSeek V4 Pro` or `deepseek-v4` returns a "model not found" error.

## Send your first request

**1. Create an API key**

Sign in, open [API Keys](https://refillapi.com/keys) and click **Create API Key**. Then add credit in [Wallet](https://refillapi.com/wallet) — see [Billing](https://docs.refillapi.com/account/billing.md).

> [!WARNING]
>
> Treat the key like a password. Keep it out of public repositories, front-end code and screenshots.

**2. Call a model**

Replace `YOUR_API_KEY`, then run:

```bash curl theme={null}
curl https://refillapi.com/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "deepseek-flash", "messages": [{"role": "user", "content": "Hello"}]}'
```

```python Python theme={null}
from openai import OpenAI

client = OpenAI(api_key="YOUR_API_KEY", base_url="https://refillapi.com/v1")
response = client.chat.completions.create(
    model="deepseek-flash",
    messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)
```

```javascript Node.js theme={null}
import OpenAI from "openai";

const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://refillapi.com/v1" });
const response = await client.chat.completions.create({
  model: "deepseek-flash",
  messages: [{ role: "user", content: "Hello" }],
});
console.log(response.choices[0].message.content);
```

**3. Check the result**

The answer is in `choices[0].message.content`. Every call, with its usage and cost, shows up in [Usage Logs](https://refillapi.com/usage-logs/common). If the call fails, the error message says why — see [Errors](https://docs.refillapi.com/errors.md).

## Which base URL does my tool want?

| The tool asks for | Enter |
| - | - |
| OpenAI base URL / API base (most SDKs and tools) | `https://refillapi.com/v1` |
| Full endpoint URL (ends with `/chat/completions`) | `https://refillapi.com/v1/chat/completions` |
| Anthropic base URL ([Claude Code](https://docs.refillapi.com/integrations/claude-code.md)) | `https://refillapi.com` — the tool appends `/v1/messages` itself |

> [!TIP]
>
> A wrong base URL returns 404, and the message tells you whether `/v1` is missing, doubled, or the base URL was used as a full endpoint.

## Next steps

> [card] [Generate a video](https://docs.refillapi.com/api/videos/overview.md)
>
> Async video tasks with MAGI-2, MiniMax-H3 and Wan.

> [card] [Chat completions](https://docs.refillapi.com/api/chat.md)
>
> Request fields, streaming and tool calls.

> [card] [Claude Code](https://docs.refillapi.com/integrations/claude-code.md)
>
> Use DeepSeek, Kimi or GLM as the model behind Claude Code.

> [card] [Models](https://docs.refillapi.com/models.md)
>
> Which endpoint each model uses and how it is billed.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.