Errors
Every error carries a machine code at the top level, on every host. Branch on the code, never on the message. An unrecognised code, and any 4xx without one, is final.
From the binary, the same refusals arrive as an envelope with an action to follow; see The envelope.
The two shapes
| host | shape |
|---|---|
api.jevlin.ai | {"error": "…", "code": "…"}: error is a message, on every refusal. |
agents-v1.jevlin.ai, platform.jevlin.ai | {"error": {"code": "…", "message": "…"}, "code": "…"}: the same code, also at the top level. |
When to send it again
Only these invite the same request again:
- the
429s (rate_limited,concurrency,as_of_rate_limited,outcome_quota_exceeded),503 overloaded,capacityandrollouts_store_failed, and409 idempotency_in_progress, afterRetry-After; 503 paused, after a short wait: it carries noRetry-After, since a pause has no known end;502 reload_failed, at once: the caps were saved, and only the reload failed;trace_unsupported, once, with thetracefield removed.
Every other code is final: fix the request, or tell the person. Never loop on a 401 or a 402. A 5xx with no code on this page: retry once with a backoff, then report it.
trace_unsupported (400) means a router rejected the body for its trace field. The hosted router accepts trace, so you will not see it there; it exists so that a client's rule "retry only on trace_unsupported" stays right against an older or trace-disabled router, and never double-posts after an unrelated validation error.
Statuses worth knowing
| status | meaning |
|---|---|
200 | The answer, with usage.cost_micros (1,000,000 is $1). A floor while a slow-lane arm is still pending. |
401 | missing_key or bad_key: a wrong, revoked or expired key, or an unclaimed agent's key past its week. Stop, do not retry; tell the person. An agent can poll its status: expired means register again. |
402 | Money: credits_exhausted, spend_ceiling, search_credit_only or budget_exceeded, below. Waiting does not fix it. |
403 | scope, or an account that cannot use this route: fetch_unavailable, decisions_unavailable, not_claimed, as_of_requires_platform_key, rollouts_require_retention. |
429 | A rate or concurrency limit. Honor Retry-After. Registration allows 6 a minute per IP. as_of_rate_limited is the dated-search limit, shared across the service: send the same request again after Retry-After. outcome_quota_exceeded is the project's 64 MiB of rollout outcomes a UTC day: its Retry-After runs to midnight UTC. |
503 | agents_disabled: self-registration is off. capacity: the unclaimed pool is full; honor Retry-After. overloaded: retry after Retry-After. paused: retry after a short wait, then back off; it sends no Retry-After. fetch_disabled: fetch is not offered here. rollouts_store_failed: the rollout store did not answer this time, or is still running one of your deletes; honor Retry-After. rollouts_unavailable: this router keeps no rollouts; final. |
Money
| code | status | what to do |
|---|---|---|
credits_exhausted | 402 | The credit paying for this key has run out. Credit belongs to a person: every organization they own shares one balance, and a team's members spend its owner's. That person tops up on the platform's billing page, or an admin adds funds there. Traces, limits, the account, turn ends, GET /v1/fast-sets and the rollout routes still work. |
spend_ceiling | 402 | A spend cap is reached: a cap you set (raise or clear it with POST /v1/limits), or the unclaimed agent's $0.10 a day. It resets when its window starts over, when the cap is raised, or when a person claims the agent. |
search_credit_only | 402 | On POST /v1/fetch and POST /v1/decisions only: the credit left is the part of the weekly allowance kept for search. Searches still work; this clears at the weekly reset or when credit is added. GET /v1/account says spend.non_search_exhausted. |
budget_exceeded | 402 | No set of providers fits this tier's per-query cost ceiling, even after trimming the dearest arms. Ask for less: a cheaper tier, fewer providers, or fewer search_queries, since the ceiling applies to each wording. The ceilings are on Search. |
Every code
The key and the gate:
| code | status | meaning |
|---|---|---|
missing_key | 401 | No Authorization: Bearer header. |
bad_key | 401 | An unknown, revoked, expired or disabled key; one answer for all of them. |
scope | 403 | The key's scopes do not cover this route; the message names the missing scope. |
rate_limited | 429 | Over a rate limit. Honor Retry-After. |
concurrency | 429 | Too many requests at once. Retry-After: 1. |
paused | 503 | The platform is paused for everyone. The free reads still answer. Retry shortly; there is no Retry-After. |
overloaded | 503 | The router is at its in-flight limit. Retry-After: 1. |
not_ready | 503 | GET /healthz while the router starts or drains. |
The shape of the request, refused before anything is spent:
| code | status | meaning |
|---|---|---|
unknown_route | 404 | Not a route the router serves. |
method_not_allowed | 405 | The route exists, with another method; Allow names it. |
invalid_target, upgrade_unsupported | 400 | An absolute-form or percent-encoded request target, or an Upgrade header. |
unsupported_media_type | 415 | A Content-Type that is not JSON. |
malformed_json | 400 | A body that is not valid JSON or has anything after its one JSON value, on any route; a search body over 64 KiB, or with a field the router does not know. |
body_too_large | 413 | A POST /v1/turns body over 512 KiB, or a POST /v1/rollouts/outcome body over 64 KiB. |
Search:
| code | status | meaning |
|---|---|---|
invalid_tier | 400 | An unknown tier, or one this key may not use. |
invalid_query | 400 | An empty or too long query, or a bad domain_filter. |
invalid_fast_set | 400 | A fast_set the router does not have; the message lists the valid names. |
invalid_request | 400 | Any other field refused: view, an unknown provider, a bad Idempotency-Key, a feedback, turn or limits field, a trace-listing cursor. |
idempotency_key_reused | 422 | The Idempotency-Key was used before with a different body. |
idempotency_in_progress | 409 | The first request under this Idempotency-Key is still running. Retry-After: 1. |
Dated search (as_of, on search and on fetch). None of these is ever answered as a live search instead:
| code | status | meaning |
|---|---|---|
as_of_invalid | 400 | Not an RFC 3339 time with a zone; empty ("", null or spaces); or named more than once. For a live search, leave the field out. |
as_of_out_of_range | 400 | In the future or the last minute, or more than 365 days back (less a minute). |
as_of_with_recency | 400 | With recency: a dated search takes no date window. |
as_of_conflict | 400 | With search_queries, on the stream, or in the URL instead of the body. |
as_of_not_enabled | 400 | This deployment does not serve dated searches. |
as_of_requires_platform_key | 403 | The call would run on the account's own Perplexity key; dated searches run on the platform's key only. |
as_of_unsupported_for_selection | 422 | No arm the tier, preset or providers chose serves a dated search; the message names the ones that do. |
as_of_rate_limited | 429 | Past the one dated call a second shared across the service. Send the same request again after Retry-After. |
Traces, feedback, the judge and limits:
| code | status | meaning |
|---|---|---|
trace_not_found | 404 | No such trace for this project: unknown, expired or someone else's. |
trace_no_content | 400 | POST /v1/judge on a trace that kept no content. |
not_claimed | 403 | POST /v1/judge from an unclaimed agent. |
judge_failed | 502 | The judge could not grade the trace. |
judge_disabled | 503 | No judge is configured. |
reload_failed | 502 | POST /v1/limits saved the caps but the router could not reload them. Retry. |
internal | 500 | An unexpected error. |
Fetch and decisions:
| code | status | meaning |
|---|---|---|
fetch_unavailable | 403 | This account cannot fetch: an unclaimed agent, a zero-retention account, or one with no credit to bill. |
fetch_disabled | 503 | Fetch is not offered here. |
unknown_model | 400 | No decision model of that id; GET /v1/decisions/models lists them. |
upstream_rejected | 400 | The model's vendor refused the request; the message is the vendor's. |
payload_too_large | 413 | A decisions body over the cap, 2 MiB. |
decisions_unavailable | 403 | This account cannot call the model. |
decisions_disabled, model_unavailable | 503 | Decisions are not offered, or the platform holds no working key for this model. |
upstream_failed | 503 | The vendor failed or timed out; the body says retryable: true. |
A fetch the upstream could not answer is not an error: it is a 200 whose page says "reason": "upstream_failed". See Read a page in full.
Rollouts (rollout on a search, and the /v1/rollouts/ routes; see Rollouts):
| code | status | meaning |
|---|---|---|
rollout_invalid | 400 | A search's rollout is not an object of question_id, rollout_id and an optional group_id, each 1 to 128 of [A-Za-z0-9._:-]; or an outcome's ids, an id filter or a delete's selector are not of that shape. Never dropped, unlike trace. A delete that names no outcomes, or names them two ways, is invalid_request. |
outcome_invalid | 400 | An outcome with answer or outcome missing or over 16 KiB as compact JSON, a reward that is not a number, a resolved_at that is not RFC 3339 with a zone or is outside 1900 to 2299, or a field the route does not take. |
rollouts_require_retention | 403 | The project keeps no search content, so it keeps no rollouts: the outcome write, the summary and the export refuse it. The delete never does. |
outcome_quota_exceeded | 429 | The project has written its 64 MiB of outcomes for this UTC day. Retry-After runs to midnight UTC. |
rollouts_store_failed | 503 | The rollout store failed a read or a write this time, is not ready yet, or is still running one of your deletes. Honor Retry-After. Partway through an export, it is the end line's error.code instead. |
rollouts_unavailable | 503 | This router keeps no rollouts. Final. |
Agent onboarding (agents-v1.jevlin.ai):
| code | status | meaning |
|---|---|---|
not_found | 404 | An unknown or expired agent, or a key that is not this agent's. |
rate_limited | 429 | Registration limits: 6 a minute per IP. Honor Retry-After. |
capacity | 503 | The unclaimed pool is full. Honor Retry-After. |
agents_disabled | 503 | Registration is off. |
bad_scope | 400 | A requested scope that does not exist. |
conflict | 409 | A claim race, for example. |
unauthorized | 401 | The key was refused on a route that needs one. |
bad_request | 400 | A malformed request to the agents host. |