DeepSeek V4.1 Flash is now available on Netra

Explore model
Netra Runtime

API REFERENCE

Errors, limits, and retries

Diagnose HTTP failures and avoid accidentally repeating billable work.

Overview

Chat Completions errors generally use {"error":{"message":"..."}}. Messages uses an Anthropic error envelope with type, error and request_id; see Messages API. Error details can vary, so do not assume every error has identical fields. Read the status, a safely logged message, X-Request-Id, and Retry-After where present.

StatusLikely causeNext step
400Invalid JSON, missing fields, query parameters, unsupported model capabilitySend a minimal valid body and add optional fields one at a time.
401Missing, invalid, expired, or revoked Netra keyCheck the connection secret and key status in the correct organization.
402Insufficient available credit or a key/organization spending limitCheck balance, reservations, and budget; repeated immediate retries will not fix it.
404Unknown endpoint or unavailable modelVerify the base URL and exact model ID with the same key.
405Wrong HTTP methodUse GET for models and POST for generation.
409Duplicate claimed X-Request-IdInvestigate the original execution; the conflicting request did not start another inference.
413Body exceeds the request limitReduce the body. The default limit is 64 MiB; model-specific limits can be lower.
415Compressed request bodySend uncompressed JSON.
429Rate limit, token limit, or model capacityHonor Retry-After; reduce concurrency and retry with bounded backoff.
502, 503Generation service temporarily unavailableRetry with bounded backoff after checking whether the original execution completed.
504Generation timed outHonor Retry-After if supplied; allow suitable timeout for the model.
Other error statusRequest rejected or generation failedInspect its safe error detail and model capability requirements.

There is no universal requests-per-minute or tokens-per-minute allowance in these docs: configured key, organization, and model limits govern your traffic. Retry-After values are seconds when supplied by the API.

A request must fit the model's byte and context-token limits. Check the safe error detail before retrying.

Request IDs and retries

The optional X-Request-Id header accepts a UUID. Generate one UUID for an intended execution, retain it with your application logs, and reuse that ID if retrying the same execution. Do not hard-code the same ID for unrelated calls.

Duplicate-request detection is best-effort and time-limited. A repeated ID can return 409, but it does not guarantee exactly-once execution, replay the original response, or make all retries free. After a transport failure, a retry may start another generation.

After an ambiguous timeout, inspect Observe or the observation MCP for the original request before issuing a new ID. Use exponential backoff with jitter, a retry limit, and an overall deadline for transient failures. Check your SDK's retry settings so they do not multiply application-level retries. Do not retry validation, authentication, or budget failures without fixing their cause.

Search documentation

Search across all documentation.

Up and down arrows to navigate

Enter to open

esc to close