# DeepSeek API for your apps and coding tools

[HTML canonical](https://bettertoken.ai/en/deepseek-api/)

DeepSeek V4 Pro & V4.1 Flash · 1M context

One BetterToken key for Python, curl, Claude Code and OpenCode. Pay for the tokens you use, with prices in USD.

[Create an API key](https://bettertoken.ai/register) [View USD prices](https://bettertoken.ai/en/deepseek-api/#prices)

Create an account, copy your key and fund your BetterToken balance.

[API documentation ↗](https://docs.bettertoken.ai/en/api-reference/introduction)

OpenAI-compatible Base URL

`https://www.bettertoken.ai/v1`

Use deepseek-pro or deepseek-flash with your BetterToken API key.

## DeepSeek models and USD prices

USD per 1 million tokens. Input, cached input and output are billed separately.

### DeepSeek V4 Pro

Model ID: `deepseek-pro` · fixed version `deepseek-v4-pro-0813`

For complex code, reasoning and long agent tasks. 1M-token context.

|  |  |
| --- | --- |
| Input | $1.0296 |
| Cached input | $0.0343 |
| Output | $3.0888 |

[Create an API key](https://bettertoken.ai/register)

### DeepSeek V4.1 Flash

Model ID: `deepseek-flash` · fixed version `deepseek-v4.1-flash-1017`

For faster, lower-cost tasks. Supports image input, thinking and non-thinking modes, tool calling and JSON. 1M-token context.

|  |  |
| --- | --- |
| Input | $0.2340 |
| Cached input | $0.0047 |
| Output | $0.9360 |

[Create an API key](https://bettertoken.ai/register)

[All models and prices](https://bettertoken.ai/en/pricing/)

## Connect to DeepSeek API

Set your BetterToken Base URL, API key and model. Use the Anthropic-compatible endpoint for Claude Code.

OpenAI-compatible Base URL

`https://www.bettertoken.ai/v1`

Anthropic-compatible Base URL

`https://www.bettertoken.ai`

main.py

```python
from openai import OpenAI

client = OpenAI(
    base_url="https://www.bettertoken.ai/v1",
    api_key="YOUR_API_KEY",
)
response = client.chat.completions.create(
    model="deepseek-flash",
    messages=[{"role": "user", "content": "Explain this function briefly."}],
)
print(response.choices[0].message.content)
```

YOUR_API_KEY is your BetterToken key.

[Create an API key](https://bettertoken.ai/register)

## Get your API key in three steps

1. ### Create your account

   Register with BetterToken. Your API key is created automatically.
2. ### Copy your API key

   Use your BetterToken key with the Base URL and model ID shown above. Keep the key out of source control.
3. ### Add funds and send a request

   Top up your BetterToken balance in USD, then check token usage and charges in Workspace.

[Create an API key](https://bettertoken.ai/register)

## DeepSeek API FAQ

### Is BetterToken DeepSeek or an official reseller?

BetterToken is an independent API service, not DeepSeek or an official DeepSeek reseller. Top-ups fund your BetterToken balance, not an account at platform.deepseek.com.

### How do I get a DeepSeek API key through BetterToken?

Create a BetterToken account to receive your API key. Use that key with the BetterToken endpoint. It is not a key issued by platform.deepseek.com.

### How is DeepSeek API usage billed?

BetterToken charges your balance for actual token usage. Input, cached input and output rates are shown separately in USD per 1 million tokens. Check the current prices on this page before sending requests.

### Is BetterToken always cheaper than connecting to DeepSeek directly?

No. DeepSeek publishes lower off-peak rates, and outside its peak hours connecting directly can cost less than BetterToken. Compare the same model, input, cached input and output usage against the official pricing page: [https://api-docs.deepseek.com/quick_start/pricing/](https://api-docs.deepseek.com/quick_start/pricing/).

### Which DeepSeek models can I use?

Use deepseek-pro for DeepSeek V4 Pro or deepseek-flash for DeepSeek V4.1 Flash. The fixed version IDs are deepseek-v4-pro-0813 and deepseek-v4.1-flash-1017. Both models support a 1M-token context. Model availability and prices follow the current BetterToken catalog.

### Can I use Python, Claude Code or OpenCode?

Yes. Python, curl and OpenCode use the OpenAI-compatible Base URL https://www.bettertoken.ai/v1. Claude Code uses the Anthropic-compatible Base URL https://www.bettertoken.ai with deepseek-pro or deepseek-v4.1-flash-1017. Use your BetterToken API key in each client.

### Do I need a monthly subscription?

No. You pay for token usage from your BetterToken balance. Your paid balance does not reset every month. Bonus balances may have separate terms.

## Build with DeepSeek API

Create your BetterToken key, fund your USD balance and send your first request.

[Create an API key](https://bettertoken.ai/register)
