API REFERENCE

Build with your-api

One OpenAI-compatible API for the models published in your dashboard. Examples below use the production endpoint and can be pasted directly into a terminal after setting your key.

Base URL

https://api.your-api.xyz

Do not append an extra /v1 to this value.

Authentication

Bearer token

Create and manage keys under API Keys.

Billing

Credits

Each request consumes Credits; usage is reserved before a request and settled from actual usage.

DEEPSEEK HARNESS

Connect DeepSeek Harness to your-api

Configure a custom provider with your your-api key, DeepSeek thinking controls, tools, and streaming.

Open guide

Quick start

Set your key once, then run any example below.

export API_KEY="sk-your-api-key"

List models

Return the models currently published and available to your API key.

GET/v1/models
curl https://api.your-api.xyz/v1/models \
  -H "Authorization: Bearer $API_KEY"

Chat completion

OpenAI-compatible non-streaming chat completion.

POST/v1/chat/completions
curl https://api.your-api.xyz/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.5",
    "messages": [{"role": "user", "content": "Reply with OK"}],
    "max_tokens": 64,
    "stream": false
  }'

Streaming chat

Set stream to true and consume Server-Sent Events until [DONE].

POST · SSE/v1/chat/completions
curl -N https://api.your-api.xyz/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.5",
    "messages": [{"role": "user", "content": "Reply with OK"}],
    "max_tokens": 64,
    "stream": true
  }'

DeepSeek Responses API

Native Responses interface for DeepSeek V4. Both JSON and SSE streaming are supported.

POST/v1/responses
curl https://api.your-api.xyz/v1/responses \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4-pro",
    "input": "Reply with OK",
    "thinking": {"type": "enabled"},
    "reasoning_effort": "high",
    "max_output_tokens": 64,
    "stream": false
  }'

DeepSeek Anthropic Messages

Native Anthropic-compatible interface for DeepSeek V4, including thinking, tools, content blocks, and streaming.

POST/v1/messages
curl https://api.your-api.xyz/v1/messages \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4-pro",
    "messages": [{"role": "user", "content": [{"type": "text", "text": "Reply with OK"}]}],
    "thinking": {"type": "enabled", "budget_tokens": 2048},
    "output_config": {"effort": "high"},
    "max_tokens": 64,
    "stream": false
  }'

DeepSeek thinking mode

Enable or disable thinking explicitly. The response returns reasoning_content separately from the final content.

POST/v1/chat/completions
curl https://api.your-api.xyz/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4-pro",
    "messages": [{"role": "user", "content": "Which is larger, 9.11 or 9.8?"}],
    "thinking": {"type": "enabled"},
    "reasoning_effort": "max",
    "max_tokens": 2048,
    "stream": false
  }'

DeepSeek JSON Output

Request valid JSON. Your prompt must explicitly mention JSON and describe the expected structure.

POST/v1/chat/completions
curl https://api.your-api.xyz/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4-flash",
    "messages": [
      {"role": "system", "content": "Return JSON with string fields answer and explanation."},
      {"role": "user", "content": "Reply in JSON: what is 2 + 2?"}
    ],
    "response_format": {"type": "json_object"},
    "max_tokens": 256
  }'

Image generation

OpenAI-compatible image generation. Check Models for currently available image models.

POST/v1/images/generations
curl https://api.your-api.xyz/v1/images/generations \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2-vip",
    "prompt": "A minimal blue circle on a warm white background",
    "n": 1,
    "size": "1024x1024"
  }'

Create video task

Step 1 of 2: create an asynchronous task using one of exactly 3 models: seedance2.0-pro, seedance2.0-fast, or seedance2.0-mini. Save the returned id. callback_url is not supported.

POST/v1/videos/generations/tasks
curl https://api.your-api.xyz/v1/videos/generations/tasks \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "seedance2.0-pro",
    "content": [{"type": "text", "text": "A kangaroo surfing through a starry sky, cinematic, 4K"}],
    "ratio": "9:16",
    "duration": 5,
    "watermark": false
  }'

Get video task

Query a task with the same account. Your application decides when and how often to call this endpoint; the platform does not poll automatically. When status is succeeded, read content.video_url.

GET/v1/videos/generations/tasks/:task_id
curl https://api.your-api.xyz/v1/videos/generations/tasks/task_xxxxxxxxxxxxxxxxxxxxxxxx \
  -H "Authorization: Bearer $API_KEY"

DEEPSEEK V4

Thinking, multi-turn conversations, and tools

Thinking output

Thinking is enabled by default. Set thinking.type to disabled to turn it off. Chat Completions returns thinking in message.reasoning_content and the final answer in message.content. Streaming uses the same fields under delta.

Reasoning effort

OpenAI format accepts reasoning_effort values high and max. Anthropic format uses output_config.effort. Sampling parameters such as temperature and top_p have no effect while thinking is enabled.

Multi-turn history

Chat Completions is stateless, so send the full message history on every request. Historical reasoning may be omitted for ordinary assistant replies.

Tool-call requirement

After an assistant tool call, preserve and resend that assistant message's reasoning_content, content, and tool_calls. Omitting its reasoning content can produce an upstream HTTP 400 response.

DeepSeek protocol compatibility

Use /v1/chat/completions for OpenAI Chat Completions clients, /v1/responses for Responses clients, or /v1/messages for Anthropic clients. DeepSeek text, thinking, and tool blocks are preserved. DeepSeek does not provide embeddings, image generation, or rerank APIs, and its Anthropic-compatible interface does not support image, document, MCP, code-execution-result, or container-upload content blocks.

Successful responses

Chat, Responses, and Messages calls include a protocol-specific usage object. Streaming responses use text/event-stream. Image calls return either a URL or base64 image data.

Errors and availability

Use the Models endpoint as the source of truth. Errors use an error object with a message and code. Failed upstream calls refund reserved balance.