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

FAQ

Authentication troubleshooting and an error code reference.

Authentication

How do I troubleshoot a 401?

Check in order:

  1. Is the request header Authorization: Bearer sk-tp-...? Note the single space between Bearer and the key.
  2. Was the key copied in full, and has it maybe expired and been recreated? The plaintext is shown only once at creation and can't be recovered if lost. Create a new key in the Console and revoke the old one.
  3. Has the key or any of its parents been revoked? Revoking a parent key invalidates its entire subtree.
  4. Is the account status normal (can you sign in to the Console)?

All my sub-keys suddenly stopped working?

Walk up the parent chain: if any parent has been revoked, the entire subtree is rejected on calls (401). To recover, create a new key under a valid parent key.

Why isn't there an X-Cost-Yuan header in streaming responses?

That header is returned only in non-streaming responses. For streaming calls, parse the final usage chunk to calculate the cost yourself, or check the charge in the billing ledger.

Error codes

Error response body format:

{ "statusCode": 402, "message": "Insufficient account balance. Please top up and retry." }

When parameter validation fails, message is an array of strings. Errors returned by the upstream model service are passed through verbatim (status code and response body unchanged).

Status codeScenarioCommon causes
400Invalid request parametersmodel doesn't exist or isn't available, messages is empty, field validation failed
401Authentication failedmissing Bearer, invalid or revoked key, account unavailable
402Insufficient balance or quotainsufficient account balance, a level in the key chain has exhausted its quota
403Insufficient permissionsome operations require identity verification first
404Resource not foundmodel, key, or order not found
409State conflictcreating a key / initiating a top-up before identity verification, creating a sub-key under a revoked parent
504Upstream timeoutupstream gateway timed out (300 seconds by default)

Other

  • Model prices and capability tags are subject to Models.
  • Invoicing is coming soon; see Billing.
  • For more questions, contact us via "Ticket feedback" in the Console.

On this page