Skip to content
darkseek
OPERATIONS

Errors & retries

Inspect the HTTP status, JSON error code and X-Request-ID. Never share Authorization headers or sensitive prompts when reporting a request.

Before streaming starts

{
  "error": {
    "type": "rate_limit_exceeded",
    "code": "rate_limit_exceeded",
    "message": "Capacity or API key limit reached"
  }
}
StatusMeaningClient action
400Malformed or unsupported inputCorrect the request; do not retry it unchanged.
401Invalid or missing authenticationCheck the DarkSeek key. A DeepSeek key is not valid here.
403Disallowed browser originUse an allowed origin or your own server integration.
404 / 405Unknown route / wrong HTTP methodUse an implemented endpoint and its documented method.
413 / 415Oversized body / unsupported media typeReduce the body; send uncompressed application/json.
429Rate or concurrency limitWait at least Retry-After, then retry within a bounded budget with jitter.
502Backend or protocol failureA bounded retry may be appropriate. Generation may already have run.
503Service or deployment binding unavailableCheck service readiness. Repeated retries do not configure a missing binding.
504Inference deadline exceededReduce output/request size and use a bounded retry policy.

After streaming starts

HTTP status can no longer be replaced after the response has begun. Treat an event: error, network interruption or missing completion marker as failure, even if the original status was 200. Partial generated text is not a completed answer.

Cancellation and duplicate work

Cancel the HTTP request to stop consuming the stream. The Go gateway releases its admission slot and cancels its upstream request. Backend-side resource reclamation must also pass production load tests. Generation requests do not currently offer an idempotency contract: automatically resending a request can duplicate work.

Retry budget

Set a maximum attempt count and overall deadline. Retry only transient failures. Exponential backoff with jitter helps avoid synchronized retries; it is not a substitute for respecting capacity or fixing invalid credentials.