Platform notice: all DeepSeek models are now live. New users receive trial credits on sign-up.
Api reference

Responses

An endpoint compatible with the OpenAI Responses API, suited to generation tasks with instructions and structured output.

Request

POST /api/gateway/v1/responses
  • Authentication: request header Authorization: Bearer sk-tp-... (create an API Key in the Console)
  • Content-Type: application/json

Request body

ParameterTypeRequiredDescription
modelstringYesPlatform model name; see Model list or Models
inputstring | arrayYesInput content (text or a message array); must not be empty
Other parameters-Noinstructions, max_output_tokens, metadata, and others are passed through per the OpenAI protocol
streamboolean-Streaming is not yet supported; passing true returns 400

Response

Returns OpenAI Responses JSON (id / status / output / usage). The response headers carry billing information for this call:

HeaderDescription
X-Cost-YuanCost of this call (yuan, 6 decimal places)
X-Usage-TokensTotal tokens for this call

Billing

  • Settled by usage.input_tokens / usage.output_tokens returned by the model, in "yuan per million tokens", with input and output priced separately. See Billing.
  • Cached-hit / cache-write tokens in usage.input_tokens_details are priced separately at the cache price; if a model has no cache price configured, the input price applies.
  • Costs are deducted from the account balance; every quota-limited key node along the request chain accumulates its subtree consumption.

Pre-checks

Before the call, the platform validates in order; if any step fails, an error is returned:

  1. Key valid and not revoked (including all parents), account status normal → otherwise 401
  2. Model exists and is available (LIVE) and is token-billed → otherwise 400
  3. input is not empty and stream is not enabled → otherwise 400
  4. Account balance greater than 0, key chain quota not exhausted → otherwise 402

Errors

For the error response body format and troubleshooting, see FAQ · Error codes. Errors returned by the upstream model service are passed through verbatim (status code and response body unchanged).

On this page