An organization's members and roles (one owner, admins, members), ownership and budget. When the sign-in provider holds the organization, its roles change through Nexus UI, which updates the provider first.
Its sign-in provider organization's id: Nexus UI's URL segment when it has no slug
kind"company" | "personal"required
A company organization, or a person's own personal organization (one per person, one member)
role"owner" | "admin" | "member"
currentboolean
The organization this request is in
imageUrlstring
Its logo, as the tenant's imageUrl (https://img.clerk.com/…); unset when it has none.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
Create a company organization that Nexus Gateway alone holds, with no sign-in provider organization behind it. You become its owner. Without a slug, the first free one made from the name is used. Only once the Gateway holds organizations; before that, 409 use_nexus_ui. Audited as org.created and member.joined.
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Request body · application/json
namestringrequired
1 to 120 characters after trimming
slugstring
A lowercase DNS label that is not a Nexus UI page (settings, invite, …)
pattern ^[a-z0-9][a-z0-9-]{0,62}$
Responses
201Createdapplication/json
idstringrequired
namestringrequired
slugstring
clerkOrgIdstring
Its sign-in provider organization's id: Nexus UI's URL segment when it has no slug
kind"company" | "personal"required
A company organization, or a person's own personal organization (one per person, one member)
role"owner" | "admin" | "member"
currentboolean
The organization this request is in
imageUrlstring
Its logo, as the tenant's imageUrl (https://img.clerk.com/…); unset when it has none.
400The request is not valid; the message names the field. A JSON body that is not an object, or a string in it that holds U+0000 (`nul_in_string`), is a 400 on every route that reads one. So is an `Idempotency-Key` that is not 1 to 255 printable ASCII characters (`invalid_idempotency_key`).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
409Another company organization has the slug (`slug_taken`), or the sign-in provider still holds the Gateway's organizations (`use_nexus_ui`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503`cutover_paused`: only while the operator pauses sign-in for the auth cutover; nothing changed. Retry after `Retry-After` seconds.application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
400
invalid_request_error
A field is missing or not valid; the message names it
400
The request is not valid; the message names the field. A JSON body that is not an object, or a string in it that holds U+0000 (`nul_in_string`), is a 400 on every route that reads one. So is an `Idempotency-Key` that is not 1 to 255 printable ASCII characters (`invalid_idempotency_key`).
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
409
Another company organization has the slug (`slug_taken`), or the sign-in provider still holds the Gateway's organizations (`use_nexus_ui`)
409
use_nexus_ui
Only once the Gateway holds organizations; before that, 409 `use_nexus_ui`
409
idempotency_in_progress
A request with the same Idempotency-Key is still running
409
idempotency_interrupted
The first request with this Idempotency-Key was cut off and may have run in part
422
idempotency_key_reused
The Idempotency-Key was used with a different request
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429
rate_limit_error
Too many requests from this key in a minute
503
`cutover_paused`: only while the operator pauses sign-in for the auth cutover; nothing changed. Retry after `Retry-After` seconds.
Counts keyed by the caller’s current organization memberships.
checkedAtintegerrequired
Gateway time in milliseconds since the Unix epoch.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
A new token for another of your organizations (by slug, id, or personal), of your credential's kind (cli or ui; an API key gets a cli token that is still an API key to the Gateway), and who you are there. Your current credential stays valid.
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Request body · application/json
orgstringrequired
A slug, an id, or personal
Responses
200OKapplication/json
tenantobjectrequired
idstringrequired
namestringrequired
createdAtstring (date-time)required
slugstring
kind"company" | "personal"
A company organization, or a person's own personal organization (one per person, one member)
imageUrlstring
The organization's logo, as Clerk serves it (https://img.clerk.com/…); unset when it has none.
mark"staff" | "test" | "demo"
Set only when it is Nexus's own; unset for a customer's.
userobject
The person calling, when the key is a person's
idstringrequired
emailstring
namestring
mark"staff" | "test" | "demo"
Set only when it is Nexus's own; unset for a customer's.
teamsarray of object
Your teams in this organization
idstring
slugstring
namestring
role"lead" | "member"
lead is reserved for the planned team-lead role and grants nothing extra yet.
teamobject
Your default team
idstring
slugstring
namestring
featuresGatewayFeatures
The products this Gateway has on. Unset reads as all off.
wikibooleanrequired
Nexus Wiki is on. Off, its routes and Ask your code answer 404 wiki_off, and clients hide them.
appsboolean
Nexus Apps (NEXUS_APPS_ENABLED): nexus apps and /v1/apps. An older Gateway leaves it out: off.
agentSessionAuditboolean
Coding agent sessions write agent_session.started and agent_session.ended audit events (NEXUS_AUDIT_AGENT_SESSIONS). An older Gateway leaves it out: off.
tokenstringrequired
Nx_…: shown once
tokenKind"cli" | "ui"required
expiresAtstring (date-time)
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
400
invalid_request_error
A field is missing or not valid; the message names it
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
409
idempotency_in_progress
A request with the same Idempotency-Key is still running
409
idempotency_interrupted
The first request with this Idempotency-Key was cut off and may have run in part
422
idempotency_key_reused
The Idempotency-Key was used with a different request
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
Delete your own account, from a sign-in made in the last ten minutes (not an API key; a dry run says signInNeeded when yours is older). The sign-in provider deletes your sign-in, the payment provider deletes your personal organization's customer (its plan ends at once), and Gateway takes you out of every organization, closes your personal organization and erases your email and name. Your organizations' spend and audit trail stay, under your user id. Before the customer goes, paying after the fact turns off and one charge tries your personal organization's unpaid usage on the card on file; what it does not collect is written off (unpaidUsageUsd), and its Nexus credits are lost (creditsLostUsd). Refused while you own a company organization: transfer ownership first. A deletion needs confirm: "DELETE", which the person types to confirm. dryRun checks and changes nothing.
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Request body (optional) · application/json
dryRunboolean
confirm"DELETE"
What the person typed to confirm: DELETE. A deletion without it changes nothing (400 confirmation_required); a dry run needs none.
Responses
200OKapplication/json
userIdstringrequired
dryRunbooleanrequired
deletedbooleanrequired
False on a dry run; true once the account is deleted.
personalOrgstring
Your personal organization's id, closed with the account; absent when you have none.
leftarray of objectrequired
The company organizations you leave.
idstringrequired
namestringrequired
planEndedbooleanrequired
Whether your personal organization's plan and cards at the payment provider end with it.
signInNeededbooleanrequired
Whether you must sign in again first: only a sign-in from the last ten minutes deletes your account.
unpaidUsageUsdstring
Your personal organization's usage that its card has not paid, as a decimal dollar string. On a dry run, what the deletion charges to the card on file first. Once deleted, what that charge did not collect, which Nexus writes off. Absent when nothing is unpaid.
creditsLostUsdstring
Your personal organization's Nexus credits that the deletion loses, as a decimal dollar string. Nothing refunds them. Absent when none are left.
400The person did not type DELETE to confirm (`confirmation_required`). Nothing changed.application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
403A sign-in older than ten minutes (`recent_sign_in_required`): sign in again first. An API key, not a sign-in (`sign_in_required`), or a caller that is no person (`person_required`). Nothing changed.application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
404The account is already deleted (`not_found`).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
409You own a company organization (`owns_organization`); `nexus.organizations` lists each one's id, name and slug. Or calls your card pays for, or a charge for your usage, are still running (`usage_settling`): paying after the fact is now off; try again in 10 minutes. Nothing else changed.application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
502Clerk did not delete your sign-in (`clerk_unavailable`), or the payment provider did not delete the customer; retry.application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503This Gateway has no secret key for the sign-in provider, or no Stripe key while your personal organization has a customer (`not_configured`); nothing changed. Also `cutover_paused`, only while the operator pauses sign-in for the auth cutover; nothing changed. Retry after `Retry-After` seconds.application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
400
invalid_request_error
A field is missing or not valid; the message names it
400
The person did not type DELETE to confirm (`confirmation_required`). Nothing changed.
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
404
The account is already deleted (`not_found`).
409
You own a company organization (`owns_organization`); `nexus.organizations` lists each one's id, name and slug. Or calls your card pays for, or a charge for your usage, are still running (`usage_settling`): paying after the fact is now off; try again in 10 minutes. Nothing else changed.
409
idempotency_in_progress
A request with the same Idempotency-Key is still running
409
idempotency_interrupted
The first request with this Idempotency-Key was cut off and may have run in part
422
idempotency_key_reused
The Idempotency-Key was used with a different request
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429
rate_limit_error
Too many requests from this key in a minute
502
Clerk did not delete your sign-in (`clerk_unavailable`), or the payment provider did not delete the customer; retry.
503
This Gateway has no secret key for the sign-in provider, or no Stripe key while your personal organization has a customer (`not_configured`); nothing changed. Also `cutover_paused`, only while the operator pauses sign-in for the auth cutover; nothing changed. Retry after `Retry-After` seconds.
Rename your company organization, change its slug, or remove its logo (owners and admins). A personal organization that holds the slug moves to a free one. An organization the sign-in provider made changes here only once the Gateway holds organizations; before that, 409 use_nexus_ui. Audited as org.settings_changed.
Null removes the logo. A new logo is uploaded with setOrgLogo (POST /v1/orgs/logo)
Responses
200OKapplication/json
idstringrequired
namestringrequired
slugstring
clerkOrgIdstring
Its sign-in provider organization's id: Nexus UI's URL segment when it has no slug
kind"company" | "personal"required
A company organization, or a person's own personal organization (one per person, one member)
role"owner" | "admin" | "member"
currentboolean
The organization this request is in
imageUrlstring
Its logo, as the tenant's imageUrl (https://img.clerk.com/…); unset when it has none.
400The request is not valid; the message names the field. A JSON body that is not an object, or a string in it that holds U+0000 (`nul_in_string`), is a 400 on every route that reads one. So is an `Idempotency-Key` that is not 1 to 255 printable ASCII characters (`invalid_idempotency_key`).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
409Another company organization has the slug (`slug_taken`), a personal organization's name and slug are its person's (`personal_org`), or the sign-in provider still holds this organization (`use_nexus_ui`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503`cutover_paused`: only while the operator pauses sign-in for the auth cutover; nothing changed. Retry after `Retry-After` seconds.application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
400
invalid_request_error
A field is missing or not valid; the message names it
400
The request is not valid; the message names the field. A JSON body that is not an object, or a string in it that holds U+0000 (`nul_in_string`), is a 400 on every route that reads one. So is an `Idempotency-Key` that is not 1 to 255 printable ASCII characters (`invalid_idempotency_key`).
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
409
Another company organization has the slug (`slug_taken`), a personal organization's name and slug are its person's (`personal_org`), or the sign-in provider still holds this organization (`use_nexus_ui`)
409
use_nexus_ui
An organization the sign-in provider made changes here only once the Gateway holds organizations; before that, 409 `use_nexus_ui`
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429
rate_limit_error
Too many requests from this key in a minute
503
`cutover_paused`: only while the operator pauses sign-in for the auth cutover; nothing changed. Retry after `Retry-After` seconds.
Upload your company organization's logo (owners and admins): the body is the image's bytes, a PNG, JPEG or WebP of 1 MB at most, typed by its first bytes. The Gateway stores it in Nexus's bucket and sets the organization's imageUrl to it. Only once the Gateway holds organizations; before that, 409 use_nexus_ui. Audited as org.settings_changed.
Its sign-in provider organization's id: Nexus UI's URL segment when it has no slug
kind"company" | "personal"required
A company organization, or a person's own personal organization (one per person, one member)
role"owner" | "admin" | "member"
currentboolean
The organization this request is in
imageUrlstring
Its logo, as the tenant's imageUrl (https://img.clerk.com/…); unset when it has none.
400The request is not valid; the message names the field. A JSON body that is not an object, or a string in it that holds U+0000 (`nul_in_string`), is a 400 on every route that reads one. So is an `Idempotency-Key` that is not 1 to 255 printable ASCII characters (`invalid_idempotency_key`).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
409A personal organization has no logo to change (`personal_org`), or the Gateway does not hold organizations yet (`use_nexus_ui`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
413The image is over 1 MB (`request_too_large`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
415The image is not a PNG, JPEG or WebP by its first bytes (`unsupported_logo_type`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
502The bucket refused the image (`logo_storage_failed`); nothing changedapplication/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503`logo_storage_unconfigured`: the Gateway has no bucket for logos (`NEXUS_ORG_LOGO_BUCKET`). `cutover_paused`: only while the operator pauses sign-in for the auth cutover; retry after `Retry-After` seconds. Nothing changed.application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
400
invalid_request_error
A field is missing or not valid; the message names it
400
The request is not valid; the message names the field. A JSON body that is not an object, or a string in it that holds U+0000 (`nul_in_string`), is a 400 on every route that reads one. So is an `Idempotency-Key` that is not 1 to 255 printable ASCII characters (`invalid_idempotency_key`).
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
409
A personal organization has no logo to change (`personal_org`), or the Gateway does not hold organizations yet (`use_nexus_ui`)
409
use_nexus_ui
Only once the Gateway holds organizations; before that, 409 `use_nexus_ui`
413
The image is over 1 MB (`request_too_large`)
415
The image is not a PNG, JPEG or WebP by its first bytes (`unsupported_logo_type`)
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429
rate_limit_error
Too many requests from this key in a minute
502
The bucket refused the image (`logo_storage_failed`); nothing changed
503
`logo_storage_unconfigured`: the Gateway has no bucket for logos (`NEXUS_ORG_LOGO_BUCKET`). `cutover_paused`: only while the operator pauses sign-in for the auth cutover; retry after `Retry-After` seconds. Nothing changed.
Items per page, 1 to 500 (default 100). Without limit or cursor the answer holds the whole list.
cursorquery · string
NextCursor from the previous page. A cursor whose item left the list answers 400 invalid_cursor.
Responses
200OKapplication/json
membersarray of Member
userIdstringrequired
emailstring
namestring
role"owner" | "admin" | "member"required
joinedAtstring (date-time)required
spentUsdnumber
callsinteger
nextCursorstring
The next page's cursor, while more items follow. Only when limit or cursor was sent.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
400
invalid_request_error
A field is missing or not valid; the message names it
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
Every member of the organization and whether they are online (seen in the last two minutes), online ones first (every role: members.read; a signed-in member only). lastSeenAt is set only while a member is online; a member who turned off showing reads offline to everyone else. You are always online to yourself. showOnline is your own setting. Each online member's activity says what they are doing, as you may see it.
Your heartbeat while Nexus UI is open and visible, about every 30 seconds (every role: members.read; a signed-in member only, 403 role_required otherwise). You count as online for two minutes after it. Gateway stores at most one every 20 seconds, and none while you turned off showing when you are online. It may carry what you are doing (activity): chatting, a page by id, or idle. A change of activity is stored at once. Answers your setting.
What Nexus UI reports with a heartbeat. Coarse on purpose: no chat title, no path, no repository. Gateway keeps a page's id only when you may open the page and reads its title itself. agents is taken as idle: Gateway counts running agents from agent sessions.
Whether others see when you are online. On by default.
400Not a known activity (`invalid_activity`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
400
invalid_request_error
A field is missing or not valid; the message names it
Choose whether you show when you are online (every role: members.read; a signed-in member only). Off, Gateway forgets your last heartbeat and stores none, so you read offline to everyone else at once; you still see yourself online.
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
400
invalid_request_error
A field is missing or not valid; the message names it
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Request body · application/json
role"admin" | "member"required
Responses
200OKapplication/json
object
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503`cutover_paused`: only while the operator pauses sign-in for the auth cutover; nothing changed. Retry after `Retry-After` seconds.application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
400
invalid_request_error
A field is missing or not valid; the message names it
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
404
not_found
Nothing matches the path in your organization
409
idempotency_in_progress
A request with the same Idempotency-Key is still running
409
idempotency_interrupted
The first request with this Idempotency-Key was cut off and may have run in part
422
idempotency_key_reused
The Idempotency-Key was used with a different request
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429
rate_limit_error
Too many requests from this key in a minute
503
`cutover_paused`: only while the operator pauses sign-in for the auth cutover; nothing changed. Retry after `Retry-After` seconds.
Remove a member (owners and admins). The membership is flagged, not deleted, so an owner or admin can recover them for 30 days; their tokens and keys are revoked at once. The owner must transfer ownership first.
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Responses
200OKapplication/json
object
404No such member (`not_found`).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
409They are the owner (`owner_role`): transfer ownership first. Or a token removes its own person (`self_removal`).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
502A token's removal: Clerk did not take them out of its organization (`clerk_unavailable`); nothing changed.application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503A token's removal: the organization signs in with the sign-in provider and this Gateway has no secret key for it (`not_configured`); nothing changed. Also `cutover_paused`, only while the operator pauses sign-in for the auth cutover; nothing changed. Retry after `Retry-After` seconds.application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
404
not_found
Nothing matches the path in your organization
404
No such member (`not_found`).
409
They are the owner (`owner_role`): transfer ownership first. Or a token removes its own person (`self_removal`).
409
idempotency_in_progress
A request with the same Idempotency-Key is still running
409
idempotency_interrupted
The first request with this Idempotency-Key was cut off and may have run in part
422
idempotency_key_reused
The Idempotency-Key was used with a different request
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429
rate_limit_error
Too many requests from this key in a minute
502
A token's removal: Clerk did not take them out of its organization (`clerk_unavailable`); nothing changed.
503
A token's removal: the organization signs in with the sign-in provider and this Gateway has no secret key for it (`not_configured`); nothing changed. Also `cutover_paused`, only while the operator pauses sign-in for the auth cutover; nothing changed. Retry after `Retry-After` seconds.
The user id who removed them; absent when the sign-in provider did.
recoverableUntilstring (date-time)required
recoverablebooleanrequired
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
Recover a removed member inside the 30-day window (owners and admins): their role, teams, default team and person spend limit come back; their tokens and keys do not. In an org that signs in with Clerk, Gateway adds them back to the Clerk organization. dryRun checks and changes nothing. A 409 removal_final after the window; 503 not_configured without CLERK_SECRET_KEY on Gateway, in an org that signs in with Clerk.
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Request body (optional) · application/json
dryRunboolean
Responses
200OKapplication/json
userIdstringrequired
emailstring
role"owner" | "admin" | "member"required
teamsarray of stringrequired
The slugs of the teams they come back to.
dryRunbooleanrequired
recoveredbooleanrequired
404No such member (`not_found`).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
409They are a member (`not_removed`), or the 30-day window ended (`removal_final`).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
502Clerk did not add them back to its organization (`clerk_unavailable`); nothing changed.application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503The organization signs in with the sign-in provider and this Gateway has no secret key for it (`not_configured`); nothing changed. Also `cutover_paused`, only while the operator pauses sign-in for the auth cutover; nothing changed. Retry after `Retry-After` seconds.application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
400
invalid_request_error
A field is missing or not valid; the message names it
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
404
not_found
Nothing matches the path in your organization
404
No such member (`not_found`).
409
They are a member (`not_removed`), or the 30-day window ended (`removal_final`).
409
idempotency_in_progress
A request with the same Idempotency-Key is still running
409
idempotency_interrupted
The first request with this Idempotency-Key was cut off and may have run in part
422
idempotency_key_reused
The Idempotency-Key was used with a different request
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429
rate_limit_error
Too many requests from this key in a minute
502
Clerk did not add them back to its organization (`clerk_unavailable`); nothing changed.
503
The organization signs in with the sign-in provider and this Gateway has no secret key for it (`not_configured`); nothing changed. Also `cutover_paused`, only while the operator pauses sign-in for the auth cutover; nothing changed. Retry after `Retry-After` seconds.
503
not_configured
A 409 removal_final after the window; 503 `not_configured` without CLERK_SECRET_KEY on Gateway, in an org that signs in with Clerk
The organization's pending invitations, oldest first, expired ones included (owners and admins). Only once Core holds organizations (NEXUS_ORG_OWNER=core); before that, 409 use_nexus_ui.
Past expiresAt: its link no longer works; resend it.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
409
use_nexus_ui
Only once Core holds organizations (`NEXUS_ORG_OWNER=core`); before that, 409 `use_nexus_ui`
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
Invite people to the organization (owners and admins); Clerk emails each invitation. Name emails, or pending: true for everyone in a team by email who has not joined. Emails already in the organization or already invited are skipped. dryRun sends nothing. Sending more than one needs expect, the number you confirmed (409 count_changed if it differs). 501 without CLERK_SECRET_KEY on Gateway (dry runs still work, checking Gateway only). Once Core holds organizations (NEXUS_ORG_OWNER=core), Core writes each invitation and emails its one-time link itself; an expired invitation of the email is sent again.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503`cutover_paused`: only while the operator pauses sign-in for the auth cutover; nothing changed. Retry after `Retry-After` seconds.application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
400
invalid_request_error
A field is missing or not valid; the message names it
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
409
count_changed
Sending more than one needs `expect`, the number you confirmed (409 `count_changed` if it differs)
409
idempotency_in_progress
A request with the same Idempotency-Key is still running
409
idempotency_interrupted
The first request with this Idempotency-Key was cut off and may have run in part
422
idempotency_key_reused
The Idempotency-Key was used with a different request
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429
rate_limit_error
Too many requests from this key in a minute
503
`cutover_paused`: only while the operator pauses sign-in for the auth cutover; nothing changed. Retry after `Retry-After` seconds.
Revoke a pending invitation (owners and admins), so its link stops working. While the sign-in provider holds organizations the id is the provider's and the provider cancels it; once Core holds them (NEXUS_ORG_OWNER=core) the id is Core's. Audited as invitation.revoked.
The invitation's id: the sign-in provider's while it holds organizations, else Core's from GET /v1/orgs/invitations.
Idempotency-Keyheader · string
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Responses
200OKapplication/json
revokedbooleanrequired
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503`cutover_paused`: only while the operator pauses sign-in for the auth cutover; nothing changed. Retry after `Retry-After` seconds.application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
404
not_found
Nothing matches the path in your organization
409
idempotency_in_progress
A request with the same Idempotency-Key is still running
409
idempotency_interrupted
The first request with this Idempotency-Key was cut off and may have run in part
422
idempotency_key_reused
The Idempotency-Key was used with a different request
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429
rate_limit_error
Too many requests from this key in a minute
503
`cutover_paused`: only while the operator pauses sign-in for the auth cutover; nothing changed. Retry after `Retry-After` seconds.
Email a pending invitation again with a new link and a new expiry, 7 days from now; the old link stops working (owners and admins). At most once per 10 minutes per invitation: 429 resend_too_soon. Only once Core holds organizations; before that, 409 use_nexus_ui. Audited as invitation.sent with via: resend.
The invitation's id, from GET /v1/orgs/invitations.
Idempotency-Keyheader · string
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Responses
200OKapplication/json
emailstringrequired
statusstringrequired
invitationIdstring | null
messagestring | null
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503`cutover_paused`: only while the operator pauses sign-in for the auth cutover; nothing changed. Retry after `Retry-After` seconds.application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
404
not_found
Nothing matches the path in your organization
409
use_nexus_ui
Only once Core holds organizations; before that, 409 `use_nexus_ui`
409
idempotency_in_progress
A request with the same Idempotency-Key is still running
409
idempotency_interrupted
The first request with this Idempotency-Key was cut off and may have run in part
422
idempotency_key_reused
The Idempotency-Key was used with a different request
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429
resend_too_soon
429 `resend_too_soon`
429
rate_limit_error
Too many requests from this key in a minute
503
`cutover_paused`: only while the operator pauses sign-in for the auth cutover; nothing changed. Retry after `Retry-After` seconds.
Your own pending invitations, across organizations, oldest first: those sent to an email one of your sign-ins verified. An unverified email matches none. Expired invitations and organizations you are already in are left out. Accept one with POST /v1/orgs/invitations/accept and its id. Only once Core holds organizations (NEXUS_ORG_OWNER=core); before that, 409 use_nexus_ui. A person only (403 person_required).
The inviter's name, else their email; null when no person invited you or that person is gone.
expiresAtstring (date-time)required
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
403
person_required
A person only (403 `person_required`)
409
use_nexus_ui
Only once Core holds organizations (`NEXUS_ORG_OWNER=core`); before that, 409 `use_nexus_ui`
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
Accept an invitation: you join its organization with its role. Name the token in its link or the id from GET /v1/orgs/invitations/mine: exactly one. A body with neither or both is 400 invalid_request. For a token, Nexus UI's server must vouch that you verified the invited email (403 email_mismatch). For an id, one of your sign-ins must have verified the invited email; any other id is a 404. A used, revoked or replaced link is a 404; an expired invitation is 409 invitation_expired. Only once Core holds organizations; before that, 409 use_nexus_ui. Audited as member.joined with via: invitation.
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Request body · application/json
object | object
Responses
200OKapplication/json
idstringrequired
namestringrequired
slugstring
clerkOrgIdstring
Its sign-in provider organization's id: Nexus UI's URL segment when it has no slug
kind"company" | "personal"required
A company organization, or a person's own personal organization (one per person, one member)
role"owner" | "admin" | "member"
currentboolean
The organization this request is in
imageUrlstring
Its logo, as the tenant's imageUrl (https://img.clerk.com/…); unset when it has none.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503`cutover_paused`: only while the operator pauses sign-in for the auth cutover; nothing changed. Retry after `Retry-After` seconds.application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
400
invalid_request_error
A field is missing or not valid; the message names it
400
invalid_request
A body with neither or both is 400 `invalid_request`
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
403
email_mismatch
For a token, Nexus UI's server must vouch that you verified the invited email (403 `email_mismatch`)
409
invitation_expired
A used, revoked or replaced link is a 404; an expired invitation is 409 `invitation_expired`
409
use_nexus_ui
Only once Core holds organizations; before that, 409 `use_nexus_ui`
409
idempotency_in_progress
A request with the same Idempotency-Key is still running
409
idempotency_interrupted
The first request with this Idempotency-Key was cut off and may have run in part
422
idempotency_key_reused
The Idempotency-Key was used with a different request
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429
rate_limit_error
Too many requests from this key in a minute
503
`cutover_paused`: only while the operator pauses sign-in for the auth cutover; nothing changed. Retry after `Retry-After` seconds.
The organization's verified email domains (owners and admins). While Clerk holds organizations (the default), they are Clerk's, from its Enhanced B2B add-on: people with a verified email on a domain join through Clerk as its enrollmentMode says; 409 not_a_clerk_org for an organization that does not sign in with Clerk; 503 not_configured without CLERK_SECRET_KEY on Gateway. Once Core holds organizations (NEXUS_ORG_OWNER=core), they are the domains a Nexus operator assigned: each one's id is the domain, its enrollmentMode is automatic_suggestion, and a person whose Google sign-in is on it sees the organization in listDomainSuggestions. 409 personal_org for a personal organization.
Invitations the sign-in provider sent on this domain that nobody accepted yet.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
409
not_a_clerk_org
People with a verified email on a domain join through Clerk as its `enrollmentMode` says; 409 `not_a_clerk_org` for an organization that does not sign in with Clerk; 503 `not_configured` without CLERK_SECRET_KEY on Gateway
409
personal_org
409 `personal_org` for a personal organization
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429
rate_limit_error
Too many requests from this key in a minute
503
not_configured
People with a verified email on a domain join through Clerk as its `enrollmentMode` says; 409 `not_a_clerk_org` for an organization that does not sign in with Clerk; 503 `not_configured` without CLERK_SECRET_KEY on Gateway
Add a verified email domain (owners and admins). While Clerk holds organizations: you must have a verified email on it in Clerk (403 domain_not_yours), so an admin cannot add another company's domain and pull its people into their organization; a public mail provider such as gmail.com is refused (400 public_mail_domain), and so is a personal organization (409 personal_org). Clerk's refusal, such as a domain another organization has, is a 409 clerk_refused with Clerk's message. Audited as domain.added. Once Core holds organizations (NEXUS_ORG_OWNER=core), a Nexus operator assigns domains after a review, so this is 409 operator_assigns_domains (400 public_mail_domain for a public mail provider's).
Automatic_invitation: the sign-in provider invites everyone with a verified email on the domain. automatic_suggestion: the provider suggests the organization and an admin accepts each request. manual_invitation: nobody joins without an invitation.
Invitations the sign-in provider sent on this domain that nobody accepted yet.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503`cutover_paused`: only while the operator pauses sign-in for the auth cutover; nothing changed. Retry after `Retry-After` seconds.application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
400
invalid_request_error
A field is missing or not valid; the message names it
400
public_mail_domain
You must have a verified email on it in Clerk (403 `domain_not_yours`), so an admin cannot add another company's domain and pull its people into their organization; a public mail provider such as gmail.com is refused (400 `public_mail_domain`), and so is a personal organization (409 `personal_org`)
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
403
domain_not_yours
You must have a verified email on it in Clerk (403 `domain_not_yours`), so an admin cannot add another company's domain and pull its people into their organization; a public mail provider such as gmail.com is refused (400 `public_mail_domain`), and so is a personal organization (409 `personal_org`)
409
personal_org
You must have a verified email on it in Clerk (403 `domain_not_yours`), so an admin cannot add another company's domain and pull its people into their organization; a public mail provider such as gmail.com is refused (400 `public_mail_domain`), and so is a personal organization (409 `personal_org`)
409
clerk_refused
Clerk's refusal, such as a domain another organization has, is a 409 `clerk_refused` with Clerk's message
409
operator_assigns_domains
Once Core holds organizations (NEXUS_ORG_OWNER=core), a Nexus operator assigns domains after a review, so this is 409 `operator_assigns_domains` (400 `public_mail_domain` for a public mail provider's)
409
idempotency_in_progress
A request with the same Idempotency-Key is still running
409
idempotency_interrupted
The first request with this Idempotency-Key was cut off and may have run in part
422
idempotency_key_reused
The Idempotency-Key was used with a different request
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429
rate_limit_error
Too many requests from this key in a minute
503
`cutover_paused`: only while the operator pauses sign-in for the auth cutover; nothing changed. Retry after `Retry-After` seconds.
Remove a verified email domain by its id from listOrgDomains (owners and admins). New people stop joining by it; who already joined stays. Another organization's domain is a 404. Audited as domain.removed.
The domain's id, from listOrgDomains: the sign-in provider's id, or the domain itself once Core holds organizations.
Idempotency-Keyheader · string
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Responses
200OKapplication/json
removedbooleanrequired
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503`cutover_paused`: only while the operator pauses sign-in for the auth cutover; nothing changed. Retry after `Retry-After` seconds.application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
404
not_found
Nothing matches the path in your organization
409
idempotency_in_progress
A request with the same Idempotency-Key is still running
409
idempotency_interrupted
The first request with this Idempotency-Key was cut off and may have run in part
422
idempotency_key_reused
The Idempotency-Key was used with a different request
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429
rate_limit_error
Too many requests from this key in a minute
503
`cutover_paused`: only while the operator pauses sign-in for the auth cutover; nothing changed. Retry after `Retry-After` seconds.
The company organizations you may join by domain, with the domain of each. A suggestion needs your own Google sign-in: its hd is a domain a Nexus operator assigned to the organization, and Google verified your email on that domain. An email-code sign-in, an unverified email or the email on your account never counts. An organization you belong to, or were removed from, is left out. Only once Core holds organizations (NEXUS_ORG_OWNER=core); before that, 409 use_nexus_ui.
The organization; no role or current, since the person is not a member yet.
idstringrequired
namestringrequired
slugstring
clerkOrgIdstring
Its sign-in provider organization's id: Nexus UI's URL segment when it has no slug
kind"company" | "personal"required
A company organization, or a person's own personal organization (one per person, one member)
role"owner" | "admin" | "member"
currentboolean
The organization this request is in
imageUrlstring
Its logo, as the tenant's imageUrl (https://img.clerk.com/…); unset when it has none.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
409
use_nexus_ui
Only once Core holds organizations (NEXUS_ORG_OWNER=core); before that, 409 `use_nexus_ui`
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
Join an organization of listDomainSuggestions: you become a member, never an admin. 404 no_domain_match when none of your Google sign-ins is on a domain of that organization; the answer does not say whether it exists. 409 member_removed while an admin's removal of you can still be undone. A member already keeps their role. Only once Core holds organizations; before that, 409 use_nexus_ui. Audited as member.joined with via: domain.
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Request body · application/json
orgstringrequired
The organization's id, from listDomainSuggestions.
Responses
200OKapplication/json
idstringrequired
namestringrequired
slugstring
clerkOrgIdstring
Its sign-in provider organization's id: Nexus UI's URL segment when it has no slug
kind"company" | "personal"required
A company organization, or a person's own personal organization (one per person, one member)
role"owner" | "admin" | "member"
currentboolean
The organization this request is in
imageUrlstring
Its logo, as the tenant's imageUrl (https://img.clerk.com/…); unset when it has none.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503`cutover_paused`: only while the operator pauses sign-in for the auth cutover; nothing changed. Retry after `Retry-After` seconds.application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
400
invalid_request_error
A field is missing or not valid; the message names it
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
404
no_domain_match
404 `no_domain_match` when none of your Google sign-ins is on a domain of that organization; the answer does not say whether it exists
409
member_removed
409 `member_removed` while an admin's removal of you can still be undone
409
use_nexus_ui
Only once Core holds organizations; before that, 409 `use_nexus_ui`
409
idempotency_in_progress
A request with the same Idempotency-Key is still running
409
idempotency_interrupted
The first request with this Idempotency-Key was cut off and may have run in part
422
idempotency_key_reused
The Idempotency-Key was used with a different request
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429
rate_limit_error
Too many requests from this key in a minute
503
`cutover_paused`: only while the operator pauses sign-in for the auth cutover; nothing changed. Retry after `Retry-After` seconds.
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Request body · application/json
userIdstringrequired
Responses
200OKapplication/json
object
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503`cutover_paused`: only while the operator pauses sign-in for the auth cutover; nothing changed. Retry after `Retry-After` seconds.application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
400
invalid_request_error
A field is missing or not valid; the message names it
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
409
idempotency_in_progress
A request with the same Idempotency-Key is still running
409
idempotency_interrupted
The first request with this Idempotency-Key was cut off and may have run in part
422
idempotency_key_reused
The Idempotency-Key was used with a different request
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429
rate_limit_error
Too many requests from this key in a minute
503
`cutover_paused`: only while the operator pauses sign-in for the auth cutover; nothing changed. Retry after `Retry-After` seconds.
Set the organization's budget in USD, a cap per UTC day, ISO week or calendar month (owners and admins); never below what the period spent and what is reserved.
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Request body · application/json
budgetUsdnumber | string
The organization's budget per period in US dollars: a JSON number (deprecated) or a decimal string with at most 6 decimals ("12.245"), read exactly. Send budgetUsdDecimal instead to send only a string.
budgetUsdDecimalstring
The organization's budget per period as a decimal string in US dollars, at most 6 decimals, never below 0; read exactly into micro-dollars, never through a float. With budgetUsd too, both must name the same amount (400 amount_mismatch).
pattern ^[0-9]+(\.[0-9]{1,6})?$
period"day" | "week" | "month"
The cap's period. Absent keeps the current one, a month unless set
dryRunboolean
Make the same checks and write nothing; the answer is { dryRun, before, after }, each { budgetUsd, budgetUsdDecimal, period }
Responses
200OKapplication/json
object | object
400`budgetUsd` and `budgetUsdDecimal` both missing, `dryRun` not true or false (`invalid_request`), a decimal string with more than 6 decimals (`too_many_decimals`), an amount that is not one or is below 0 (`invalid_amount`), or a number and its `Decimal` twin that name different amounts (`amount_mismatch`), or a period other than day, week or month (`invalid_period`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
403Only owners and admins set the organization's budget (`role_required`): a member without `budgets.manage`application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
409The new budget is below what the period has already spent and reserved (`conflict`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
400
invalid_request_error
A field is missing or not valid; the message names it
400
`budgetUsd` and `budgetUsdDecimal` both missing, `dryRun` not true or false (`invalid_request`), a decimal string with more than 6 decimals (`too_many_decimals`), an amount that is not one or is below 0 (`invalid_amount`), or a number and its `Decimal` twin that name different amounts (`amount_mismatch`), or a period other than day, week or month (`invalid_period`)
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
409
The new budget is below what the period has already spent and reserved (`conflict`)
409
idempotency_in_progress
A request with the same Idempotency-Key is still running
409
idempotency_interrupted
The first request with this Idempotency-Key was cut off and may have run in part
422
idempotency_key_reused
The Idempotency-Key was used with a different request
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
Every person and team of the organization with its name: the one file that maps ids to names, as CSV (owners and admins). The people are its members and the people its calls and kept agent sessions name (former members too), then its teams and the teams those name, each by id. Names are read when the file is asked for. An erased person reads erased: true with no name; a person with no record reads with no name, and a deleted team with its id alone. It takes no parameter and has no row limit, range or cursor. The data files name people and teams by id only. Each request is an audit event (observability.directory_exported) with the file's manifest, never its rows, and counts toward the 60 exports an hour.
200CSV with a header row: one column per field of `DirectoryEntry`, in its order.text/csv
string
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
Every person and team of the organization with its name: the one file that maps ids to names, as JSON Lines (owners and admins). The people are its members and the people its calls and kept agent sessions name (former members too), then its teams and the teams those name, each by id. Names are read when the file is asked for. An erased person reads erased: true with no name; a person with no record reads with no name, and a deleted team with its id alone. It takes no parameter and has no row limit, range or cursor. The data files name people and teams by id only. Each request is an audit event (observability.directory_exported) with the file's manifest, never its rows, and counts toward the 60 exports an hour.
200JSON Lines: one `DirectoryEntry` per line, then one line `{"manifest": ExportManifest}`.application/jsonl
string
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
Clerk's webhook, signed by Svix with CLERK_WEBHOOK_SECRET (svix-id, svix-timestamp and svix-signature; refused more than five minutes from now). For organizationMembership.created, .updated and .deleted, and user.deleted, Gateway reads the membership or the person from Clerk again and makes its copy match: a member Clerk no longer has loses their membership, teams and tokens (member.removed, via: clerk; the owner loses only the tokens), and a role Clerk changed is mirrored. For organization.updated, Gateway reads the organization from Clerk again and mirrors its name, slug and logo as a sign-in does (org.settings_changed, actor clerk; a logo not on img.clerk.com is dropped); an organization Gateway does not have is ignored. A repeated or late event changes nothing. 401 for a bad signature; 503 not_configured without CLERK_WEBHOOK_SECRET or CLERK_SECRET_KEY; 502 when Clerk does not answer, so Svix retries.
The organization's billing (owner only): the Stripe mode of this Gateway, whether the organization has a Stripe customer yet, its payment method on file (defaultPaymentMethod, of any type; paymentMethod only when it is a card), how it pays for what Nexus runs (pricing v2.0: freeStart, credits and autoTopup, afterTheFact; plan where this Gateway sells plans), the numbers a page shows (pricing), and pastDue. pastDue is null, or names the oldest month Stripe could not collect: when it first failed (since), its period, and when model calls stop (blockedFrom, since plus NEXUS_BILLING_GRACE_DAYS, 7 days by default). From blockedFrom until an owner pays, every model call is refused with 402 payment_past_due. Never Stripe's customer id or the card number. A customer made in the other mode (test or live) is not shown. 503 not_configured until STRIPE_SECRET_KEY and STRIPE_WEBHOOK_SECRET are both set and well formed (the message says which is wrong).
True when this Gateway supports delegated Stripe shared payment tokens on credit purchases. Currently enabled only in Stripe test mode; live mode returns false. Check before submitting a token.
mode"test" | "live"required
The mode of Gateway's Stripe key.
customerobject | nullrequired
Null until the first card setup starts.
state"creating" | "ready"required
creating: Gateway started the Stripe customer and the first setup has not finished. ready: the customer exists.
paymentMethodCardSummary | nullrequired
The payment method on file when it is a card. Null when there is none, or when it is not a card: read defaultPaymentMethod for any type.
The payment method on file, of any type: the one credits, auto top-ups and charges for usage after the fact are charged to. Null until one is saved.
creditsNexusCredits | null
The organization's prepaid Nexus credits; null before it buys any.
autoTopupAutoTopup | null
The organization's auto top-up of Nexus credits; null before an owner sets it.
planAllowanceobject
The current plan's monthly allowances. Absent when no allowance is available.
resetAtstring (date-time)required
Start of the next usage month in UTC.
aiobject | nullrequired
AI allowance in decimal USD, counting settled usage. Null until the allowance is granted.
includedUsdstringrequired
usedUsdstringrequired
leftUsdstringrequired
cloudobject | nullrequired
Cloud allowance in default-size hours. Null when plan cloud metering is unavailable.
includedHoursnumberrequired
usedHoursnumberrequired
leftHoursnumberrequired
pastDueobject | nullrequired
Null while no month of this mode is unpaid after Stripe tried to collect it. Otherwise the oldest such month.
sincestring (date-time)required
When the month first failed.
periodstringrequired
The unpaid month, YYYY-MM.
pattern ^[0-9]{4}-(0[1-9]|1[0-2])$
blockedFromstring (date-time) | nullrequired
since plus the grace (NEXUS_BILLING_GRACE_DAYS). From then on model calls are refused with 402 payment_past_due. Null when this Gateway has no gate, so nothing is refused.
invoiceUrlstring (uri) | nullrequired
Stripe's page that pays the unpaid month (its hosted invoice). Null when Stripe gave none.
pricingChangeobject | null
A change to Nexus pricing and the Customer Terms (NEXUS_PRICING_CHANGE), until 30 days past the day it takes effect. Each organization created before that day is told once by billing.pricing_change. Null, or absent from an older Gateway, when there is none.
effectiveOnstring (date)required
The day the change takes effect, at 00:00 UTC: YYYY-MM-DD.
planBillingPlan | null
The organization's plan; null on the Free plan
freeStartobject | null
The organization's free start (pricing v2.0): what Nexus gave it once, and what is left. Null when it got none.
grantedUsdstringrequired
What Nexus gave, a decimal dollar string.
remainingUsdstringrequired
What is left, never below zero.
expiresAtstring (date-time) | null
When the free start expires, or expired: 30 days after its grant. Null when the organization's subsidy holds no free start.
expiredUsdstring | null
What was left of the free start when it expired, a decimal dollar string. Null before it expires.
afterTheFactAfterTheFact | null
How the organization pays after the fact (pricing v2.0); null before an owner turns it on.
pricingobjectrequired
The numbers a billing page shows, so no client writes a price of its own. Decimal dollar strings.
markupBpsintegerrequired
Nexus's rate on AI it runs past the free start and a plan's allowance, in basis points: 500 is provider price + 5%. App hosting and cloud machines have their own prices.
minPurchaseUsdstringrequired
The least one credit purchase buys.
thresholdUsdstringrequired
Paying after the fact, the card is charged each time the unpaid usage reaches this.
defaultLimitUsdstringrequired
The monthly usage limit a new after-the-fact setting starts at.
maxLimitUsdstringrequired
The most a usage limit may be now for this organization: $100 in its first week, then $100,000. A higher limitUsd answers 400 invalid_amount.
freeStartMaxOutputUsdstring
The free start pays only for a model whose cheapest host charges at most this per million output tokens.
minFinalChargeUsdstring
Minimum final charge when pay after the fact turns off.
promotionalCreditUsdstring
Available referral and promotional credit, excluding the welcome free start.
403Not the owner (`permission_error`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503Stripe is not configured (`not_configured`): the message says which variable is wrongapplication/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
401
authentication_error
No key, or a key Gateway does not accept
402
payment_past_due
From `blockedFrom` until an owner pays, every model call is refused with 402 `payment_past_due`
403
role_required
Your role does not have this permission
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429
rate_limit_error
Too many requests from this key in a minute
503
Stripe is not configured (`not_configured`): the message says which variable is wrong
503
not_configured
503 `not_configured` until STRIPE_SECRET_KEY and STRIPE_WEBHOOK_SECRET are both set and well formed (the message says which is wrong)
The organization's bill for one UTC month (owner only). A month the close stored answers from the stored row, as it closed, and invoice shows its Stripe invoice. Any other month is priced now, from the ledger and the prices Gateway has: NEXUS_PRICE_GATEWAY_CALL_MICROS and NEXUS_PRICE_GATEWAY_COST_BPS. Both are 0 until a price is set, so the total reads 0. It counts the calls on the organization's own provider keys. Refused calls and calls a Nexus subsidy paid are left out. Money is a decimal string. The bill is the total in whole cents, rounded down, as a string. carriedInUsd is the rest of the newest stored month before this one. carriedOutUsd is the part below one cent, and it carries into the next month. A month under 50 cents is not invoiced: all of its total carries. providerCostUsd is what the providers charged. They bill it, not Nexus. The stored months are the ones of Gateway's Stripe key mode. Without Stripe nothing is stored, so every month is priced now. The route reads no Stripe, so it answers with Stripe off. 400 for a period that is not YYYY-MM or has not started.
gateway.calls: the calls on the organization's own keys. gateway.provider_cost: Nexus's fee on what the providers charged for them. gateway.nexus_usage: a contract's calls on Nexus-supplied keys, at provider price plus Nexus's rate; only on a month that has some.
unit"call" | "usd"required
quantitystringrequired
Unit call: a whole number of calls. Unit usd: a decimal dollar amount.
rateUsdstring
Unit call only: the price of one call.
pattern ^[0-9]+\.[0-9]{6}$
rateBpsinteger
Unit usd only: basis points of quantity (100 is 1%).
min 0 · max 10000
amountUsdstringrequired
quantity times the rate, rounded down to a micro-dollar.
pattern ^[0-9]+\.[0-9]{6}$
providerCostUsdstringrequired
What the providers charged for the calls on the organization's own keys. The providers bill it, not Nexus.
pattern ^[0-9]+\.[0-9]{6}$
carriedInUsdstringrequired
The rest of the month before: the part of its total that no invoice took.
pattern ^[0-9]+\.[0-9]{6}$
totalUsdstringrequired
The lines and carriedInUsd added.
pattern ^[0-9]+\.[0-9]{6}$
amountCentsstringrequired
What to charge: totalUsd in whole cents, rounded down. A whole number as a string. A month under 50 cents is not invoiced.
pattern ^[0-9]+$
carriedOutUsdstringrequired
What moves to the next month: the part of totalUsd below one cent. A month under 50 cents is not invoiced, so all of its total moves.
pattern ^[0-9]+\.[0-9]{6}$
invoiceBillingInvoice | nullrequired
The Stripe invoice of a stored month. Null for a month that is priced now, and for a stored month under 50 cents, which is not invoiced.
400Not a month as YYYY-MM, or a month that has not started (`invalid_request_error`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
403Not the owner (`permission_error`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
400
invalid_request_error
A field is missing or not valid; the message names it
400
Not a month as YYYY-MM, or a month that has not started (`invalid_request_error`)
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
The months the close stored for the organization (owner only), in the mode of Gateway's Stripe key, newest first, at most 24. Each month shows its total, its whole cents, its state and its Stripe invoice page. A closed month is under 50 cents: nothing was invoiced and its total carries into the next month. Money is a decimal string. The route reads no Stripe. 503 not_configured until STRIPE_SECRET_KEY and STRIPE_WEBHOOK_SECRET are both set and well formed (the message says which is wrong).
closed: under 50 cents, so nothing was invoiced and the total carries into the next month. The other states are the ones of the invoice.
hostedInvoiceUrlstring | nullrequired
Stripe's page for the invoice. Null for a closed month, and until Stripe has finalized the invoice.
403Not the owner (`permission_error`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503Stripe is not configured (`not_configured`): the message says which variable is wrongapplication/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429
rate_limit_error
Too many requests from this key in a minute
503
Stripe is not configured (`not_configured`): the message says which variable is wrong
503
not_configured
503 `not_configured` until STRIPE_SECRET_KEY and STRIPE_WEBHOOK_SECRET are both set and well formed (the message says which is wrong)
Start saving a card for the organization (owner only): a link to a card page hosted by Stripe Checkout. Open url in a browser before expiresAt. Stripe sends the person back to the organization's billing page in Nexus UI (<NEXUS_UI_URL>/<org>/billing?checkout=done or =cancelled). Gateway makes the organization's Stripe customer on the first call and reuses it after; each call makes a new link. Takes no body, or {"embedded": true}: the same card setup as a form Nexus UI shows inside its billing page. With STRIPE_PUBLISHABLE_KEY on Gateway, that answer is EmbeddedCardSetup (Stripe.js's clientSecret and the publishableKey, no url), and Stripe sends the page to ?checkout=done once the card is saved; without it, the hosted link as without the body. 400 when embedded is not a boolean. Audited as billing.customer_created when the customer is made, and as billing.customer_deleted when Stripe no longer has it; neither event names Stripe's customer id. 502 stripe_error when Stripe refuses or does not answer (the message names Stripe's type and code). 503 not_configured until Stripe is set up, or without NEXUS_UI_URL on Gateway; 503 billing_setup_in_progress while a first call for the organization is still running (try again in a moment).
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Request body (optional) · application/json
embeddedboolean
Ask for the card form inside Nexus UI's billing page instead of Stripe's own page. Gateway answers the hosted link when it has no publishable key.
Responses
200OKapplication/json
PaymentMethodSetup | EmbeddedCardSetup
400`embedded` is not a boolean (`invalid_request`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
403Not the owner (`permission_error`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
502Stripe refused the call or did not answer (`stripe_error`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503Stripe is not configured, NEXUS_UI_URL is not set (`not_configured`), or a first call for this organization is still running (`billing_setup_in_progress`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
400
invalid_request_error
A field is missing or not valid; the message names it
400
`embedded` is not a boolean (`invalid_request`)
400
embedded
400 when `embedded` is not a boolean
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
409
idempotency_in_progress
A request with the same Idempotency-Key is still running
409
idempotency_interrupted
The first request with this Idempotency-Key was cut off and may have run in part
422
idempotency_key_reused
The Idempotency-Key was used with a different request
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429
rate_limit_error
Too many requests from this key in a minute
502
Stripe refused the call or did not answer (`stripe_error`)
502
stripe_error
502 `stripe_error` when Stripe refuses or does not answer (the message names Stripe's type and code)
503
Stripe is not configured, NEXUS_UI_URL is not set (`not_configured`), or a first call for this organization is still running (`billing_setup_in_progress`)
503
not_configured
503 `not_configured` until Stripe is set up, or without NEXUS_UI_URL on Gateway; 503 `billing_setup_in_progress` while a first call for the organization is still running (try again in a moment)
503
billing_setup_in_progress
503 `not_configured` until Stripe is set up, or without NEXUS_UI_URL on Gateway; 503 `billing_setup_in_progress` while a first call for the organization is still running (try again in a moment)
Confirm a payment the bank wants the cardholder to confirm (3-D Secure), owner only. Off session, Stripe refuses such a charge with authentication_required and keeps its PaymentIntent; this confirms that same usage charge after the fact again on session; one the bank's page never finished is cancelled at Stripe an hour later. An auto top-up that turned off for the bank's check is fixed by saving the card again (startPaymentMethodSetup). statusredirect: open url, the bank's page, which sends the person back to the organization's billing page in Nexus UI (<NEXUS_UI_URL>/<org>/billing?confirmed=1). succeeded or processing: Stripe took it, or a bank debit is on its way. Stripe's notice records the payment as for any charge; nothing is charged twice. Takes no body. 409 nothing_to_confirm when no charge waits for the bank's check (save the card again with startPaymentMethodSetup), charge_running while a usage charge is being taken. 402 when the card is declined on session.
redirect: open url. succeeded: Stripe took the payment. processing: a bank debit is on its way.
urlstring (uri) | nullrequired
The bank's page while it waits for the cardholder; null otherwise
402The card was declined on session (`stripe_error`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
403Not the owner (`permission_error`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
409No charge waits for the bank's check (`nothing_to_confirm`), or a usage charge is being taken now (`charge_running`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
502Stripe refused the call or did not answer (`stripe_error`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503Stripe is not configured, or NEXUS_UI_URL is not set (`not_configured`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
401
authentication_error
No key, or a key Gateway does not accept
402
budget_exceeded
The card was declined on session (`stripe_error`)
403
role_required
Your role does not have this permission
409
No charge waits for the bank's check (`nothing_to_confirm`), or a usage charge is being taken now (`charge_running`)
409
nothing_to_confirm
409 `nothing_to_confirm` when no charge waits for the bank's check (save the card again with startPaymentMethodSetup), `charge_running` while a usage charge is being taken
409
idempotency_in_progress
A request with the same Idempotency-Key is still running
409
idempotency_interrupted
The first request with this Idempotency-Key was cut off and may have run in part
422
idempotency_key_reused
The Idempotency-Key was used with a different request
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429
rate_limit_error
Too many requests from this key in a minute
502
Stripe refused the call or did not answer (`stripe_error`)
503
Stripe is not configured, or NEXUS_UI_URL is not set (`not_configured`)
Open the organization's Stripe customer portal (owner only): a link to a page hosted by Stripe where the owner manages payment methods, sees and pays invoices, sets tax ids and cancels at period end. Plans and seats change through Gateway, not the portal. Open url in a browser at once: Stripe's link expires within minutes. Stripe sends the person back to the organization's billing page in Nexus UI (<NEXUS_UI_URL>/<org>/billing). Gateway makes the organization's Stripe customer on the first call and reuses it after; each call makes a new link. Takes no body. The Stripe account needs a default portal configuration. 502 stripe_error when Stripe refuses or does not answer (the message names Stripe's type and code). 503 not_configured until Stripe is set up, or without NEXUS_UI_URL on Gateway; 503 billing_setup_in_progress while a first call for the organization is still running (try again in a moment).
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Responses
200OKapplication/json
urlstringrequired
Stripe's customer portal for the organization. Open it at once: it expires within minutes.
403Not the owner (`permission_error`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
502Stripe refused the call or did not answer (`stripe_error`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503Stripe is not configured, NEXUS_UI_URL is not set (`not_configured`), or a first call for this organization is still running (`billing_setup_in_progress`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
409
idempotency_in_progress
A request with the same Idempotency-Key is still running
409
idempotency_interrupted
The first request with this Idempotency-Key was cut off and may have run in part
422
idempotency_key_reused
The Idempotency-Key was used with a different request
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429
rate_limit_error
Too many requests from this key in a minute
502
Stripe refused the call or did not answer (`stripe_error`)
502
stripe_error
502 `stripe_error` when Stripe refuses or does not answer (the message names Stripe's type and code)
503
Stripe is not configured, NEXUS_UI_URL is not set (`not_configured`), or a first call for this organization is still running (`billing_setup_in_progress`)
503
not_configured
503 `not_configured` until Stripe is set up, or without NEXUS_UI_URL on Gateway; 503 `billing_setup_in_progress` while a first call for the organization is still running (try again in a moment)
503
billing_setup_in_progress
503 `not_configured` until Stripe is set up, or without NEXUS_UI_URL on Gateway; 503 `billing_setup_in_progress` while a first call for the organization is still running (try again in a moment)
Buy Nexus credits (owner only): the organization's own money, prepaid at face value and never expiring, spent by Nexus features after the free start and a plan's included usage at provider price plus Nexus's rate. Body: amountUsd, a decimal string in whole cents, from "10.00" to "10000.00"; a new organization buys at most $100 in its first 7 days, counting the purchases still being paid, such as an open Checkout page until it expires (400 purchase_limit). With a payment method on file, Gateway charges it off session: status: credited with the credits after, or processing for a bank debit still on its way (Stripe's notice credits it). Without one, or when the bank wants the person (3-D Secure) or the card declines, status: checkout with a Stripe Checkout url to open before expiresAt; Stripe sends the person back to <NEXUS_UI_URL>/<org>/billing?checkout=credits. A payment credits once, from Stripe's payment_intent.succeeded, and only to the organization whose Stripe customer paid. The Idempotency-Key header keys the Stripe call, so a retry never charges twice. Audited as credit.purchased. 400 invalid_amount; 502 stripe_error; 503 not_configured until Stripe is set up, or without NEXUS_UI_URL for a hosted purchase. With paymentToken, charge the agent wallet shared payment token directly in Stripe test mode. Live mode returns 503 payment_tokens_not_supported before contacting Stripe. There is no hosted fallback. 400 invalid_payment_token rejects a malformed credential, or one Stripe has deactivated (used, revoked or expired); 402 payment_authentication_required requires the cardholder. The same Idempotency-Key and body replay the first result.
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Request body · application/json
paymentTokenstring
Optional Stripe shared payment token from an agent wallet, scoped to Nexus, USD, the purchase amount and an expiry. Currently accepted only in Stripe test mode. Confirms without a saved card, NEXUS_UI_URL or Checkout. Never accepts card details or merchant API keys. Does not save a card or enable recurring charges.
max length 255 · pattern ^spt_[A-Za-z0-9_]+$
amountUsdstringrequired
Dollars in whole cents, such as "50.00": from 10.00 to 10000.00.
credited: charged and credited now; processing: Stripe is still taking a bank debit, and its notice credits it; checkout: open url to pay.
amountUsdstringrequired
What the purchase buys, in decimal dollars.
creditsNexusCredits
The organization's prepaid Nexus credits, its own money, never expiring. A Nexus feature's call spends them after the free start, at its provider cost plus markupBps. Decimal dollar strings.
purchasedUsdstringrequired
Bought, over all time.
spentUsdstringrequired
What settled calls cost the credits: each call's provider cost plus markupBps.
reservedUsdstringrequired
Held by calls in progress.
remainingUsdstringrequired
Bought, less spent, held and reversed. Below zero after a refund or a lost dispute took back credit that was already spent: then Nexus pays for no call (the free start, credits or the card after the fact) until a purchase pays it back.
reversedUsdstring
What refunds, lost disputes and operators took back, and what an open dispute holds of its purchase until it closes. A refund that fails gives its credit back. Only while something is taken back.
markupBpsintegerrequired
Nexus's rate on AI in basis points (500 is 5%).
paymentIdstring
Stripe's PaymentIntent, while processing.
urlstring
Stripe Checkout's page, for checkout.
expiresAtstring (date-time)
When Stripe stops accepting url.
checkoutSessionIdstring
Exact Checkout session to confirm; returned by current Gateways.
400An amount outside $25 to $10,000 or not in whole cents (`invalid_amount`), or past a new organization's limit (`purchase_limit`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
402The delegated payment requires cardholder authentication or was not completed (payment_authentication_required, payment_declined, payment_failed).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
403Only the owner buys credits (`role_required`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
502Stripe refused the call or did not answer (`stripe_error`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503Delegated payment tokens are disabled in live mode (`payment_tokens_not_supported`), Stripe is not configured, NEXUS_UI_URL is not set for a hosted purchase (`not_configured`), or a first call for this organization is still running (`billing_setup_in_progress`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
400
invalid_request_error
A field is missing or not valid; the message names it
400
An amount outside $25 to $10,000 or not in whole cents (`invalid_amount`), or past a new organization's limit (`purchase_limit`)
400
purchase_limit
`amountUsd`, a decimal string in whole cents, from "10.00" to "10000.00"; a new organization buys at most $100 in its first 7 days, counting the purchases still being paid, such as an open Checkout page until it expires (400 `purchase_limit`)
400
invalid_amount
400 `invalid_amount`; 502 `stripe_error`; 503 `not_configured` until Stripe is set up, or without NEXUS_UI_URL for a hosted purchase
401
authentication_error
No key, or a key Gateway does not accept
402
budget_exceeded
The delegated payment requires cardholder authentication or was not completed (payment_authentication_required, payment_declined, payment_failed).
403
role_required
Your role does not have this permission
409
idempotency_in_progress
A request with the same Idempotency-Key is still running
409
idempotency_interrupted
The first request with this Idempotency-Key was cut off and may have run in part
422
idempotency_key_reused
The Idempotency-Key was used with a different request
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429
rate_limit_error
Too many requests from this key in a minute
502
Stripe refused the call or did not answer (`stripe_error`)
502
stripe_error
400 `invalid_amount`; 502 `stripe_error`; 503 `not_configured` until Stripe is set up, or without NEXUS_UI_URL for a hosted purchase
503
Delegated payment tokens are disabled in live mode (`payment_tokens_not_supported`), Stripe is not configured, NEXUS_UI_URL is not set for a hosted purchase (`not_configured`), or a first call for this organization is still running (`billing_setup_in_progress`)
503
not_configured
400 `invalid_amount`; 502 `stripe_error`; 503 `not_configured` until Stripe is set up, or without NEXUS_UI_URL for a hosted purchase
Turn the organization's auto top-up of Nexus credits on or off (owner only). Body: enabled, and belowUsd and addUsd as decimal strings in whole cents (or the ones set before). On needs the payment method on file (409 no_payment_method), and not a card whose payment was disputed (409 card_disputed). A closed organization cannot turn it on (409 organization_closed). When the credits left fall below belowUsd, Gateway's Stripe sweep (NEXUS_STRIPE_SWEEP_MS) charges that payment method addUsd off session and credits it, one top-up at a time, at most 3 top-ups or $500 a UTC day. A decline, a bank that wants the person, no payment method, a bank debit that fails later (payment_intent.payment_failed), a dispute, or a refund that takes the credits below zero turns it off, and offReason says why. Off keeps the amounts; turning off what was never set answers autoTopup: null. Audited as credit.auto_topup_changed. 400 invalid_amount; 503 not_configured until Stripe is set up.
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Request body · application/json
enabledbooleanrequired
belowUsdstring
Dollars in whole cents, above 0.00 and at most 10000.00. Needed to turn on the first time.
addUsdstring
Dollars in whole cents, from 10.00 to 500.00. Needed to turn on the first time.
Responses
200OKapplication/json
autoTopupAutoTopup | nullrequired
The setting after; null after turning off what was never set.
400`belowUsd` not above $0 or above $10,000, or `addUsd` outside $25 to $500 or not in whole cents (`invalid_amount`); `enabled` missing; or turning on without both amountsapplication/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
403Not the owner (`permission_error`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
409Turning on with no payment method on file (`no_payment_method`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503Stripe is not configured (`not_configured`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
400
invalid_request_error
A field is missing or not valid; the message names it
400
`belowUsd` not above $0 or above $10,000, or `addUsd` outside $25 to $500 or not in whole cents (`invalid_amount`); `enabled` missing; or turning on without both amounts
400
invalid_amount
400 `invalid_amount`; 503 `not_configured` until Stripe is set up
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
409
Turning on with no payment method on file (`no_payment_method`)
409
no_payment_method
On needs the payment method on file (409 `no_payment_method`), and not a card whose payment was disputed (409 `card_disputed`)
409
card_disputed
On needs the payment method on file (409 `no_payment_method`), and not a card whose payment was disputed (409 `card_disputed`)
409
organization_closed
A closed organization cannot turn it on (409 `organization_closed`)
409
idempotency_in_progress
A request with the same Idempotency-Key is still running
409
idempotency_interrupted
The first request with this Idempotency-Key was cut off and may have run in part
422
idempotency_key_reused
The Idempotency-Key was used with a different request
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429
rate_limit_error
Too many requests from this key in a minute
503
Stripe is not configured (`not_configured`)
503
not_configured
400 `invalid_amount`; 503 `not_configured` until Stripe is set up
hiddenMobilePlacesarray of "assistant" | "artifacts" | "customize"
Places hidden from members in the mobile drawer. The owner still sees them.
chatRetentionDaysintegerrequired
Days chat messages are kept (90 by default)
min 1 · max 3650
agentSubscriptionsboolean
Whether nexus claude --subscription may run (true by default)
growthEventsboolean
Whether the Gateway records the organization's growth events in its own store (true by default)
chatSuggestionsboolean
Whether chat sessions suggest the person's next message after an answer, a call the organization pays for (true by default)
defaultsobjectrequired
hiddenMobilePlacesarray of "assistant" | "artifacts" | "customize"
default []
chatRetentionDaysinteger
growthEventsboolean
chatSuggestionsboolean
artifacts.external"off" | "named" | "public"
artifacts.external.codeboolean
artifacts.external.domainsobject
allowarray of stringrequired
denyarray of stringrequired
artifacts.external.expiryobject
maxDaysinteger | nullrequired
min 1 · max 3650
requiredbooleanrequired
artifacts.external.continueboolean
artifacts.external.who"everyone" | "admins"
agentSubscriptionsboolean
artifacts.pagesboolean
artifacts.pages.publicboolean
artifacts.pages.queriesboolean
webSearch.engine"off" | "borrowed"
webSearch.modelstring | null
webSearch.domainsobject
allowarray of stringrequired
denyarray of stringrequired
webSearch.maxPerTurninteger
webSearch.requireZdrboolean
sessionContent"never" | "user" | "user_and_org"
multiplayerSessionsboolean
cloudHistoryboolean
webSessionViewerboolean
updatedAtstring (date-time)
artifacts.external"off" | "named" | "public"
Sharing artifacts outside the organization: off, named people only, or also public links (default public)
artifacts.external.codeboolean
May external snapshots include Ask your code's sources (default false)
artifacts.external.domainsobject
Email domains named outsiders may (allow, when set) or may not (deny) have; a domain matches itself and its subdomains (default both empty)
allowarray of stringrequired
denyarray of stringrequired
artifacts.external.expiryobject
The longest a public link may stay open, and whether every public link must expire (default none and false)
maxDaysinteger | nullrequired
min 1 · max 3650
requiredbooleanrequired
artifacts.external.continueboolean
May people outside continue the chat in an organization of their own, at its expense (default true)
artifacts.external.who"everyone" | "admins"
Who may share outside: everyone, or owners and admins (default everyone)
artifacts.pagesboolean
Pages: off refuses new pages, versions, shares and every page frame (default true)
artifacts.pages.publicboolean
Public links to pages: off refuses new ones and stops existing ones from opening (default false in a company organization, true in a personal one)
artifacts.pages.queriesboolean
Page queries (Nexus Data): on lets a page's owner approve read-only queries on a connection, whose results the page's readers see; off refuses saving and running them (default false)
webSearch.engine"off" | "borrowed"
Gates hosted web search in chat and in Code (nexus claude --api, nexus codex --api): off or borrowed (default borrowed; off means no web search runs)
webSearch.modelstring | null
The model that runs a chat's search: null for the default (the chat's own model, the cheapest on nexus/auto), cheapest, or a model's catalog id. A pinned model the person may not use, or nobody pays for, gives that person no search, and so does an id this Gateway cannot call, which is shown as stored. Chat only
webSearch.domainsobject
Domains a search result may (allow, when set) or may not (deny) come from (default both empty). While any is set, no web search runs, in chat or in Code, until the engine applies them
allowarray of stringrequired
denyarray of stringrequired
webSearch.maxPerTurninteger
Most searches in one chat turn (default 3). Applies to Gateway-run engines (chat) only
min 1 · max 10
webSearch.requireZdrboolean
Whether only engines with zero data retention may run (default false). While set, no web search runs, in chat or in Code, until the engine applies it
sessionContent"never" | "user" | "user_and_org"
The content policy for synced sessions that runners follow, readable by every member. The default is user in every organization; only a saved user_and_org applies, and it reads as user while the organization has no recovery key (getOrgRecoveryKey)
multiplayerSessionsboolean
Whether members read each other's team-visible synced sessions, still end-to-end encrypted. False by default; always false in a personal one
cloudHistoryboolean
Whether Gateway stores the organization's cloud session history, so a sleeping cloud session reads on any device. True by default. Off, Gateway stores none. Omitted for an organization that cannot run cloud machines and stores no cloud history
webSessionViewerboolean
Whether Nexus UI in a browser opens the organization's synced sessions. True by default. Off, Nexus UI's credential (its session token or its server's secret) gets 403 web_session_viewer_off for sealed events, key copies and a new device
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
Change the organization's settings (owners and admins). chatRetentionDays: 1 to 3650, or null for the default; a shorter window deletes expired messages at once. Audited as org.settings_changed.
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Request body · application/json
hiddenMobilePlacesarray of "assistant" | "artifacts" | "customize" | null
Places an owner hides from members in the mobile drawer. Only an owner can change this setting. Null makes all places visible.
chatRetentionDaysinteger | null
min 1 · max 3650
agentSubscriptionsboolean | null
Whether nexus claude --subscription may run (people's own Claude logins, outside Gateway's checks); null for the default, true
growthEventsboolean | null
Whether the Gateway records the organization's growth events in its own store; null for the default, true. No safety control depends on it
chatSuggestionsboolean | null
Whether chat sessions suggest the person's next message after an answer, a call the organization pays for; null for the default, true
webSearch.engine"off" | "borrowed" | null
Gates hosted web search in chat and in Code (nexus claude --api, nexus codex --api): off or borrowed; null for the default, borrowed. An unknown engine is a 400 that names the allowed values
webSearch.modelstring | null
The model that runs a chat's search, whatever the chat's model is: cheapest, or the catalog id of a model that can search (GET /v1/models lists it with web_search_usd); null or default for the default, the chat's own model (the cheapest on nexus/auto). It is stored as the model's catalog id. Chat only: in Code an agent searches on its own model. Anything else is a 400 that lists the models
webSearch.domainsobject | null
Domains a search result may (allow, when set) or may not (deny) come from; null for the default, both empty. While any is set, no web search runs, in chat or in Code, until the engine applies them
allowarray of string
denyarray of string
webSearch.maxPerTurninteger | null
Most searches in one chat turn; null for the default, 3. Applies to Gateway-run engines (chat) only
min 1 · max 10
webSearch.requireZdrboolean | null
Whether only engines with zero data retention may run; null for the default, false. While set, no web search runs, in chat or in Code, until the engine applies it
Sharing an artifact outside the organization: off, named (named people by verified email) or public (also anyone with an unguessable link); null for the default, public. Another value is a 400
artifacts.external.codeboolean | null
Whether an artifact shared outside the organization may include Ask your code's sources; null for the default, false
artifacts.external.domainsobject | null
Email domains a named share outside the organization may (allow, when set) or may not (deny) go to; null for the default, both empty
allowarray of string
denyarray of string
artifacts.external.expiryobject | null
Limits on how long a public link stays open: maxDays (1-3650, or null for no limit) and whether an expiry is required; null for the default, no limit and not required
maxDaysinteger | null
min 1 · max 3650
requiredboolean
artifacts.external.continueboolean | null
Whether people outside the organization may continue or remix what it shares; null for the default, true
What leaves a person's machine when coding sessions sync, end-to-end encrypted: never (only usage numbers), user (only the person's own devices can read it) or user_and_org (also the organization's recovery key); null for the default. Needs synced_sessions.manage_policy. user_and_org answers 409 org_recovery_key_required until the organization registers a recovery key (putOrgRecoveryKey)
multiplayerSessionsboolean | null
Whether members read each other's team-visible synced sessions; null for the default, false. A personal organization answers 403 personal_organization
cloudHistoryboolean | null
Whether Gateway stores the organization's cloud session history, readable by Nexus's systems and encrypted at rest; null for the default, true. Off, Gateway stores none and deletes what it holds
webSessionViewerboolean | null
Whether Nexus UI in a browser opens the organization's synced sessions; null for the default, true. Needs synced_sessions.manage_policy. Off, Nexus UI's credential gets 403 web_session_viewer_off for sealed events, key copies and a new device; the desktop, the phone and the CLI read as before
Responses
200OKapplication/json
hiddenMobilePlacesarray of "assistant" | "artifacts" | "customize"
Places hidden from members in the mobile drawer. The owner still sees them.
chatRetentionDaysintegerrequired
Days chat messages are kept (90 by default)
min 1 · max 3650
agentSubscriptionsboolean
Whether nexus claude --subscription may run (true by default)
growthEventsboolean
Whether the Gateway records the organization's growth events in its own store (true by default)
chatSuggestionsboolean
Whether chat sessions suggest the person's next message after an answer, a call the organization pays for (true by default)
defaultsobjectrequired
hiddenMobilePlacesarray of "assistant" | "artifacts" | "customize"
default []
chatRetentionDaysinteger
growthEventsboolean
chatSuggestionsboolean
artifacts.external"off" | "named" | "public"
artifacts.external.codeboolean
artifacts.external.domainsobject
allowarray of stringrequired
denyarray of stringrequired
artifacts.external.expiryobject
maxDaysinteger | nullrequired
min 1 · max 3650
requiredbooleanrequired
artifacts.external.continueboolean
artifacts.external.who"everyone" | "admins"
agentSubscriptionsboolean
artifacts.pagesboolean
artifacts.pages.publicboolean
artifacts.pages.queriesboolean
webSearch.engine"off" | "borrowed"
webSearch.modelstring | null
webSearch.domainsobject
allowarray of stringrequired
denyarray of stringrequired
webSearch.maxPerTurninteger
webSearch.requireZdrboolean
sessionContent"never" | "user" | "user_and_org"
multiplayerSessionsboolean
cloudHistoryboolean
webSessionViewerboolean
updatedAtstring (date-time)
artifacts.external"off" | "named" | "public"
Sharing artifacts outside the organization: off, named people only, or also public links (default public)
artifacts.external.codeboolean
May external snapshots include Ask your code's sources (default false)
artifacts.external.domainsobject
Email domains named outsiders may (allow, when set) or may not (deny) have; a domain matches itself and its subdomains (default both empty)
allowarray of stringrequired
denyarray of stringrequired
artifacts.external.expiryobject
The longest a public link may stay open, and whether every public link must expire (default none and false)
maxDaysinteger | nullrequired
min 1 · max 3650
requiredbooleanrequired
artifacts.external.continueboolean
May people outside continue the chat in an organization of their own, at its expense (default true)
artifacts.external.who"everyone" | "admins"
Who may share outside: everyone, or owners and admins (default everyone)
artifacts.pagesboolean
Pages: off refuses new pages, versions, shares and every page frame (default true)
artifacts.pages.publicboolean
Public links to pages: off refuses new ones and stops existing ones from opening (default false in a company organization, true in a personal one)
artifacts.pages.queriesboolean
Page queries (Nexus Data): on lets a page's owner approve read-only queries on a connection, whose results the page's readers see; off refuses saving and running them (default false)
webSearch.engine"off" | "borrowed"
Gates hosted web search in chat and in Code (nexus claude --api, nexus codex --api): off or borrowed (default borrowed; off means no web search runs)
webSearch.modelstring | null
The model that runs a chat's search: null for the default (the chat's own model, the cheapest on nexus/auto), cheapest, or a model's catalog id. A pinned model the person may not use, or nobody pays for, gives that person no search, and so does an id this Gateway cannot call, which is shown as stored. Chat only
webSearch.domainsobject
Domains a search result may (allow, when set) or may not (deny) come from (default both empty). While any is set, no web search runs, in chat or in Code, until the engine applies them
allowarray of stringrequired
denyarray of stringrequired
webSearch.maxPerTurninteger
Most searches in one chat turn (default 3). Applies to Gateway-run engines (chat) only
min 1 · max 10
webSearch.requireZdrboolean
Whether only engines with zero data retention may run (default false). While set, no web search runs, in chat or in Code, until the engine applies it
sessionContent"never" | "user" | "user_and_org"
The content policy for synced sessions that runners follow, readable by every member. The default is user in every organization; only a saved user_and_org applies, and it reads as user while the organization has no recovery key (getOrgRecoveryKey)
multiplayerSessionsboolean
Whether members read each other's team-visible synced sessions, still end-to-end encrypted. False by default; always false in a personal one
cloudHistoryboolean
Whether Gateway stores the organization's cloud session history, so a sleeping cloud session reads on any device. True by default. Off, Gateway stores none. Omitted for an organization that cannot run cloud machines and stores no cloud history
webSessionViewerboolean
Whether Nexus UI in a browser opens the organization's synced sessions. True by default. Off, Nexus UI's credential (its session token or its server's secret) gets 403 web_session_viewer_off for sealed events, key copies and a new device
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
400
invalid_request_error
A field is missing or not valid; the message names it
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
409
idempotency_in_progress
A request with the same Idempotency-Key is still running
409
idempotency_interrupted
The first request with this Idempotency-Key was cut off and may have run in part
422
idempotency_key_reused
The Idempotency-Key was used with a different request
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
Every control in the control inventory, as far as the caller reaches: owners and admins every control, a team lead the controls of the teams they lead, everyone their own values and those of their teams and the organization. An entry also keeps its own route's permission: a control the caller may not read there (the automatic top-up without org.billing) carries the refusal. An entry whose source was not read carries an error, and the answer stays 200.
The control's key in the inventory (controls.json).
capabilitystringrequired
valueany
The control's value, when its source was read: any JSON value. A model policy control maps each level that stores a rule (organization:organization, team:<slug>, agent:<name>) to the rule it stores. A level without a rule inherits the rule above it, so one level's entry is not, on its own, the rule enforced there.
errorstring
Set only when the control's value was not read. Tell a read value from an unread one by this field, not by value: a read value can be null.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
The vault's custody report for the organization (owners and admins): which master key wraps its data keys and who holds that master (Nexus's NEXUS_SECRET, a Cloud KMS key in Nexus's project, or one in the customer's own project, which the customer can revoke); every version of its data key; and every secret or reference the vault holds, with its table, its data key version and its last four characters. It never holds a secret or a data key.
nexus_secret: derived from Nexus's NEXUS_SECRET. nexus_kms: a Cloud KMS key in Nexus's project. customer_kms: a Cloud KMS key in the customer's own project; the customer can revoke Nexus's access.
keystring
The customer's Cloud KMS key's resource name; absent when Nexus holds the master.
nexus_secret: derived from Nexus's NEXUS_SECRET. nexus_kms: a Cloud KMS key in Nexus's project. customer_kms: a Cloud KMS key in the customer's own project; the customer can revoke Nexus's access.
keystring
The customer's Cloud KMS key's resource name; absent when Nexus holds the master.
data_key: the organization's data key of version keyVersion. nexus_secret: a key derived from NEXUS_SECRET, sealed before data keys. reference: no secret is held, only a reference to a vendor's short-lived token.
keyVersioninteger
last4string
createdAtstring (date-time)required
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
The organization's subscription (anyone in it): the plan, the member who pays, the member who receives billing mail, the paid term, the status and the seats (one per human member). An organization nobody changed yet reads as active since it was created, with everything else null and updatedAt: null.
Written by Billing alone. It changes what the organization is entitled to, never who is in it.
statusEffectiveAtstring (date-time)required
When the status took effect.
effectiveAtstring (date-time)required
When the newest change took effect.
updatedAtstring (date-time) | nullrequired
When the subscription was last written; null until its first change.
seatsintegerrequired
One per member that GET /v1/orgs/members lists, counted when read.
min 0
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
Name the payer and the billing contact (owners only). A field changes when present and clears when null; an absent field stays. Both must be members (400 not_a_member). plan, periodStart, periodEnd and status are refused (400 written_by_billing): Billing writes them from what the organization pays for. effectiveAt (default now) is when the change took effect: never in the future and never before the newest change (400 invalid_effective_at). dryRun: true answers with the result and writes nothing. Audited as subscription.changed, with the changed fields before and after and metadata.effectiveAt; a body that changes nothing writes nothing.
Written by Billing alone. It changes what the organization is entitled to, never who is in it.
statusEffectiveAtstring (date-time)required
When the status took effect.
effectiveAtstring (date-time)required
When the newest change took effect.
updatedAtstring (date-time) | nullrequired
When the subscription was last written; null until its first change.
seatsintegerrequired
One per member that GET /v1/orgs/members lists, counted when read.
min 0
changedarray of stringrequired
The fields that changed, or would change on a dry run; empty when nothing did.
dryRunbooleanrequired
True when nothing was written.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
400
invalid_request_error
A field is missing or not valid; the message names it
400
not_a_member
Both must be members (400 `not_a_member`)
400
written_by_billing
`plan`, `periodStart`, `periodEnd` and `status` are refused (400 `written_by_billing`): Billing writes them from what the organization pays for
400
invalid_effective_at
Never in the future and never before the newest change (400 `invalid_effective_at`)
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
409
idempotency_in_progress
A request with the same Idempotency-Key is still running
409
idempotency_interrupted
The first request with this Idempotency-Key was cut off and may have run in part
422
idempotency_key_reused
The Idempotency-Key was used with a different request
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
The plans this organization can take, priced as Stripe holds them (owner only): one source for Nexus UI, the desktop app, both CLIs and the phone. A per-seat plan is for companies and any other plan for personal organizations, so only the organization's kind is listed (audience). Each plan has its name (the Stripe Product's), perSeat, minSeats, and per interval amountUsd (the price, per seat for a per-seat plan) and includedUsd (included usage each month, per seat), as decimal strings. Each plan also has its cloud hours a month per seat (includedHours), the price of an hour past them (hourlyUsd, a decimal string or null) and the machine sizes it allows (sizes). A price Stripe could not give has amountUsd: null and a machine-readable error (stripe_error, stripe_timeout, inactive, not_usd, interval_mismatch, no_fixed_amount). Cheapest a month first. current is the plan the organization's subscription holds. Prices are cached for 10 minutes. 502 stripe_error when Stripe gave none of the listed prices; 503 not_configured without Stripe or NEXUS_PLANS.
The plan's key in NEXUS_PLANS, such as plus, pro or teams_pro.
namestringrequired
The Stripe Product's name; the key when Stripe gave none.
perSeatbooleanrequired
minSeatsintegerrequired
includedHoursintegerrequired
Cloud hours each month, in hours of the default machine size, per seat for a per-seat plan; 0 when NEXUS_PLANS sets none (pricing v3.0).
min 0
hourlyUsdstring | nullrequired
The price of a default-size hour past the plan's hours, as a decimal string with six places; null when NEXUS_PLANS sets none.
pattern ^[0-9]+\.[0-9]{6}$
sizesarray of "small" | "default" | "large" | "xlarge"required
The machine sizes the plan allows, smallest first; only default when NEXUS_PLANS sets none.
intervalsarray of objectrequired
interval"month" | "year"required
amountUsdstring | nullrequired
The price for the interval, per seat for a per-seat plan; null with error.
includedUsdstringrequired
Included usage each month, per seat for a per-seat plan.
errorstring | nullrequired
Why the price is not shown: stripe_error, stripe_timeout, inactive, not_usd, interval_mismatch or no_fixed_amount.
currentbooleanrequired
The organization's subscription holds this plan.
currentobject | nullrequired
The plan the organization's subscription holds; null on the Free plan.
403Not the owner (`permission_error`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
502Stripe gave none of the listed prices (`stripe_error`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503Stripe or NEXUS_PLANS is not configured (`not_configured`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429
rate_limit_error
Too many requests from this key in a minute
502
Stripe gave none of the listed prices (`stripe_error`)
502
stripe_error
502 `stripe_error` when Stripe gave none of the listed prices; 503 `not_configured` without Stripe or NEXUS_PLANS
503
Stripe or NEXUS_PLANS is not configured (`not_configured`)
503
not_configured
502 `stripe_error` when Stripe gave none of the listed prices; 503 `not_configured` without Stripe or NEXUS_PLANS
Change the organization's plan, interval or seats (owner only). Body: plan, interval, seats for a per-seat plan (one per member, at least its minimum: left out, Gateway counts them), and dryRun. A change that costs more a month applies now, and so does monthly to yearly at the same rate a month or more (a yearly price costs its plan's monthly price a month): Stripe prorates it and invoices the difference at once, and the month's included usage grows by the difference at once (live mode, or NEXUS_PLANS_TEST_GRANTS=on). A payment that fails changes nothing (402 payment_failed). Any other change (a cheaper plan, fewer seats, yearly to monthly, monthly to a yearly plan that costs less a month) applies at the period's end through a Stripe subscription schedule, shows as pendingChange on GET /v1/billing, and replaces an earlier pending change; DELETE cancels it. dryRun: true answers when, at and amountDueUsd (what is invoiced now) and changes nothing. The Idempotency-Key header keys the Stripe call. 400 unknown_plan, plan_not_for_org, same_plan; 409 no_plan without a paid plan, plan_ending while the plan is cancelled (renew it on Stripe's billing page first); 502 stripe_error; 503 not_configured until Stripe and NEXUS_PLANS are set.
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Request body · application/json
planstringrequired
interval"month" | "year"required
seatsinteger
For a per-seat plan: from its minimum to 1000 (its minimum when absent).
dryRunboolean
Answer what the change would charge and when, and change nothing.
Responses
200OKapplication/json
when"now" | "period_end"required
atstringrequired
When it applies (ISO 8601).
amountDueUsdstring | nullrequired
What is invoiced now, a decimal string: a dry run's preview, or 0 for a change at the period's end; null after a change applied now (Stripe invoiced it).
dryRunbooleanrequired
planBillingPlan | nullrequired
The plan after the change, or as it is for a dry run.
400An unknown plan or interval, seats out of range, a plan for the other kind of organization, or the plan the organization is onapplication/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
402Stripe could not take the payment for the change (`payment_failed`); nothing changedapplication/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
403Not the owner (`permission_error`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
409No paid plan to change (`no_plan`), or the plan is cancelled, for this period or a later one (`plan_ending`, with `cancelAt` on `GET /v1/billing`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
502Stripe refused the call, did not answer, or gave no prices to compare (`stripe_error`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503Stripe or NEXUS_PLANS is not configured (`not_configured`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
400
invalid_request_error
A field is missing or not valid; the message names it
400
An unknown plan or interval, seats out of range, a plan for the other kind of organization, or the plan the organization is on
400
unknown_plan
400 `unknown_plan`, `plan_not_for_org`, `same_plan`; 409 `no_plan` without a paid plan, `plan_ending` while the plan is cancelled (renew it on Stripe's billing page first); 502 `stripe_error`; 503 `not_configured` until Stripe and NEXUS_PLANS are set
401
authentication_error
No key, or a key Gateway does not accept
402
budget_exceeded
Stripe could not take the payment for the change (`payment_failed`); nothing changed
402
payment_failed
A payment that fails changes nothing (402 `payment_failed`)
403
role_required
Your role does not have this permission
409
No paid plan to change (`no_plan`), or the plan is cancelled, for this period or a later one (`plan_ending`, with `cancelAt` on `GET /v1/billing`)
409
no_plan
400 `unknown_plan`, `plan_not_for_org`, `same_plan`; 409 `no_plan` without a paid plan, `plan_ending` while the plan is cancelled (renew it on Stripe's billing page first); 502 `stripe_error`; 503 `not_configured` until Stripe and NEXUS_PLANS are set
409
idempotency_in_progress
A request with the same Idempotency-Key is still running
409
idempotency_interrupted
The first request with this Idempotency-Key was cut off and may have run in part
422
idempotency_key_reused
The Idempotency-Key was used with a different request
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429
rate_limit_error
Too many requests from this key in a minute
502
Stripe refused the call, did not answer, or gave no prices to compare (`stripe_error`)
502
stripe_error
400 `unknown_plan`, `plan_not_for_org`, `same_plan`; 409 `no_plan` without a paid plan, `plan_ending` while the plan is cancelled (renew it on Stripe's billing page first); 502 `stripe_error`; 503 `not_configured` until Stripe and NEXUS_PLANS are set
503
Stripe or NEXUS_PLANS is not configured (`not_configured`)
503
not_configured
400 `unknown_plan`, `plan_not_for_org`, `same_plan`; 409 `no_plan` without a paid plan, `plan_ending` while the plan is cancelled (renew it on Stripe's billing page first); 502 `stripe_error`; 503 `not_configured` until Stripe and NEXUS_PLANS are set
Cancel the plan change pending for the period's end (owner only): Stripe releases the schedule and the plan stays as it is. 409 no_pending_change without one; 502 stripe_error; 503 not_configured until Stripe is set up.
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Responses
200OKapplication/json
planBillingPlan | nullrequired
403Not the owner (`permission_error`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
409No plan change pending (`no_pending_change`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
502Stripe refused the call or did not answer (`stripe_error`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503Stripe is not configured (`not_configured`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
409
No plan change pending (`no_pending_change`)
409
no_pending_change
409 `no_pending_change` without one; 502 `stripe_error`; 503 `not_configured` until Stripe is set up
409
idempotency_in_progress
A request with the same Idempotency-Key is still running
409
idempotency_interrupted
The first request with this Idempotency-Key was cut off and may have run in part
422
idempotency_key_reused
The Idempotency-Key was used with a different request
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429
rate_limit_error
Too many requests from this key in a minute
502
Stripe refused the call or did not answer (`stripe_error`)
502
stripe_error
409 `no_pending_change` without one; 502 `stripe_error`; 503 `not_configured` until Stripe is set up
503
Stripe is not configured (`not_configured`)
503
not_configured
409 `no_pending_change` without one; 502 `stripe_error`; 503 `not_configured` until Stripe is set up
Start a plan for the organization (owner only): a link to a Stripe Checkout page that starts the subscription. Stripe sends the person back to <NEXUS_UI_URL>/<org>/billing?checkout=plan, or =plan_cancelled. The plans are the ones in NEXUS_PLANS (Pro, Max's tiers, Team, Team Premium), billed monthly or yearly; a per-seat plan has one seat per member, at least its minimum (the seats follow the members), so seats may be left out and, when given, must be that number. The plan's included usage is granted once a month as a Nexus subsidy and does not roll over. A per-seat plan is for companies and any other plan for personal organizations (GET /v1/billing/plans lists an organization's). 400 unknown_plan for a plan or interval this Gateway does not sell; 400 plan_not_for_org for a plan of the other kind of organization; 409 plan_active while the organization has a live subscription: change it with POST /v1/billing/plan/change. 502 stripe_error when Stripe refuses or does not answer. 503 not_configured until Stripe and NEXUS_PLANS are set, or without NEXUS_UI_URL.
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Request body · application/json
planstringrequired
A plan in NEXUS_PLANS, such as plus, pro, teams_plus or teams_pro
interval"month" | "year"required
seatsinteger
Per-seat plans only (Teams Plus, Teams Pro); the plan's minimum when absent
min 1 · max 1000
Responses
200OKapplication/json
urlstringrequired
Stripe Checkout's page, where the person enters the card.
expiresAtstring (date-time)required
When Stripe stops accepting url.
checkoutSessionIdstring
Exact Checkout session to confirm; returned by current Gateways.
400A bad plan, interval or seats (`unknown_plan`, `invalid_request`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
403Not the owner (`permission_error`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
409A live subscription already holds the plan (`plan_active`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
502Stripe refused the call or did not answer (`stripe_error`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503Stripe or NEXUS_PLANS is not configured, or NEXUS_UI_URL is not set (`not_configured`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
400
invalid_request_error
A field is missing or not valid; the message names it
400
A bad plan, interval or seats (`unknown_plan`, `invalid_request`)
400
unknown_plan
400 `unknown_plan` for a plan or interval this Gateway does not sell; 400 `plan_not_for_org` for a plan of the other kind of organization; 409 `plan_active` while the organization has a live subscription: change it with `POST /v1/billing/plan/change`
400
plan_not_for_org
400 `unknown_plan` for a plan or interval this Gateway does not sell; 400 `plan_not_for_org` for a plan of the other kind of organization; 409 `plan_active` while the organization has a live subscription: change it with `POST /v1/billing/plan/change`
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
409
A live subscription already holds the plan (`plan_active`)
409
plan_active
400 `unknown_plan` for a plan or interval this Gateway does not sell; 400 `plan_not_for_org` for a plan of the other kind of organization; 409 `plan_active` while the organization has a live subscription: change it with `POST /v1/billing/plan/change`
409
idempotency_in_progress
A request with the same Idempotency-Key is still running
409
idempotency_interrupted
The first request with this Idempotency-Key was cut off and may have run in part
422
idempotency_key_reused
The Idempotency-Key was used with a different request
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429
rate_limit_error
Too many requests from this key in a minute
502
Stripe refused the call or did not answer (`stripe_error`)
502
stripe_error
502 `stripe_error` when Stripe refuses or does not answer
503
Stripe or NEXUS_PLANS is not configured, or NEXUS_UI_URL is not set (`not_configured`)
503
not_configured
503 `not_configured` until Stripe and NEXUS_PLANS are set, or without NEXUS_UI_URL
Turn paying after the fact on or off, or change its monthly usage limit (owner only; pricing v2.0). Body: enabled, and limitUsd as a decimal string in whole cents. Turning it on needs the payment method on file (409 no_payment_method), and so does turning it on again with no limitUsd; a call with limitUsd changes the limit of a setting already on without one. A closed organization cannot turn it on (409 organization_closed). Calls the free start and the credits cannot pay then go on the card, at provider price plus Nexus's rate, up to the limit in a UTC month (past it, 402 usage_limit_reached). Gateway's Stripe sweep charges the card off session each time the unpaid usage reaches pricing.thresholdUsd (less carries over, and what is left is charged once it is turned off); a charge that fails stops the calls the card pays (402 payment_failed) and tells the owners, until a charge goes through. A disputed payment (charge.dispute.created) stops its card the same way (failed.reason: disputed) until an owner adds another card, and that card never pays again (409 card_disputed on turning it on with that card, or on again with no limitUsd; a limit change still works). Off stops new calls on the card and still charges what is owed. Off with limitUsd keeps the limit, even when it was never on. Audited as billing.after_the_fact_changed. 400 invalid_amount; 503 not_configured until Stripe is set up.
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Request body · application/json
enabledbooleanrequired
limitUsdstring
The monthly usage limit, dollars in whole cents, from 1.00 to 100000.00 (at most 100.00 in a new organization's first 7 days). A new setting starts at pricing.defaultLimitUsd.
Responses
200OKapplication/json
afterTheFactAfterTheFact | nullrequired
The setting after; null after turning off what was never on with no limitUsd.
400`limitUsd` outside $1 to $100,000 ($100 in a new organization's first 7 days) or not in whole cents (`invalid_amount`); `enabled` missingapplication/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
403Not the owner (`permission_error`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
409Turning on with no payment method on file (`no_payment_method`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503Stripe is not configured (`not_configured`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
400
invalid_request_error
A field is missing or not valid; the message names it
400
`limitUsd` outside $1 to $100,000 ($100 in a new organization's first 7 days) or not in whole cents (`invalid_amount`); `enabled` missing
400
invalid_amount
400 `invalid_amount`; 503 `not_configured` until Stripe is set up
401
authentication_error
No key, or a key Gateway does not accept
402
usage_limit_reached
Calls the free start and the credits cannot pay then go on the card, at provider price plus Nexus's rate, up to the limit in a UTC month (past it, 402 `usage_limit_reached`)
402
payment_failed
Gateway's Stripe sweep charges the card off session each time the unpaid usage reaches `pricing.thresholdUsd` (less carries over, and what is left is charged once it is turned off); a charge that fails stops the calls the card pays (402 `payment_failed`) and tells the owners, until a charge goes through
403
role_required
Your role does not have this permission
409
Turning on with no payment method on file (`no_payment_method`)
409
no_payment_method
Turning it on needs the payment method on file (409 `no_payment_method`), and so does turning it on again with no `limitUsd`; a call with `limitUsd` changes the limit of a setting already on without one
409
organization_closed
A closed organization cannot turn it on (409 `organization_closed`)
409
card_disputed
`disputed`) until an owner adds another card, and that card never pays again (409 `card_disputed` on turning it on with that card, or on again with no `limitUsd`; a limit change still works)
409
idempotency_in_progress
A request with the same Idempotency-Key is still running
409
idempotency_interrupted
The first request with this Idempotency-Key was cut off and may have run in part
422
idempotency_key_reused
The Idempotency-Key was used with a different request
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429
rate_limit_error
Too many requests from this key in a minute
503
Stripe is not configured (`not_configured`)
503
not_configured
400 `invalid_amount`; 503 `not_configured` until Stripe is set up
The organization's receipts (owner only; pricing v2.0), newest first, at most 100: credit purchases (credits, auto_topup), charges for usage after the fact (usage) and invoiced months (invoice). Read from Gateway's own records, with no call to Stripe. 503 not_configured until Stripe is set up.
What it paid for, such as Credits or Usage, threshold charge.
amountUsdstringrequired
status"paid" | "open" | "failed" | "void"required
urlstring | nullrequired
Stripe's page of an invoiced month; null for a payment.
receiptbooleanrequired
Stripe has a receipt page for it: GET /v1/billing/receipts/{id} answers its link.
403Not the owner (`permission_error`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503Stripe is not configured (`not_configured`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
100
credits
He organization's receipts (owner only; pricing v2.0), newest first, at most 100: credit purchases (`credits`, `auto_topup`), charges for usage after the fact (`usage`) and invoiced months (`invoice`)
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
Stripe's receipt page of one of the organization's payments (owner only; pricing v2.0): a credit purchase or a charge for usage after the fact, by its pi_… id. 404 not_found for a payment that is not the organization's; 409 no_receipt while Stripe has none; 502 stripe_error; 503 not_configured until Stripe is set up.
The payment's id (pi_…); any other id is no receipt (404).
Responses
200OKapplication/json
urlstringrequired
Stripe's receipt page of the payment.
403Not the owner (`permission_error`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
404Not one of the organization's payments (`not_found`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
409Stripe has no receipt for the payment yet (`no_receipt`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503Stripe is not configured (`not_configured`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
404
not_found
Nothing matches the path in your organization
404
Not one of the organization's payments (`not_found`)
409
Stripe has no receipt for the payment yet (`no_receipt`)
409
no_receipt
404 `not_found` for a payment that is not the organization's; 409 `no_receipt` while Stripe has none; 502 `stripe_error`; 503 `not_configured` until Stripe is set up
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429
rate_limit_error
Too many requests from this key in a minute
502
stripe_error
404 `not_found` for a payment that is not the organization's; 409 `no_receipt` while Stripe has none; 502 `stripe_error`; 503 `not_configured` until Stripe is set up
503
Stripe is not configured (`not_configured`)
503
not_configured
404 `not_found` for a payment that is not the organization's; 409 `no_receipt` while Stripe has none; 502 `stripe_error`; 503 `not_configured` until Stripe is set up
superseded: a newer card setup set its card first, so this one ended without setting the default.
403Not the owner (`permission_error`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
404Not one of the organization's payments (`not_found`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
503Stripe is not configured (`not_configured`)application/json
errorobject
messagestringrequired
typestringrequired
The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.
codestring
Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.
paramstring
model when the error is a model refusal (a code starting with model_); absent otherwise.
nexusobject
Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.
minimumstring
On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.
Errors
Status
Code
When
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
404
not_found
Nothing matches the path in your organization
404
Not one of the organization's payments (`not_found`)
429
Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).