Skip to content
NewNexus 2.0 is here, and it’s open source. Read the launch post

API reference

Errors

Every error has an HTTP status, a type, often a stable code, and a message that says what to do.

View as Markdown

Errors from the Nexus API share one shape:

{
  "error": {
    "message": "there is already a team platform in this organization",
    "type": "invalid_request_error",
    "code": "slug_taken"
  }
}
  • message is written for people: it names what is wrong and, where it can, what to do next.
  • type is the broad class, by status.
  • code is stable: match on it in code, never on the message. Every 4xx carries one, and a 5xx only when it names a cause.

The agent gateway (/v1/anthropic/…, /v1/openai/…) answers errors in the provider's own error format instead, so Claude Code, Codex and the providers' SDKs understand them. So are model refusals on chat completions; see Models and policies.

By status

StatusTypeMeaning
400invalid_request_errorA field is missing or not valid; the message names it
401authentication_errorNo token, or a token Gateway does not accept: sign in again
402billing_errorThe call's maximum cost is more than the budget, the free start, the credits or the usage limit left, or a payment did not go through; see the code
403permission_errorYour role or your key may not do this
404not_foundNothing matches in your organization
405invalid_request_errorThe method is not allowed on this path
409invalid_request_errorThe request conflicts with the current state; see the code
413invalid_request_errorThe request body is too large
422invalid_request_errorAn idempotency key was reused for a different request
426invalid_request_errorThe nexus CLI is older than this Gateway supports (cli_too_old): run nexus update
429rate_limit_errorToo many requests from this key in a minute: wait and retry
500server_errorSomething unexpected failed on Gateway; the cause is in its logs, not in the answer
501not_implementedNot built yet (not_ported)
502api_error, module_unavailable, connector_errorA provider, product or outside service behind Gateway did not answer
503not_configured, server_errorNot configured on this Gateway, or the database is busy (database_busy): retry
504api_errorThe request passed Gateway's deadline (timeout), or a product's module did not answer in time (module_timeout)

Codes

CodeStatusWhat to do
role_required403Ask an owner or admin; the message says which roles may
not_in_team403Name a team you belong to, or ask to be added
model_not_allowed403Use a model your policies allow: nexus models; nexus policy test names the rule
model_not_found404Check the name: nexus models --all lists the catalog
model_not_supported400The model is coming soon, or not served on this API
cli_too_old426Run nexus update
module_key403A product's scoped key can only call models and connectors
module_unavailable502The product's module failed or could not be reached; the message names it. Retry later
module_timeout504The product's module did not answer within 28 s and may have started the work. Check its state before you retry. With the same Idempotency-Key, a retry gets idempotency_interrupted
nexus_ui_only403Do this in Nexus UI
unknown_team404Check the slug: nexus team list
budget_exceeded402Check nexus spend; an owner or admin can raise the budget
limit_grant_required403You may not set person spend limits. Ask an owner to set the limit, or to allow you to: nexus budgets managers add
payment_past_due402An invoice is unpaid past its grace period, so Nexus does not pay for the call: ask an owner to pay the month the message names, or use your own provider key
subsidy_exhausted402The free start is used up, or pays only for cheaper models. Set up billing (nexus billing), pick a cheaper model, or add your own provider key
credit_exhausted402The Nexus credits are used up: buy more with nexus billing credits buy, or add your own provider key
usage_limit_reached402What is left of this month's usage limit does not cover the call's cost at most (details.requestedUsd and details.remainingUsd): an owner raises the limit, or buys credits, in nexus billing
payment_failed402The last card charge failed: an owner replaces the card with nexus billing card add. When the bank wants the cardholder to confirm it (3-D Secure), an owner approves that same charge with nexus billing confirm
charge_processing402A charge for usage is still going through, such as a bank debit, and the card pays for no more calls until it is paid (details.chargeUsd, details.unpaidUsd, details.capUsd). Credits and your own provider keys still pay
provider_key_required403Your organization has no key for this provider: an owner or admin adds one with nexus keys add
subscriptions_disabled403Your organization turned off agents on personal plans: run the agent through Gateway (--api). Antigravity does not run until an owner or admin allows personal plans again: nexus org settings set agentSubscriptions true
route_unsupported400The agent runs only on your own plan, so --api is not available. Run it on your plan: nexus agy --subscription for Antigravity
slug_taken409Choose another slug
team_cycle, too_deep409A team can't be under itself, or more than 10 levels deep
has_children409Delete with cascade=1, or move the child teams first
plan_changed409Run the import's dry run again and review the new plan
confirmation_required400Send expect with the number of invitations you confirmed
count_changed409The number of invitations changed; review it again
not_a_clerk_org409This organization has no sign-in through Nexus UI, so there is no one to invite to it
owner_role409Transfer ownership first
not_an_admin409Only an admin can be allowed to set person spend limits: check the person's role with nexus members
code_used409Start nexus auth login again
installation_taken409That GitHub installation is linked to another organization
api_key_limit409You hold 100 live API keys in this organization: revoke one first
idempotency_in_progress409The first request with this key is still running: retry in a moment
idempotency_interrupted409The first request with this key was cut off and may have run in part: check the state, then use a new key
idempotency_key_reused422Use a new key for a different request
idempotency_stream_replay409A finished streamed call is not replayed: use a new key
idempotency_already_charged409That call was already charged: use a new key to run it again
invalid_idempotency_key400Keys are 1 to 255 printable ASCII characters
invalid_cursor400Start the listing again without cursor
database_busy503Nothing was written: retry

In the CLI

The CLI prints an error as one line and the fix, and exits non-zero: 1 for a failure, 2 for a usage error. With --json, it prints {"error": {"message", "hint"}} on stderr. NEXUS_DEBUG=1 adds the stack trace.