Teams, the levels between the organization and the person, kept in Gateway (the sign-in provider has no teams). Teams nest: a team may have a parent team (no cycles, at most 10 levels) and a level, a free-text label each organization chooses. Someone added by an email not in the organization yet is a pending member until they join it. An organization can load its whole tree from a file (POST /v1/teams/import). Owners and admins create, rename and delete teams and manage their members; every member reads them and sets their own default team. Spend is attributed to the team named with x-nexus-team (or a team field), else the caller's default team. Team caps and person budgets are built: see Budgets. Team model policies are built: see Models.
The organization's teams, with member counts, your role in each and your default team (every member). With tree=1: the teams nested under their parents, with leads and headcount. The list (not the tree) pages with limit and cursor.
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
teamsarray of Team
idstringrequired
slugstringrequired
namestringrequired
descriptionstring
createdAtstring (date-time)required
membersintegerrequired
myRole"lead" | "member"
lead is reserved for the planned team-lead role and grants nothing extra yet.
isDefaultboolean
parentIdstring
The parent team's id; absent for a top-level team.
parentstring
The parent team's slug.
levelstring
The organization's own label for the team's level (e.g. department).
depthintegerrequired
1 for a top-level team.
pendingintegerrequired
People added by email who have not joined the organization yet.
childCountintegerrequired
defaultstring | null
treearray of TeamNode
With tree=1: the top-level teams.
idstringrequired
slugstringrequired
namestringrequired
descriptionstring
createdAtstring (date-time)required
membersintegerrequired
myRole"lead" | "member"
lead is reserved for the planned team-lead role and grants nothing extra yet.
isDefaultboolean
parentIdstring
The parent team's id; absent for a top-level team.
parentstring
The parent team's slug.
levelstring
The organization's own label for the team's level (e.g. department).
depthintegerrequired
1 for a top-level team.
pendingintegerrequired
People added by email who have not joined the organization yet.
leadsarray of object
userIdstring
emailstring
namestring
pendingboolean
headcountinteger
Distinct people in the team and every team under it, pending ones included.
childrenarray of TeamNode
Each has the same shape as TeamNode.
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).
Create a team (owners and admins), optionally under a parent team and with a level label. The slug is unique in the organization and follows the org slug rule (pending and import are reserved). An organization holds at most 2,000 teams: the next is refused with 409 team_limit.
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Request body · application/json
slugstringrequired
namestring
descriptionstring
parentstring | null
The parent team's slug or id; absent or null for a top-level team.
levelstring
A short label of the organization's choosing: 1 to 32 lower-case letters, digits or dashes.
Responses
201Createdapplication/json
idstringrequired
slugstringrequired
namestringrequired
descriptionstring
createdAtstring (date-time)required
membersintegerrequired
myRole"lead" | "member"
lead is reserved for the planned team-lead role and grants nothing extra yet.
isDefaultboolean
parentIdstring
The parent team's id; absent for a top-level team.
parentstring
The parent team's slug.
levelstring
The organization's own label for the team's level (e.g. department).
depthintegerrequired
1 for a top-level team.
pendingintegerrequired
People added by email who have not joined the organization yet.
childCountintegerrequired
memberListarray of TeamMember
userIdstringrequired
emailstring
namestring
role"lead" | "member"required
lead is reserved for the planned team-lead role and grants nothing extra yet.
isDefaultbooleanrequired
joinedAtstring (date-time)required
pendingListarray of PendingMember
idstringrequired
teamIdstringrequired
teamstringrequired
The team's slug.
emailstringrequired
role"lead" | "member"required
lead is reserved for the planned team-lead role and grants nothing extra yet.
homebooleanrequired
Becomes their default team when they join.
addedBystring
createdAtstring (date-time)required
patharray of TeamLink
The team's ancestors, top level first; the last is its parent.
idstringrequired
slugstringrequired
namestringrequired
levelstring
childrenarray of TeamLink & object
idstringrequired
slugstringrequired
namestringrequired
levelstring
membersinteger
pendinginteger
childCountinteger
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
team_limit
The next is refused with 409 `team_limit`
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).
Pending team members: people added by an email not in the organization yet (owners and admins). With by=person, one row per email with all their teams and their home team, and whether Gateway can invite them.
person: group by email (people); default: one row per pending membership (pending)
Responses
200OKapplication/json
object | 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.
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).
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Responses
200OKapplication/json
cancelledarray of PendingMember
idstringrequired
teamIdstringrequired
teamstringrequired
The team's slug.
emailstringrequired
role"lead" | "member"required
lead is reserved for the planned team-lead role and grants nothing extra yet.
homebooleanrequired
Becomes their default team when they join.
addedBystring
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
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).
Load the organization's teams from a file, in one transaction (owners and admins). Teams are matched by slug: missing ones are created, existing ones moved, renamed and relabelled; leads and members are set by email (pending for emails not in the organization yet) and home sets default teams. Idempotent: the same file twice changes nothing the second time. dryRun returns the same diff and changes nothing; prune also removes what the file does not list (never spend). A dry run returns a plan (a hash of the diff): apply with plan set to it and Gateway refuses (409 plan_changed) if the organization changed since, so exactly the reviewed changes apply. An import that would leave more than 2,000 teams in the organization, and adds any, is refused with 409 team_limit.
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Request body · application/json
unitsarray of objectrequired
slugstringrequired
namestring
levelstring | null
parentstring | null
The parent team's slug; absent or null for a top-level team.
descriptionstring | null
leadsarray of string (email) | object
membersarray of string (email) | object
dryRunboolean
Report the diff and change nothing.
pruneboolean
Also remove memberships and pending entries the file does not list from its teams, and delete teams it does not list (their spend stays).
planstring
A dry run's plan: apply only if the result is still exactly that (else 409 plan_changed).
pattern ^[0-9a-f]{16}$
Responses
200OKapplication/json
dryRunbooleanrequired
prunebooleanrequired
createdarray of stringrequired
movedarray of objectrequired
slugstring
fromstring
tostring
renamedarray of objectrequired
slugstring
fromstring
tostring
relevelledarray of objectrequired
slugstring
fromstring
tostring
membershipsAddedarray of objectrequired
teamstring
emailstring
rolestring
rolesChangedarray of objectrequired
teamstring
emailstring
fromstring
tostring
membershipsRemovedarray of objectrequired
teamstring
emailstring
rolestring
pendingarray of objectrequired
teamstring
emailstring
rolestring
pendingRemovedarray of objectrequired
teamstring
emailstring
defaultsarray of objectrequired
emailstring
teamstring
pendingboolean
deletedarray of stringrequired
warningsarray of stringrequired
totalsobjectrequired
teamsinteger
membershipsinteger
pendinginteger
planstringrequired
A short hash of this diff; pass it back as plan to apply exactly what a dry run showed.
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
plan_changed
Apply with `plan` set to it and Gateway refuses (409 `plan_changed`) if the organization changed since, so exactly the reviewed changes apply
409
team_limit
An import that would leave more than 2,000 teams in the organization, and adds any, is refused with 409 `team_limit`
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).
lead is reserved for the planned team-lead role and grants nothing extra yet.
isDefaultboolean
parentIdstring
The parent team's id; absent for a top-level team.
parentstring
The parent team's slug.
levelstring
The organization's own label for the team's level (e.g. department).
depthintegerrequired
1 for a top-level team.
pendingintegerrequired
People added by email who have not joined the organization yet.
childCountintegerrequired
memberListarray of TeamMember
userIdstringrequired
emailstring
namestring
role"lead" | "member"required
lead is reserved for the planned team-lead role and grants nothing extra yet.
isDefaultbooleanrequired
joinedAtstring (date-time)required
pendingListarray of PendingMember
idstringrequired
teamIdstringrequired
teamstringrequired
The team's slug.
emailstringrequired
role"lead" | "member"required
lead is reserved for the planned team-lead role and grants nothing extra yet.
homebooleanrequired
Becomes their default team when they join.
addedBystring
createdAtstring (date-time)required
patharray of TeamLink
The team's ancestors, top level first; the last is its parent.
idstringrequired
slugstringrequired
namestringrequired
levelstring
childrenarray of TeamLink & object
idstringrequired
slugstringrequired
namestringrequired
levelstring
membersinteger
pendinginteger
childCountinteger
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
404
not_found
Nothing matches the path in your 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).
Change a team (owners and admins): its slug, name, description or level, or move it under another parent (parent: null makes it top-level; no cycles, at most 10 levels). Past spend keeps the slug it had; a moved team keeps its history and rollups follow the current tree.
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Request body · application/json
slugstring
namestring
descriptionstring | null
parentstring | null
The new parent's slug or id, or null for the top level.
levelstring | null
The level label; null clears it.
Responses
200OKapplication/json
idstringrequired
slugstringrequired
namestringrequired
descriptionstring
createdAtstring (date-time)required
membersintegerrequired
myRole"lead" | "member"
lead is reserved for the planned team-lead role and grants nothing extra yet.
isDefaultboolean
parentIdstring
The parent team's id; absent for a top-level team.
parentstring
The parent team's slug.
levelstring
The organization's own label for the team's level (e.g. department).
depthintegerrequired
1 for a top-level team.
pendingintegerrequired
People added by email who have not joined the organization yet.
childCountintegerrequired
memberListarray of TeamMember
userIdstringrequired
emailstring
namestring
role"lead" | "member"required
lead is reserved for the planned team-lead role and grants nothing extra yet.
isDefaultbooleanrequired
joinedAtstring (date-time)required
pendingListarray of PendingMember
idstringrequired
teamIdstringrequired
teamstringrequired
The team's slug.
emailstringrequired
role"lead" | "member"required
lead is reserved for the planned team-lead role and grants nothing extra yet.
homebooleanrequired
Becomes their default team when they join.
addedBystring
createdAtstring (date-time)required
patharray of TeamLink
The team's ancestors, top level first; the last is its parent.
idstringrequired
slugstringrequired
namestringrequired
levelstring
childrenarray of TeamLink & object
idstringrequired
slugstringrequired
namestringrequired
levelstring
membersinteger
pendinginteger
childCountinteger
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
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).
Delete a team and its memberships (owners and admins). A team with child teams is refused (409 has_children) unless cascade=1, which deletes the whole subtree. Spend attributed to any of them keeps the team's id and slug.
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Responses
200OKapplication/json
deletedboolean
idstring
slugstring
teamsarray of string
Every team deleted (slugs).
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
404
not_found
Nothing matches the path in your organization
409
has_children
A team with child teams is refused (409 `has_children`) unless `cascade=1`, which deletes the whole subtree
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).
Add someone to a team, by userId or email (owners and admins). An email of someone not in the organization yet is kept as a pending membership (202) until they join it. The first team someone joins becomes their default, unless home makes this one it.
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Request body · application/json
userIdstring
emailstring
role"lead" | "member"
lead is reserved for the planned team-lead role and grants nothing extra yet.
homeboolean
Make this their default (home) team; for a pending member, when they join.
Responses
201Createdapplication/json
teamstring
memberTeamMember
userIdstringrequired
emailstring
namestring
role"lead" | "member"required
lead is reserved for the planned team-lead role and grants nothing extra yet.
isDefaultbooleanrequired
joinedAtstring (date-time)required
pendingfalse
202Pending: not in the organization yetapplication/json
pendingtrue
teamstring
entryPendingMember
Someone added to a team by an email not in the organization yet; they join the team when they join the organization.
idstringrequired
teamIdstringrequired
teamstringrequired
The team's slug.
emailstringrequired
role"lead" | "member"required
lead is reserved for the planned team-lead role and grants nothing extra yet.
homebooleanrequired
Becomes their default team when they join.
addedBystring
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
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).
Send the same key again to retry safely: the request runs once. See Idempotency keys.
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.
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).
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Request body · application/json
teamstring | nullrequired
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.
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).
A team's cap, as the caller may see it. An owner or admin gets the cap on that team and nothing from the teams above it (scope: cap): its limit, period, mode, spent, reserved, what is left and when it resets. A member of the team gets only what is left for them along the team's path, with the period and reset of the cap that binds (scope: own); the limit, spent and reserved of a team above theirs are never shown. budget is null when no cap applies. 404 unknown_team; 403 not_in_team for a member who is not in the team.
cap: an owner or admin reads the cap on this team. own: a member reads what is left for them.
budgetobject | nullrequired
The cap on this team (cap), or the cap that binds along the team's path (own); null when none applies
remainingUsdnumberrequired
What is left for the period, never below 0. Deprecated: read remainingUsdDecimal, the exact decimal string (root rule 9).
remainingUsdDecimalstring
remainingUsd as an exact decimal string in US dollars with six decimals ("12.245000"), from the micro-dollars. Prefer it to remainingUsd.
period"day" | "week" | "month"required
How often the cap resets
resetsAtstring (date-time)required
limitUsdnumber
Owners and admins only (scope: cap). Deprecated: read limitUsdDecimal, the exact decimal string (root rule 9).
limitUsdDecimalstring
limitUsd as an exact decimal string in US dollars with six decimals ("12.245000"), from the micro-dollars. Prefer it to limitUsd.
mode"hard_stop"
Owners and admins only
spentUsdnumber
Owners and admins only: settled this period, in the team and the teams under it. Deprecated: read spentUsdDecimal, the exact decimal string (root rule 9).
spentUsdDecimalstring
spentUsd as an exact decimal string in US dollars with six decimals ("12.245000"), from the micro-dollars. Prefer it to spentUsd.
reservedUsdnumber
Owners and admins only: held by calls in progress. Deprecated: read reservedUsdDecimal, the exact decimal string (root rule 9).
reservedUsdDecimalstring
reservedUsd as an exact decimal string in US dollars with six decimals ("12.245000"), from the micro-dollars. Prefer it to reservedUsd.
updatedAtstring (date-time)
Owners and admins only
canManagebooleanrequired
Whether the caller may set the cap (owners and admins)
403A member who is not in the team (`not_in_team`)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.
404No such team (`unknown_team`)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
401
authentication_error
No key, or a key Gateway does not accept
403
role_required
Your role does not have this permission
403
not_in_team
404 `unknown_team`; 403 `not_in_team` for a member who is not in the team
404
not_found
Nothing matches the path in your organization
404
No such team (`unknown_team`)
404
unknown_team
404 `unknown_team`; 403 `not_in_team` for a member who is not in the team
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).
Set a team's cap (owners and admins): an amount in US dollars per day, week or month, counted for the team and every team under it, and a stop mode. hard_stop refuses the call; warn and approval answer 400 mode_not_available until they are built. Cutting a cap below what the team used refuses the next call and leaves calls in progress alone. Audited as budget.team_changed, before and after. With dryRun: true it checks and answers the same, and changes nothing. The amount is amountUsd (a number, deprecated, or a decimal string) or amountUsdDecimal, read exactly. 400 invalid_amount, too_many_decimals, amount_mismatch, invalid_period, invalid_mode; 404 unknown_team.
Send the same key again to retry safely: the request runs once. See Idempotency keys.
Request body · application/json
amountUsdnumber | string
The cap for the period; 0 refuses every call. The cap for the period in US dollars: a JSON number (deprecated) or a decimal string with at most 6 decimals ("12.245"), read exactly. Send amountUsdDecimal instead to send only a string.
min 0 · max 1000000
amountUsdDecimalstring
The cap for the 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 amountUsd too, both must name the same amount (400 amount_mismatch).
pattern ^[0-9]+(\.[0-9]{1,6})?$
period"day" | "week" | "month"required
UTC calendar day, ISO week (from Monday) or month
mode"hard_stop" | "warn" | "approval"
Only hard_stop is available; the others answer 400 mode_not_available
default "hard_stop"
warnAtPercentnumber
For mode warn, which is not available yet
dryRunboolean
Check the cap and answer what would change; change nothing
Responses
200OKapplication/json
dryRunbooleanrequired
teamobjectrequired
slugstringrequired
namestringrequired
beforeobject | nullrequired
limitUsdnumberrequired
Deprecated: read limitUsdDecimal, the exact decimal string (root rule 9).
limitUsdDecimalstring
limitUsd as an exact decimal string in US dollars with six decimals ("12.245000"), from the micro-dollars. Prefer it to limitUsd.
period"day" | "week" | "month"required
mode"hard_stop"required
afterobjectrequired
limitUsdnumberrequired
Deprecated: read limitUsdDecimal, the exact decimal string (root rule 9).
limitUsdDecimalstring
limitUsd as an exact decimal string in US dollars with six decimals ("12.245000"), from the micro-dollars. Prefer it to limitUsd.
period"day" | "week" | "month"required
mode"hard_stop"required
400Not a valid cap (`invalid_amount`, `too_many_decimals`, `amount_mismatch`, `invalid_period`, `invalid_mode`, `mode_not_available`)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 a cap (`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.
404No such team (`unknown_team`)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 valid cap (`invalid_amount`, `too_many_decimals`, `amount_mismatch`, `invalid_period`, `invalid_mode`, `mode_not_available`)
400
mode_not_available
`hard_stop` refuses the call; `warn` and `approval` answer 400 `mode_not_available` until they are built
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).