DeepSeek-V4.io

API Documentation

One paid API key, three inference protocols, and one public model: deepseek-v4-flash.

V4.1 routing update: keep the public model ID above. Text requests now route to DeepSeek V4.1 Flash; image input is not yet part of this gateway's verified public API. Read the migration guide.

Quick start

Send a Chat Completions request
Store the key on your server or in an environment variable. Never put it in browser code.
from openai import OpenAI

client = OpenAI(
    base_url="https://deepseek-v4.io/api/v1",
    api_key="your-deepseek-v4-io-key",
)

response = client.chat.completions.create(
    model="deepseek-v4-flash",
    messages=[{"role": "user", "content": "Hello!"}],
)

print(response.choices[0].message.content)

Authentication

Pass the key as a Bearer token:

Authorization: Bearer sk-your-deepseek-v4-io-key

API keys are available only to paid DeepSeek-V4.io accounts. Free signup balance cannot create a key.

Request behavior and system messages

The public API does not add a hidden system message or steer responses toward any official website. Your messages and tools are forwarded in the protocol shape you send, apart from model routing and removal of unsupported provider-routing fields.

If your application needs a fixed identity, safety policy, or support behavior, include your own system message before the user message. DeepSeek-V4.io records request metadata such as token counts, message count, streaming mode, and whether system/tool fields were present; it does not store raw prompt or response text in API usage logs.

Endpoints

GET
/api/v1/models
List the public model catalog.
POST
/api/v1/chat/completions
OpenAI-compatible chat, SSE, and tools.
POST
/api/v1/responses
Responses API for Codex and agent tool loops.
POST
/api/v1/messages
Anthropic Messages-compatible API for Claude Code.
Streaming

Set stream: true. The endpoint returns text/event-stream and preserves the selected protocol's event format.

The gateway continues reading final usage for settlement if the client disconnects early.

Tools

Send the protocol's standard tools/functions and return tool results using the same protocol.

Provider-routing fields, fallback model arrays, plugins, and upstream credentials are not accepted.

Errors and limits

StatusMeaning
400Invalid body, model, or output limit.
401/403Missing, invalid, expired, or unauthorized key.
402Insufficient DeepSeek-V4.io token balance.
429API key rate limit exceeded.
5xxGateway or model provider failure.

Maximum request body: 2 MiB. Maximum requested output: 65,536 tokens. Use the X-Request-ID response header when contacting support.

Service disclosure

DeepSeek-V4.io is an independent service, not the official DeepSeek website. It uses third-party inference infrastructure. DeepSeek Platform and OpenRouter keys or balances are not interchangeable with a DeepSeek-V4.io key or balance.