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

Embeddings

An OpenAI-compatible text embedding endpoint, including request parameters, billing rules, and error reference.

Request

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

Request body

ParameterTypeRequiredDescription
modelstringYesPlatform embedding model name; see Model list or Models
inputstring | string[]YesText to embed; pass an array to batch in one request, billed by the total tokens returned by the upstream
Other parameters-Nodimensions, encoding_format, and others are passed through per the OpenAI protocol; whether they take effect depends on the model called

Response

Returns OpenAI Embedding JSON (object / data[].embedding vector array / 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 as usage.prompt_tokens returned by the model multiplied by the model's input price (yuan per million tokens). See Billing.
  • 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), is token-billed, and has an input price configured → otherwise 400
  3. input is not empty → 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