DocsModel API

Model API

Call the models enabled on the platform from your own server. Usage is charged to your account's general credits. The API follows the OpenAI Chat Completions format.

Before you start

  1. Log in to the console with your DeepDoer account and check available models and prices under "Models & pricing".
  2. Create a key under "API Keys". The full key is shown only once; if you lose it, create a new one and revoke the old one.
  3. Keep the key in the server-side environment variable DEEPDOER_API_KEY. Never put it in front-end code, clients, logs or repositories.

Base URL and authentication

https://deepdoer.cn/developers/v1

Send Authorization: Bearer <API_KEY>. Web login tokens cannot be used for inference.

List models

Shell
curl "https://deepdoer.cn/developers/v1/models" \
  -H "Authorization: Bearer $DEEPDOER_API_KEY"

Returns only the model IDs this key can use. Call models by these IDs, not by the names shown in the desktop app.

Create a chat completion

Shell
curl "https://deepdoer.cn/developers/v1/chat/completions" \
  -H "Authorization: Bearer $DEEPDOER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "REPLACE_WITH_ENABLED_ALIAS",
    "messages": [{ "role": "user", "content": "Hello" }],
    "stream": false
  }'
OpenAI SDK
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.DEEPDOER_API_KEY,
  baseURL: "https://deepdoer.cn/developers/v1",
});

const completion = await client.chat.completions.create({
  model: "REPLACE_WITH_ENABLED_ALIAS",
  messages: [{ role: "user", content: "Hello" }],
});
console.log(completion.choices[0].message.content);
Node.js
const res = await fetch("https://deepdoer.cn/developers/v1/chat/completions", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.DEEPDOER_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "REPLACE_WITH_ENABLED_ALIAS",
    messages: [{ role: "user", content: "Hello" }],
  }),
});
Python
import os, requests

resp = requests.post(
    "https://deepdoer.cn/developers/v1/chat/completions",
    headers={"Authorization": f"Bearer {os.environ['DEEPDOER_API_KEY']}"},
    json={"model": "REPLACE_WITH_ENABLED_ALIAS", "messages": [{"role": "user", "content": "Hello"}]},
    timeout=60,
)
print(resp.json()["choices"][0]["message"]["content"])

Only GET /models and POST /chat/completions are available for now. Other endpoints such as /responses and /images return unsupported_endpoint.

Request parameters

POST /chat/completions accepts only the fields below. Any other field returns 400 invalid_request:

model, messages, stream, stream_options (only include_usage), max_tokens or max_completion_tokens (not both), temperature, top_p, stop, presence_penalty, frequency_penalty, seed, tools, tool_choice, parallel_tool_calls, response_format, n.

  • messages holds 1–128 items with role set to system, user, assistant or tool. content must be a plain text string; images and multi-part content are not supported.
  • n must be 1. stop is a string or 1–4 strings.
  • tools allows up to 32 entries, function type only.
  • If you omit the output limit, the platform cap applies. Values above the cap return 400.

Keys

  • Scope (specific models or all enabled models) and expiry are chosen at creation and cannot be changed. Create a new key if you need different settings.
  • You can rename a key and enable or disable it. Revoking cannot be undone, and expired keys cannot be re-enabled.
  • Request size, maximum output, requests per minute and concurrency limits are set by platform policy.

Billing

Each model is billed per call or per token, as shown by effectiveBillingType under "Models & pricing" (PER_CALL per call; TOKEN prices input, output and cache separately). Not every model has TOKEN billing enabled.

A request first places a hold on your credits and is settled by actual usage when it finishes. The hold is only an upper bound, not a charge. Statuses in the usage log:

Status Meaning
settled Settled; see settledCredits
running In progress; credits are held, not yet settled
settlement_pending / release_pending Settlement or release in progress
released Hold released, nothing charged
needs_attention Settlement is being reviewed by the platform
failed / cancelled The call failed or was cancelled

Unknown usage is never charged by estimate or by the hold amount. If usage is missing or settlement is unknown, wait for reconciliation; the bill update is authoritative.

Time-of-use pricing

Some TOKEN models are priced by time period (for example peak and off-peak). In GET /models and in the console's "Models & pricing" catalog, models whose effectiveBillingType is TOKEN carry the four fields below. GET /models leaves a field out (omitted when empty); the console returns null. If they are absent, use the top-level rates:

Field Meaning
pricingTiers Every tier: id, name, inputCreditsPer1m, outputCreditsPer1m, cacheReadCreditsPer1m, cacheWriteCreditsPer1m (decimal strings, credits per 1M tokens) and current (whether it is the tier in effect). Models without a schedule have one tier
pricingScheduleSummary One sentence describing the periods (Chinese only); empty without a schedule
pricingNextChangeAt When the tier next changes (ISO-8601 UTC, such as 2026-11-10T04:00:00Z); empty without a schedule
pricingNextTierId The id of the tier that takes effect at that time, matching an entry in pricingTiers; present exactly when pricingNextChangeAt is

Top-level fields such as inputCreditsPer1m are always the rates in effect right now. Each request is billed at the price in effect when the request starts. Once pricingNextChangeAt has passed, fetch the catalog again instead of working out the new price yourself.

Troubleshooting

Errors follow the OpenAI format. For streaming requests, the same body is sent as an SSE data event:

JSON
{
  "error": {
    "message": "Invalid API key",
    "type": "authentication_error",
    "param": null,
    "code": "invalid_api_key"
  }
}

type is authentication_error for 401, server_error for 5xx and invalid_request_error otherwise. Handle errors by code:

HTTP code Cause and what to do
400 invalid_request The body is not valid JSON, has an unsupported field or exceeds a limit; message names the field
400 unsupported_endpoint The endpoint is not available
401 invalid_api_key The key is missing, malformed, revoked, disabled or expired
402 insufficient_credit Not enough credits; top up and retry
403 api_disabled The Model API is not enabled
403 model_not_allowed The model is outside this key's scope or no longer enabled
429 rate_limit_exceeded Requests-per-minute or concurrency limit reached; retry later
502 upstream_error The upstream model returned an invalid or incomplete response
503 token_billing_not_ready / admission_unavailable The platform cannot accept the request right now; retry later

On timeouts, network errors or 5xx, check the usage log before retrying, to avoid duplicate calls.