Reference

What error codes does the Cognocient proxy return?

All error codes returned by the Cognocient proxy. Every 4xx/5xx includes a structured JSON body with error type, message, and context.

Every error from the Cognocient proxy includes a structured JSON body with an error type, message, and context. This reference covers all 4xx and 5xx codes — including budget-specific errors your application should handle gracefully.

Error codes

StatusError fieldMeaningFix
401type: invalid_request_errorProxy key not found or malformedVerify key starts with sk-cog- and was generated in Settings → Proxy Keys
402code: trial_expired10-day trial ended, no active plan (dashboard/API endpoints only — see note below)Upgrade at cognocient.com/settings?tab=billing
429type: budget_errorMonthly feature budget exhaustedIncrease budget in Dashboard → Budgets, or enable Degrade mode to downgrade gracefully
429type: run_budget_exceededPer-run agent budget hitIncrease the run budget's per-run limit
429type: velocity_limit_exceededToken-per-minute circuit breaker trippedReduce request frequency or set a manual TPM limit in Settings → Proxy Keys → Velocity Limit
429type: dollar_velocity_limit_exceededDollar-per-minute circuit breaker tripped — see Guardrails → Dollar-denominated velocityReduce request frequency or set a manual $/min limit in Settings → Proxy Keys → Velocity Limit
502type: secret_manager_errorYour provider key is a secret-manager reference and the manager could not be reached, refused the request, or the secret is missingCheck the connection on the Integrations page; the message names the manager. Cognocient never falls back to another key
403code: plan_requiredThe feature (for example the Batch API, MCP gateway, SCIM or JWT authentication) is not on your planUpgrade the plan named in the response
200JSON-RPC error.code: -32001 / -32002MCP gateway: a tool call was refused by the server's tool policy (-32001) or blocked for sensitive arguments (-32002). The HTTP status is 200 because the error is in the JSON-RPC bodyAllow the tool in the server's policy, or remove the sensitive data from the arguments
403type: account_frozenEmergency Freeze is active for this accountUnfreeze from Settings → Safety & Limits, or the banner shown across the dashboard
503(no type field, message only)AI provider returned an error, or Cognocient couldn't reach itCheck the provider status page. The error body includes an upstream-unavailable message.
504(no type field, message only)AI provider took too long to respondRetry with exponential backoff. For long-running tasks, consider the batch API.

All error responses include a Content-Type: application/json header and a body of the form: {"error":{"message":"...", "type":"..."}} — except the 402 trial-expired response, which uses "code" instead of "type", and the 503/504 provider-passthrough errors, which carry only "message" with no type field at all. Catch errors by status code first, and check for error.type or error.code where present rather than assuming one is always there.

The 402 trial-expired check only gates dashboard and analytics API endpoints today — it is not enforced on the proxy's chat-completion path itself. A trial that has ended does not currently block AI calls made through the proxy.

Response headers

Every proxy response includes these headers. Read them to detect degraded calls, cache hits, and cost attribution.

x-cog-degraded (e.g. true)

Call was downgraded to a cheaper model due to budget threshold.

x-cog-original-model (e.g. gpt-4o)

Model that was requested in the original call.

x-cog-degraded-model (e.g. gpt-4o-mini)

Model that was actually used after degradation.

x-cog-cache-hit (e.g. true)

Response was served from similarity cache — cost was $0.00.

x-cog-similarity-score (e.g. 0.97)

Similarity score of the cached response (1.0 = exact match).

On this page