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 typeMeaningFix
401invalid_proxy_keyProxy key not found or malformedVerify key starts with sk-cog- and was generated in Dashboard → API Keys
402trial_expired10-day trial ended, no active planUpgrade at cognocient.com/dashboard/billing
429budget_exceededMonthly feature budget exhaustedIncrease budget in Dashboard → Budgets, or enable Degrade mode to downgrade gracefully
429run_budget_exceededPer-run agent budget hitIncrease per_run_limit_usd on the budget, or pass a higher limit via X-Cost-Run-Budget header
429velocity_exceededToken/minute or requests/minute rate limit hitReduce request frequency or increase velocity limit in Dashboard → Budgets → Guardrails
500provider_errorAI provider returned an errorCheck the provider status page. The error body will include the upstream error message.
504provider_timeoutAI provider took > 60 secondsRetry 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":"..."}}. Catch errors by error.type, not by message string.

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).


Next steps: Troubleshooting · Budget Enforcement · Guardrails

On this page