Skip to main content

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​

hostshape
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, capacity and rollouts_store_failed, and 409 idempotency_in_progress, after Retry-After;
  • 503 paused, after a short wait: it carries no Retry-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 the trace field 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​

statusmeaning
200The answer, with usage.cost_micros (1,000,000 is $1). A floor while a slow-lane arm is still pending.
401missing_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.
402Money: credits_exhausted, spend_ceiling, search_credit_only or budget_exceeded, below. Waiting does not fix it.
403scope, or an account that cannot use this route: fetch_unavailable, decisions_unavailable, not_claimed, as_of_requires_platform_key, rollouts_require_retention.
429A 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.
503agents_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​

codestatuswhat to do
credits_exhausted402The 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_ceiling402A 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_only402On 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_exceeded402No 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:

codestatusmeaning
missing_key401No Authorization: Bearer header.
bad_key401An unknown, revoked, expired or disabled key; one answer for all of them.
scope403The key's scopes do not cover this route; the message names the missing scope.
rate_limited429Over a rate limit. Honor Retry-After.
concurrency429Too many requests at once. Retry-After: 1.
paused503The platform is paused for everyone. The free reads still answer. Retry shortly; there is no Retry-After.
overloaded503The router is at its in-flight limit. Retry-After: 1.
not_ready503GET /healthz while the router starts or drains.

The shape of the request, refused before anything is spent:

codestatusmeaning
unknown_route404Not a route the router serves.
method_not_allowed405The route exists, with another method; Allow names it.
invalid_target, upgrade_unsupported400An absolute-form or percent-encoded request target, or an Upgrade header.
unsupported_media_type415A Content-Type that is not JSON.
malformed_json400A 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_large413A POST /v1/turns body over 512 KiB, or a POST /v1/rollouts/outcome body over 64 KiB.

Search:

codestatusmeaning
invalid_tier400An unknown tier, or one this key may not use.
invalid_query400An empty or too long query, or a bad domain_filter.
invalid_fast_set400A fast_set the router does not have; the message lists the valid names.
invalid_request400Any other field refused: view, an unknown provider, a bad Idempotency-Key, a feedback, turn or limits field, a trace-listing cursor.
idempotency_key_reused422The Idempotency-Key was used before with a different body.
idempotency_in_progress409The 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:

codestatusmeaning
as_of_invalid400Not 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_range400In the future or the last minute, or more than 365 days back (less a minute).
as_of_with_recency400With recency: a dated search takes no date window.
as_of_conflict400With search_queries, on the stream, or in the URL instead of the body.
as_of_not_enabled400This deployment does not serve dated searches.
as_of_requires_platform_key403The call would run on the account's own Perplexity key; dated searches run on the platform's key only.
as_of_unsupported_for_selection422No arm the tier, preset or providers chose serves a dated search; the message names the ones that do.
as_of_rate_limited429Past the one dated call a second shared across the service. Send the same request again after Retry-After.

Traces, feedback, the judge and limits:

codestatusmeaning
trace_not_found404No such trace for this project: unknown, expired or someone else's.
trace_no_content400POST /v1/judge on a trace that kept no content.
not_claimed403POST /v1/judge from an unclaimed agent.
judge_failed502The judge could not grade the trace.
judge_disabled503No judge is configured.
reload_failed502POST /v1/limits saved the caps but the router could not reload them. Retry.
internal500An unexpected error.

Fetch and decisions:

codestatusmeaning
fetch_unavailable403This account cannot fetch: an unclaimed agent, a zero-retention account, or one with no credit to bill.
fetch_disabled503Fetch is not offered here.
unknown_model400No decision model of that id; GET /v1/decisions/models lists them.
upstream_rejected400The model's vendor refused the request; the message is the vendor's.
payload_too_large413A decisions body over the cap, 2 MiB.
decisions_unavailable403This account cannot call the model.
decisions_disabled, model_unavailable503Decisions are not offered, or the platform holds no working key for this model.
upstream_failed503The 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):

codestatusmeaning
rollout_invalid400A 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_invalid400An 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_retention403The 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_exceeded429The project has written its 64 MiB of outcomes for this UTC day. Retry-After runs to midnight UTC.
rollouts_store_failed503The 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_unavailable503This router keeps no rollouts. Final.

Agent onboarding (agents-v1.jevlin.ai):

codestatusmeaning
not_found404An unknown or expired agent, or a key that is not this agent's.
rate_limited429Registration limits: 6 a minute per IP. Honor Retry-After.
capacity503The unclaimed pool is full. Honor Retry-After.
agents_disabled503Registration is off.
bad_scope400A requested scope that does not exist.
conflict409A claim race, for example.
unauthorized401The key was refused on a route that needs one.
bad_request400A malformed request to the agents host.