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

API reference

Gateway

Organizations, keys, models, spend and the module registry.

View as Markdown

Create tenant

post/v1/tenants

Sign up: create a tenant, its first user and an API key (shown once). The person's personal organization is made too (personal in the answer); personal: true without a name makes only the personal organization and returns its key.

publicAnyone, signed in or notTry it in the API Explorer

Request body · application/json

  • namestring

    max length 80

  • emailstring
  • personalboolean

    Make only your personal organization (no name needed)

Responses

201Createdapplication/json

  • tenantobject
    • idstring
    • namestring
    • budgetUsdnumber
    • kind"company" | "personal"

      A company organization, or a person's own personal organization (one per person, one member)

    • slugstring

      A personal organization's slug

  • userobject
    • idstring
    • emailstring
  • apiKeystring
  • personalOrgSummary

    Your personal organization, made with the company organization

    • 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

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names 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).

Example

curl
curl -X POST "$NEXUS_URL/v1/tenants" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Platform",
    "email": "ada@example.com",
    "personal": false
  }'
TypeScript · @nexus/kit
import { createCoreClient } from "@nexus/kit";

const core = createCoreClient({ baseUrl: process.env.NEXUS_URL!, apiKey: process.env.NEXUS_API_KEY });
const result = await core.createTenant("Acme");

Current tenant

get/v1/tenants/me

The calling token's organization (id, name, slug), the person and their role and permissions.

org.readEvery memberTry it in the API Explorer

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.

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

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/tenants/me" \
  -H "Authorization: Bearer $NEXUS_API_KEY"
TypeScript · @nexus/kit
import { createCoreClient } from "@nexus/kit";

const core = createCoreClient({ baseUrl: process.env.NEXUS_URL!, apiKey: process.env.NEXUS_API_KEY });
const result = await core.me();

List provider keys

get/v1/keys/providers

List the tenant's own provider keys (last four characters only).

org.readEvery memberTry it in the API Explorer

Responses

200OKapplication/json

  • providersarray of ProviderKey

    The organization's own keys.

    • providerstring
    • scope"team" | "user"

      Who holds the key: a team or a person. Absent for the organization's own.

    • scopeIdstring

      The team's or the person's id.

    • last4string
    • createdAtstring (date-time)
    • state"valid" | "rejected" | "unreachable" | "disabled" | "removed"

      What the provider answered when the key was checked on add: a model listing, which costs nothing. Absent for a key stored before the check. An add the provider rejects answers 400 provider_key_rejected and stores nothing. disabled and removed are an admin's: no call opens such a key. The list marks a disabled key unused and leaves a removed one out. rejected on a stored key: its provider refused it on a call with HTTP 401; enableProviderKey checks it again, and a replacement clears it.

    • checkedAtstring (date-time)
    • lastUsedOnstring (date)

      The UTC day a call last used the key.

    • versionsarray of ProviderKeyVersion

      Each key stored for the provider, oldest first, at most 50; only on getProviderKey.

      • versionintegerrequired

        1 for the first key stored for the provider, then one more for each replacement.

      • last4stringrequired
      • addedAtstring (date-time)required
      • addedBystring

        The user who added it; absent for Core's own work and for a key stored before Nexus recorded who added keys.

  • scopedKeysarray of ProviderKey

    The keys the organization's teams and people hold. An owner or admin reads every one; anyone else reads the teams' keys and their own. Absent when there is none. A call takes the caller's own key, then its team's, then each parent team's, then the organization's: the first one that is not disabled.

    • providerstring
    • scope"team" | "user"

      Who holds the key: a team or a person. Absent for the organization's own.

    • scopeIdstring

      The team's or the person's id.

    • last4string
    • createdAtstring (date-time)
    • state"valid" | "rejected" | "unreachable" | "disabled" | "removed"

      What the provider answered when the key was checked on add: a model listing, which costs nothing. Absent for a key stored before the check. An add the provider rejects answers 400 provider_key_rejected and stores nothing. disabled and removed are an admin's: no call opens such a key. The list marks a disabled key unused and leaves a removed one out. rejected on a stored key: its provider refused it on a call with HTTP 401; enableProviderKey checks it again, and a replacement clears it.

    • checkedAtstring (date-time)
    • lastUsedOnstring (date)

      The UTC day a call last used the key.

    • versionsarray of ProviderKeyVersion

      Each key stored for the provider, oldest first, at most 50; only on getProviderKey.

      • versionintegerrequired

        1 for the first key stored for the provider, then one more for each replacement.

      • last4stringrequired
      • addedAtstring (date-time)required
      • addedBystring

        The user who added it; absent for Core's own work and for a key stored before Nexus recorded who added keys.

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

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/keys/providers" \
  -H "Authorization: Bearer $NEXUS_API_KEY"
TypeScript · @nexus/kit
import { createCoreClient } from "@nexus/kit";

const core = createCoreClient({ baseUrl: process.env.NEXUS_URL!, apiKey: process.env.NEXUS_API_KEY });
const result = await core.listProviderKeys();

Add provider key

post/v1/keys/providers

Store a provider key (BYOK), encrypted at rest. Used for this tenant's calls only.

provider_keys.manageOwner, AdminTry it in the API Explorer

Parameters

  • Idempotency-Keyheader · string

    Send the same key again to retry safely: the request runs once. See Idempotency keys.

Request body · application/json

  • provider"anthropic" | "openai"required
  • keystringrequired
  • teamstring

    A team's key: the team's slug or id. Leave out team and user for the organization's own key.

  • userstring

    A person's key: me or a member's id. Name a team or a user, not both: both are a 400, and one the organization lacks is a 404.

Responses

201Createdapplication/json

  • providerstring
  • scope"team" | "user"

    Who holds the key: a team or a person. Absent for the organization's own.

  • scopeIdstring

    The team's or the person's id.

  • last4string
  • createdAtstring (date-time)
  • state"valid" | "rejected" | "unreachable" | "disabled" | "removed"

    What the provider answered when the key was checked on add: a model listing, which costs nothing. Absent for a key stored before the check. An add the provider rejects answers 400 provider_key_rejected and stores nothing. disabled and removed are an admin's: no call opens such a key. The list marks a disabled key unused and leaves a removed one out. rejected on a stored key: its provider refused it on a call with HTTP 401; enableProviderKey checks it again, and a replacement clears it.

  • checkedAtstring (date-time)
  • lastUsedOnstring (date)

    The UTC day a call last used the key.

  • versionsarray of ProviderKeyVersion

    Each key stored for the provider, oldest first, at most 50; only on getProviderKey.

    • versionintegerrequired

      1 for the first key stored for the provider, then one more for each replacement.

    • last4stringrequired
    • addedAtstring (date-time)required
    • addedBystring

      The user who added it; absent for Core's own work and for a key stored before Nexus recorded who added keys.

400Not valid: a provider not in the list (`provider_retired` for a retired one), a key not 8 to 512 characters once surrounding whitespace is trimmed, or both `team` and `user`. `provider_key_invalid_character`: the trimmed key holds a character outside visible ASCII, such as a space, a line break, a terminal's paste marker or an invisible mark, so it is never sent or stored. A NUL is refused before that as `nul_in_string`. `provider_key_rejected`: the provider refused the key when it was checked, and nothing is stored.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

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
400Not valid: a provider not in the list (`provider_retired` for a retired one), a key not 8 to 512 characters once surrounding whitespace is trimmed, or both `team` and `user`. `provider_key_invalid_character`: the trimmed key holds a character outside visible ASCII, such as a space, a line break, a terminal's paste marker or an invisible mark, so it is never sent or stored. A NUL is refused before that as `nul_in_string`. `provider_key_rejected`: the provider refused the key when it was checked, and nothing is stored.
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
409idempotency_in_progressA request with the same Idempotency-Key is still running
409idempotency_interruptedThe first request with this Idempotency-Key was cut off and may have run in part
422idempotency_key_reusedThe Idempotency-Key was used with a different request
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/keys/providers" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "anthropic",
    "key": "<key>"
  }'
TypeScript · @nexus/kit
import { createCoreClient } from "@nexus/kit";

const core = createCoreClient({ baseUrl: process.env.NEXUS_URL!, apiKey: process.env.NEXUS_API_KEY });
const result = await core.addProviderKey("anthropic", process.env.ANTHROPIC_API_KEY ?? "");

Get provider key

get/v1/keys/providers/{provider}

One provider key, in any state, with its versions: who added each, when, and its last four characters, never the value. 404 provider_key_not_found when none was ever stored.

org.readEvery memberTry it in the API Explorer

Parameters

  • providerpath · stringrequired

    The key's provider (anthropic, openai)

  • teamquery · string

    A team's key: the team's slug or id. Leave out team and user for the organization's own key.

  • userquery · string

    A person's key: me or a member's id. Another person's key is an owner's or admin's to read: anyone else gets a 403.

Responses

200OKapplication/json

  • providerstring
  • scope"team" | "user"

    Who holds the key: a team or a person. Absent for the organization's own.

  • scopeIdstring

    The team's or the person's id.

  • last4string
  • createdAtstring (date-time)
  • state"valid" | "rejected" | "unreachable" | "disabled" | "removed"

    What the provider answered when the key was checked on add: a model listing, which costs nothing. Absent for a key stored before the check. An add the provider rejects answers 400 provider_key_rejected and stores nothing. disabled and removed are an admin's: no call opens such a key. The list marks a disabled key unused and leaves a removed one out. rejected on a stored key: its provider refused it on a call with HTTP 401; enableProviderKey checks it again, and a replacement clears it.

  • checkedAtstring (date-time)
  • lastUsedOnstring (date)

    The UTC day a call last used the key.

  • versionsarray of ProviderKeyVersion

    Each key stored for the provider, oldest first, at most 50; only on getProviderKey.

    • versionintegerrequired

      1 for the first key stored for the provider, then one more for each replacement.

    • last4stringrequired
    • addedAtstring (date-time)required
    • addedBystring

      The user who added it; absent for Core's own work and for a key stored before Nexus recorded who added keys.

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

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
404not_foundNothing matches the path in your organization
404provider_key_not_found404 `provider_key_not_found` when none was ever stored
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/keys/providers/anthropic" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Replace provider key

post/v1/keys/providers/{provider}/replace

Replace the stored provider key with key, checked against its provider first, as its next version. A disabled key stays disabled. 404 provider_key_not_found when none is stored, before the key is sent anywhere; 400 provider_key_invalid_character when the trimmed key holds a character outside visible ASCII, and nothing is sent; 400 provider_key_rejected when the provider refuses it, and the stored key stays. With dryRun: true, the key is checked and nothing is stored. Audited as provider_key.replaced.

provider_keys.manageOwner, AdminTry it in the API Explorer

Parameters

  • providerpath · stringrequired

    The key's provider (anthropic, openai)

  • Idempotency-Keyheader · string

    Send the same key again to retry safely: the request runs once. See Idempotency keys.

Request body · application/json

  • keystringrequired
  • dryRunboolean

    Check and change nothing.

    default false

  • teamstring

    A team's key: the team's slug or id. Leave out team and user for the organization's own key.

  • userstring

    A person's key: me or a member's id. Name a team or a user, not both: both are a 400, and one the organization lacks is a 404.

Responses

200OKapplication/json

  • dryRunbooleanrequired
  • changedbooleanrequired

    False when the key was already in the state asked for, so nothing was written.

  • providerKeyProviderKeyrequired

    The key after the change, or as it would be after a dry run.

    • providerstring
    • scope"team" | "user"

      Who holds the key: a team or a person. Absent for the organization's own.

    • scopeIdstring

      The team's or the person's id.

    • last4string
    • createdAtstring (date-time)
    • state"valid" | "rejected" | "unreachable" | "disabled" | "removed"

      What the provider answered when the key was checked on add: a model listing, which costs nothing. Absent for a key stored before the check. An add the provider rejects answers 400 provider_key_rejected and stores nothing. disabled and removed are an admin's: no call opens such a key. The list marks a disabled key unused and leaves a removed one out. rejected on a stored key: its provider refused it on a call with HTTP 401; enableProviderKey checks it again, and a replacement clears it.

    • checkedAtstring (date-time)
    • lastUsedOnstring (date)

      The UTC day a call last used the key.

    • versionsarray of ProviderKeyVersion

      Each key stored for the provider, oldest first, at most 50; only on getProviderKey.

      • versionintegerrequired

        1 for the first key stored for the provider, then one more for each replacement.

      • last4stringrequired
      • addedAtstring (date-time)required
      • addedBystring

        The user who added it; absent for Core's own work and for a key stored before Nexus recorded who added keys.

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

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
400provider_key_invalid_character404 `provider_key_not_found` when none is stored, before the key is sent anywhere; 400 `provider_key_invalid_character` when the trimmed key holds a character outside visible ASCII, and nothing is sent; 400 `provider_key_rejected` when the provider refuses it, and the stored key stays
400provider_key_rejected404 `provider_key_not_found` when none is stored, before the key is sent anywhere; 400 `provider_key_invalid_character` when the trimmed key holds a character outside visible ASCII, and nothing is sent; 400 `provider_key_rejected` when the provider refuses it, and the stored key stays
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
404not_foundNothing matches the path in your organization
404provider_key_not_found404 `provider_key_not_found` when none is stored, before the key is sent anywhere; 400 `provider_key_invalid_character` when the trimmed key holds a character outside visible ASCII, and nothing is sent; 400 `provider_key_rejected` when the provider refuses it, and the stored key stays
409idempotency_in_progressA request with the same Idempotency-Key is still running
409idempotency_interruptedThe first request with this Idempotency-Key was cut off and may have run in part
422idempotency_key_reusedThe Idempotency-Key was used with a different request
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/keys/providers/anthropic/replace" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "key": "<key>"
  }'

Disable provider key

post/v1/keys/providers/{provider}/disable

Disable the stored provider key: it stays sealed, and no call opens it until it is enabled. Disabling a disabled key answers changed: false. 404 provider_key_not_found when none is stored. With dryRun: true, nothing changes. Audited as provider_key.disabled.

provider_keys.manageOwner, AdminTry it in the API Explorer

Parameters

  • providerpath · stringrequired

    The key's provider (anthropic, openai)

  • Idempotency-Keyheader · string

    Send the same key again to retry safely: the request runs once. See Idempotency keys.

Request body (optional) · application/json

  • dryRunboolean

    Check and change nothing.

    default false

  • teamstring

    A team's key: the team's slug or id. Leave out team and user for the organization's own key.

  • userstring

    A person's key: me or a member's id. Name a team or a user, not both: both are a 400, and one the organization lacks is a 404.

Responses

200OKapplication/json

  • dryRunbooleanrequired
  • changedbooleanrequired

    False when the key was already in the state asked for, so nothing was written.

  • providerKeyProviderKeyrequired

    The key after the change, or as it would be after a dry run.

    • providerstring
    • scope"team" | "user"

      Who holds the key: a team or a person. Absent for the organization's own.

    • scopeIdstring

      The team's or the person's id.

    • last4string
    • createdAtstring (date-time)
    • state"valid" | "rejected" | "unreachable" | "disabled" | "removed"

      What the provider answered when the key was checked on add: a model listing, which costs nothing. Absent for a key stored before the check. An add the provider rejects answers 400 provider_key_rejected and stores nothing. disabled and removed are an admin's: no call opens such a key. The list marks a disabled key unused and leaves a removed one out. rejected on a stored key: its provider refused it on a call with HTTP 401; enableProviderKey checks it again, and a replacement clears it.

    • checkedAtstring (date-time)
    • lastUsedOnstring (date)

      The UTC day a call last used the key.

    • versionsarray of ProviderKeyVersion

      Each key stored for the provider, oldest first, at most 50; only on getProviderKey.

      • versionintegerrequired

        1 for the first key stored for the provider, then one more for each replacement.

      • last4stringrequired
      • addedAtstring (date-time)required
      • addedBystring

        The user who added it; absent for Core's own work and for a key stored before Nexus recorded who added keys.

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

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
404not_foundNothing matches the path in your organization
404provider_key_not_found404 `provider_key_not_found` when none is stored
409idempotency_in_progressA request with the same Idempotency-Key is still running
409idempotency_interruptedThe first request with this Idempotency-Key was cut off and may have run in part
422idempotency_key_reusedThe Idempotency-Key was used with a different request
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/keys/providers/anthropic/disable" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "dryRun": false,
    "team": "platform",
    "user": "<user>"
  }'

Enable provider key

post/v1/keys/providers/{provider}/enable

Enable a disabled provider key, or check a rejected one again, after checking it against its provider: its state is what the provider answers. 400 provider_key_rejected when the provider still refuses it, and it stays as it was. 400 provider_key_invalid_character when the stored key holds a character outside visible ASCII: it is not sent, and only a replacement mends it. Enabling a key that is neither disabled nor rejected answers changed: false. 409 provider_key_changed when the key was replaced while it was checked. With dryRun: true, the key is checked and nothing changes. Audited as provider_key.enabled.

provider_keys.manageOwner, AdminTry it in the API Explorer

Parameters

  • providerpath · stringrequired

    The key's provider (anthropic, openai)

  • Idempotency-Keyheader · string

    Send the same key again to retry safely: the request runs once. See Idempotency keys.

Request body (optional) · application/json

  • dryRunboolean

    Check and change nothing.

    default false

  • teamstring

    A team's key: the team's slug or id. Leave out team and user for the organization's own key.

  • userstring

    A person's key: me or a member's id. Name a team or a user, not both: both are a 400, and one the organization lacks is a 404.

Responses

200OKapplication/json

  • dryRunbooleanrequired
  • changedbooleanrequired

    False when the key was already in the state asked for, so nothing was written.

  • providerKeyProviderKeyrequired

    The key after the change, or as it would be after a dry run.

    • providerstring
    • scope"team" | "user"

      Who holds the key: a team or a person. Absent for the organization's own.

    • scopeIdstring

      The team's or the person's id.

    • last4string
    • createdAtstring (date-time)
    • state"valid" | "rejected" | "unreachable" | "disabled" | "removed"

      What the provider answered when the key was checked on add: a model listing, which costs nothing. Absent for a key stored before the check. An add the provider rejects answers 400 provider_key_rejected and stores nothing. disabled and removed are an admin's: no call opens such a key. The list marks a disabled key unused and leaves a removed one out. rejected on a stored key: its provider refused it on a call with HTTP 401; enableProviderKey checks it again, and a replacement clears it.

    • checkedAtstring (date-time)
    • lastUsedOnstring (date)

      The UTC day a call last used the key.

    • versionsarray of ProviderKeyVersion

      Each key stored for the provider, oldest first, at most 50; only on getProviderKey.

      • versionintegerrequired

        1 for the first key stored for the provider, then one more for each replacement.

      • last4stringrequired
      • addedAtstring (date-time)required
      • addedBystring

        The user who added it; absent for Core's own work and for a key stored before Nexus recorded who added keys.

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

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
400provider_key_rejected400 `provider_key_rejected` when the provider still refuses it, and it stays as it was
400provider_key_invalid_character400 `provider_key_invalid_character` when the stored key holds a character outside visible ASCII: it is not sent, and only a replacement mends it
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
404not_foundNothing matches the path in your organization
409provider_key_changed409 `provider_key_changed` when the key was replaced while it was checked
409idempotency_in_progressA request with the same Idempotency-Key is still running
409idempotency_interruptedThe first request with this Idempotency-Key was cut off and may have run in part
422idempotency_key_reusedThe Idempotency-Key was used with a different request
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/keys/providers/anthropic/enable" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "dryRun": false,
    "team": "platform",
    "user": "<user>"
  }'

Remove provider key

post/v1/keys/providers/{provider}/remove

Remove the stored provider key: its sealed value is deleted, its state is removed, and its versions stay. 404 provider_key_not_found when none is stored. With dryRun: true, nothing changes. Audited as provider_key.removed.

provider_keys.manageOwner, AdminTry it in the API Explorer

Parameters

  • providerpath · stringrequired

    The key's provider (anthropic, openai)

  • Idempotency-Keyheader · string

    Send the same key again to retry safely: the request runs once. See Idempotency keys.

Request body (optional) · application/json

  • dryRunboolean

    Check and change nothing.

    default false

  • teamstring

    A team's key: the team's slug or id. Leave out team and user for the organization's own key.

  • userstring

    A person's key: me or a member's id. Name a team or a user, not both: both are a 400, and one the organization lacks is a 404.

Responses

200OKapplication/json

  • dryRunbooleanrequired
  • changedbooleanrequired

    False when the key was already in the state asked for, so nothing was written.

  • providerKeyProviderKeyrequired

    The key after the change, or as it would be after a dry run.

    • providerstring
    • scope"team" | "user"

      Who holds the key: a team or a person. Absent for the organization's own.

    • scopeIdstring

      The team's or the person's id.

    • last4string
    • createdAtstring (date-time)
    • state"valid" | "rejected" | "unreachable" | "disabled" | "removed"

      What the provider answered when the key was checked on add: a model listing, which costs nothing. Absent for a key stored before the check. An add the provider rejects answers 400 provider_key_rejected and stores nothing. disabled and removed are an admin's: no call opens such a key. The list marks a disabled key unused and leaves a removed one out. rejected on a stored key: its provider refused it on a call with HTTP 401; enableProviderKey checks it again, and a replacement clears it.

    • checkedAtstring (date-time)
    • lastUsedOnstring (date)

      The UTC day a call last used the key.

    • versionsarray of ProviderKeyVersion

      Each key stored for the provider, oldest first, at most 50; only on getProviderKey.

      • versionintegerrequired

        1 for the first key stored for the provider, then one more for each replacement.

      • last4stringrequired
      • addedAtstring (date-time)required
      • addedBystring

        The user who added it; absent for Core's own work and for a key stored before Nexus recorded who added keys.

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

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
404not_foundNothing matches the path in your organization
404provider_key_not_found404 `provider_key_not_found` when none is stored
409idempotency_in_progressA request with the same Idempotency-Key is still running
409idempotency_interruptedThe first request with this Idempotency-Key was cut off and may have run in part
422idempotency_key_reusedThe Idempotency-Key was used with a different request
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/keys/providers/anthropic/remove" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "dryRun": false,
    "team": "platform",
    "user": "<user>"
  }'

Chat completion

post/v1/chat/completions

OpenAI-compatible chat completion. Policy check, then the call's maximum cost is reserved against the budget, the provider is called, and the reservation settles on reported usage (also on errors). Model nexus/auto lets Gateway choose. model is a catalog id (any spelling), nexus/auto or nexus/default (the effective default within policy); the answer's model and x-nexus-model header say which model ran. An answer the auto router picked also names the router version in x-nexus-router and in nexus.router. A refused model: 403 model_not_allowed (policy, naming the level and rule), 404 model_not_found, 400 model_not_supported (coming soon); never sent upstream or reserved, recorded as a refused call. Who pays: the organization's own key; Nexus's own key for Nexus's own organizations; Nexus credit only for a module run's scoped key (a Nexus feature, such as a Wiki or Review run). Any other caller with no key of its own gets 403 provider_key_required, never Nexus credit. Tools (OpenAI's tools, tool_choice, parallel_tool_calls, an assistant's tool_calls and tool messages) work for Anthropic and OpenAI models alike, translated by Gateway. stream: true answers as server-sent events in OpenAI's chat.completion.chunk shape (the role, then text and tool-call pieces, a chunk with finish_reason, a last chunk with no choices and the usage and nexus cost, then data: [DONE]; a failure after the stream started is a data: {"error": …} event), so agent tools that speak Chat Completions (opencode's @ai-sdk/openai-compatible and the like) use <gateway>/v1 as their provider. A stream is checked, reserved and refused exactly as a call that does not stream, and settles however it ends: on the reported usage, or on what streamed when the provider fails or the caller goes away.

models.useEvery member, module keysTry it in the API Explorer

Parameters

  • x-nexus-teamheader · string

    The team (slug) this call's spend goes to; you must be in it. Default: your default team.

  • Idempotency-Keyheader · string

    Send the same key again to retry safely: the request runs once. See Idempotency keys.

Request body · application/json

  • modelstringrequired
  • messagesarray of ChatMessagerequired
    • role"system" | "developer" | "user" | "assistant" | "tool"required

      developer is taken as system. Answers are always assistant.

    • contentstring | array of object | null

      The text, or OpenAI's content parts: {type: "text", text} (joined) and, in a person's message, {type: "image_url", image_url: {url}} with a data: URL (Gateway fetches no URLs). An assistant turn that only calls tools may leave it out or send null. Answers carry a string.

    • tool_callsarray of ToolCall

      The tools an assistant turn called (in an answer: when finish_reason is tool_calls).

      • idstringrequired
      • type"function"required
      • functionobjectrequired
        • namestringrequired
        • argumentsstringrequired

          A JSON object, as a string.

    • tool_call_idstring

      A tool message: the call it answers.

  • max_tokensinteger

    At most the lower of the deployment's cap (NEXUS_MAX_TOKENS) and the model's max_output_tokens; above it is a 400 output_over_limit before anything is reserved, with error.nexus.limit. A call skips a host whose output limit is below it; when no host it may use takes it, the same 400 names the largest limit of those hosts. A call also skips a host that does not read the call's images (400 model_no_image_input when no host does) and a host that does not take its reasoning_effort (400 reasoning_effort_not_offered). A host whose own context window may be too small for the prompt and max_tokens is tried after the hosts that surely hold them. Absent: the model's chat default, within that cap.

    min 1

  • temperaturenumber
  • streamboolean

    Answer as server-sent events (ChatCompletionChunk). Absent or null: no stream. A value that is not a boolean is a 400 (stream must be true or false).

  • stream_optionsobject

    Accepted for compatibility; a stream always ends with its usage chunk.

    • include_usageboolean
  • toolsarray of object

    Functions the model may call, in OpenAI's shape; translated for Anthropic models.

    • type"function"required
    • functionobjectrequired
      • namestringrequired
      • descriptionstring
      • parametersobject

        A JSON Schema; {"type": "object"} when left out.

  • tool_choice"auto" | "none" | "required" | object

    auto (the default), none, required, or one function by name (it must be in tools). required or a function on a model that does not take a forced choice is 400 tool_choice_not_offered, before anything is reserved.

  • parallel_tool_callsboolean

    false: at most one tool call per answer.

  • reasoning_effortstring

    One of the model's reasoning.efforts (GET /v1/models). Absent: the provider's default. An effort the model does not offer is a 400 reasoning_effort_not_offered before anything is reserved; error.nexus.offered lists the model's efforts.

  • response_formatobject

    OpenAI's response_format, sent on as written when the model offers its type (text, json_object or json_schema). A type the model does not offer is a 400 response_format_not_offered before anything is reserved; error.nexus.offered lists the model's types.

    • typestringrequired

Responses

200OK: the answer, or with `stream: true` its server-sent eventsapplication/json

  • idstring
  • object"chat.completion"
  • createdinteger
  • modelstring
  • choicesarray of object
    • indexinteger
    • messageChatMessage
      • role"system" | "developer" | "user" | "assistant" | "tool"required

        developer is taken as system. Answers are always assistant.

      • contentstring | array of object | null

        The text, or OpenAI's content parts: {type: "text", text} (joined) and, in a person's message, {type: "image_url", image_url: {url}} with a data: URL (Gateway fetches no URLs). An assistant turn that only calls tools may leave it out or send null. Answers carry a string.

      • tool_callsarray of ToolCall

        The tools an assistant turn called (in an answer: when finish_reason is tool_calls).

        • idstringrequired
        • type"function"required
        • functionobjectrequired
          • namestringrequired
          • argumentsstringrequired

            A JSON object, as a string.

      • tool_call_idstring

        A tool message: the call it answers.

    • finish_reasonstring

      Stop, length, or refusal when the provider declined to answer; its words are in nexus.refusal.

  • usageobject
    • prompt_tokensinteger
    • completion_tokensinteger
    • total_tokensinteger
  • nexusobject

    What the call cost and who it was attributed to.

    • cost_usdnumber
    • productstring
    • capabilitystring
    • providerstring
    • funded_by"own_key" | "nexus_key" | "nexus_subsidy" | "nexus_credit" | "nexus_invoiced"

      Who paid the provider. own_key: the organization's own key; nexus_key: Nexus's own key, for Nexus's own organizations; nexus_subsidy: a Nexus subsidy; nexus_credit: the organization's prepaid Nexus credits, charged the cost plus Nexus's rate; nexus_invoiced: an organization under contract, billed the cost plus Nexus's rate on its month's invoice. Unset on the mock provider

    • refusalstring

      The provider's words when it declined to answer (a safety refusal); set exactly when finish_reason is "refusal". Billed as the provider billed it.

    • routerobject

      The auto router's pick, on an answer it routed or a chat session held. The answer also carries the header x-nexus-router with the version. Unset on every other answer. The pick's cost estimates stay on the spend record.

      • versionstringrequired

        The router version that acted, e.g. auto-v0.0.1.

      • class"light" | "standard" | "heavy"

        The request's class. Unset on a held pick.

      • reason"cheapest" | "below_floor" | "catalog_order"

        Why the version chose its model. Unset on a held pick.

      • heldbooleanrequired

        The chat session held its model, with no router run.

      • default_modelstring

        The model nexus/auto resolves to for the caller with no router.

      • effortstring

        The reasoning effort the call ran at: the request's own reasoning_effort, else the one the router version picked. Unset when the call ran at the model's default.

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.

401No credential (`missing_credential`), or a credential Gateway does not accept (`invalid_credential`).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 call's maximum cost is more than the budget left (`budget_exceeded`; `subsidy_exhausted` for the Nexus subsidy, or `credit_exhausted` for the organization's prepaid credits), or the organization has an unpaid Nexus invoice past its grace (`payment_past_due`). A `budget_exceeded` refusal carries `notified: true` in its details once Gateway has told the refused person and the organization's owners and admins. The details are a BudgetRefusal: each money figure with its exact decimal twin.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.

  • errorobject
    • nexusBudgetRefusal

      The details (error.nexus) of a 402 budget_exceeded or subsidy_exhausted. Each money figure comes as its number (deprecated) and its exact decimal twin (requestedUsd, requestedUsdDecimal). A refusal below the person level names only what is left and what was asked, never a limit above the caller. credit_exhausted sends remainingUsd and requestedUsd as decimal strings already, without twins.

      • level"organization" | "team" | "person" | "product"

        The level whose limit refused the call (budget_exceeded)

      • periodstring

        The period the refusal counted in: 2026-10, 2026-W44 or 2026-10-21

      • resetsAtstring (date-time)

        When the period ends (UTC)

      • source"override" | "default"

        Person level only: whether the limit was set for them or is the organization's default per person

      • limitUsdnumber

        Person level only: their monthly limit. 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.

      • spentUsdnumber

        Person level only: what they spent this month. 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

        Person level only: what their calls in flight hold. 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.

      • remainingUsdnumber

        Every level, and subsidy_exhausted: what is left, 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.

      • requestedUsdnumber

        What the call may cost at most, the amount it asked to hold. Deprecated: read requestedUsdDecimal, the exact decimal string (root rule 9).

      • requestedUsdDecimalstring

        requestedUsd as an exact decimal string in US dollars with six decimals ("12.245000"), from the micro-dollars. Prefer it to requestedUsd.

      • notifiedboolean

        budget_exceeded: true once Gateway has told the refused person and the organization's owners and admins

      • fundedBystring

        subsidy_exhausted: who funds the subsidy (nexus)

      • nextarray of string

        subsidy_exhausted: what the caller can do next (billing, own_key)

403The caller may not do this: for example, the role does not have the permission (`role_required`), or the team named is not the caller's (`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.

404Nothing matches. A path parameter outside its pattern is a 404 "no such endpoint", before the credential is checked. A team named that does not exist is `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.

408The request body stopped arriving for 30 seconds, or took longer than 10 minutes in all (`request_timeout`; `nexus` holds `gap_seconds` and `total_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.

409The `Idempotency-Key` cannot run or replay: its first request still runs (`idempotency_in_progress`), was a stream (`idempotency_stream_replay`), or its answer was not kept, being over 2,000,000 bytes (`idempotency_response_not_stored`). The request does not run again.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 request body is over the operation's limit (`request_too_large`): 1,000,000 bytes, unless the operation says otherwise.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.

422The `Idempotency-Key` was used for a different request: another method, path, query or body (`idempotency_key_reused`).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.

426The `nexus` CLI that sent `x-nexus-cli-version` is older than Gateway supports (`cli_too_old`; `minimum` names the oldest it takes). A request without that header is never refused.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 provider failed the call. `upstream_auth`: it refused the provider key the call ran on (its 401), never your Nexus API key. `upstream_forbidden`: it refused this model for that key (its 403); the key may still serve other models. `upstream_billing`: the provider account behind that key is out of credit (its 402), never your Nexus budget. The message says whose key it was: your organization's own, Nexus's, or the Nexus credit's. Any other provider 5xx is a 502 with no code.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 provider's or the Gateway's own; every one may be retried. The provider's: it has no capacity now (its 529, or the 503 OpenAI documents as its overload), `upstream_overloaded`; retry after its `retry-after` when it sent one, or try another model. The Gateway's: it is at its limit of requests in flight (`overloaded`, retry after 1 s); it is stopping and takes no new request (`draining`, retry after 5 s); it stopped before the call's first event (`gateway_stopping`, send the call again: it reaches a running Gateway); or its database is busy (`database_busy`: nothing was committed, retry shortly).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

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
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`).
400model_not_supported403 `model_not_allowed` (policy, naming the level and rule), 404 `model_not_found`, 400 `model_not_supported` (coming soon); never sent upstream or reserved, recorded as a refused call
401authentication_errorNo key, or a key Gateway does not accept
402budget_exceededThe call's maximum cost is more than the budget left (`budget_exceeded`; `subsidy_exhausted` for the Nexus subsidy, or `credit_exhausted` for the organization's prepaid credits), or the organization has an unpaid Nexus invoice past its grace (`payment_past_due`). A `budget_exceeded` refusal carries `notified: true` in its details once Gateway has told the refused person and the organization's owners and admins. The details are a BudgetRefusal: each money figure with its exact decimal twin.
403role_requiredYour role does not have this permission
403model_not_allowed403 `model_not_allowed` (policy, naming the level and rule), 404 `model_not_found`, 400 `model_not_supported` (coming soon); never sent upstream or reserved, recorded as a refused call
403provider_key_requiredAny other caller with no key of its own gets 403 `provider_key_required`, never Nexus credit
404Nothing matches. A path parameter outside its pattern is a 404 "no such endpoint", before the credential is checked. A team named that does not exist is `unknown_team`.
404model_not_found403 `model_not_allowed` (policy, naming the level and rule), 404 `model_not_found`, 400 `model_not_supported` (coming soon); never sent upstream or reserved, recorded as a refused call
408The request body stopped arriving for 30 seconds, or took longer than 10 minutes in all (`request_timeout`; `nexus` holds `gap_seconds` and `total_seconds`).
409The `Idempotency-Key` cannot run or replay: its first request still runs (`idempotency_in_progress`), was a stream (`idempotency_stream_replay`), or its answer was not kept, being over 2,000,000 bytes (`idempotency_response_not_stored`). The request does not run again.
409idempotency_in_progressA request with the same Idempotency-Key is still running
409idempotency_interruptedThe first request with this Idempotency-Key was cut off and may have run in part
413The request body is over the operation's limit (`request_too_large`): 1,000,000 bytes, unless the operation says otherwise.
422The `Idempotency-Key` was used for a different request: another method, path, query or body (`idempotency_key_reused`).
422idempotency_key_reusedThe Idempotency-Key was used with a different request
426The `nexus` CLI that sent `x-nexus-cli-version` is older than Gateway supports (`cli_too_old`; `minimum` names the oldest it takes). A request without that header is never refused.
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).
429rate_limit_errorToo many requests from this key in a minute
502The provider failed the call. `upstream_auth`: it refused the provider key the call ran on (its 401), never your Nexus API key. `upstream_forbidden`: it refused this model for that key (its 403); the key may still serve other models. `upstream_billing`: the provider account behind that key is out of credit (its 402), never your Nexus budget. The message says whose key it was: your organization's own, Nexus's, or the Nexus credit's. Any other provider 5xx is a 502 with no code.
503The provider's or the Gateway's own; every one may be retried. The provider's: it has no capacity now (its 529, or the 503 OpenAI documents as its overload), `upstream_overloaded`; retry after its `retry-after` when it sent one, or try another model. The Gateway's: it is at its limit of requests in flight (`overloaded`, retry after 1 s); it is stopping and takes no new request (`draining`, retry after 5 s); it stopped before the call's first event (`gateway_stopping`, send the call again: it reaches a running Gateway); or its database is busy (`database_busy`: nothing was committed, retry shortly).

Example

curl
curl -X POST "$NEXUS_URL/v1/chat/completions" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nexus/auto",
    "messages": [
      {
        "role": "user",
        "content": "Hello"
      }
    ]
  }'
TypeScript · @nexus/kit
import { createCoreClient } from "@nexus/kit";

const core = createCoreClient({ baseUrl: process.env.NEXUS_URL!, apiKey: process.env.NEXUS_API_KEY });
const result = await core.chatCompletion({ model: "nexus/auto", messages: [{ role: "user", content: "Hello" }] });

Spend

get/v1/spend

Budget, spend and reservations, by product and capability, with recent calls. Owners and admins (spend.read_all) get the organization's figures. Everyone else gets their own calls and, in place of the organization's budget, spent and reserved, only what is left for them (remainingUsd): the least room of the organization, the caps on the team their call is charged to (x-nexus-team, else their default team) and their monthly limit, the figure the next 402 gives, with the period and resetsAt of the cap that binds it.

spend.read_ownEvery memberTry it in the API Explorer

Parameters

  • x-nexus-teamheader · string

    Members: the team (slug) the left-for-you figure is for, as for a call; you must be in it. Default: your default team. Owners and admins get the organization's figures whatever it says.

Responses

200OKapplication/json

  • budgetUsdnumber

    The organization's budget, a cap per budgetPeriod. Owners and admins only: a member gets none of budgetUsd, spentUsd, reservedUsd, budgetPeriod and periodSpentUsd. Deprecated: read budgetUsdDecimal, the exact decimal string (root rule 9).

  • budgetUsdDecimalstring

    budgetUsd as an exact decimal string in US dollars with six decimals ("12.245000"), from the micro-dollars. Prefer it to budgetUsd.

  • spentUsdnumber

    The organization's spend since it began. Owners and admins only. 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

    Held by the organization's calls in flight. Owners and admins only. 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.

  • budgetPeriod"day" | "week" | "month"

    Owners and admins only: the budget's period

  • periodSpentUsdnumber

    Owners and admins only: the spend of calls reserved in the budget's current period, what the budget counts. Deprecated: read periodSpentUsdDecimal, the exact decimal string (root rule 9).

  • periodSpentUsdDecimalstring

    periodSpentUsd as an exact decimal string in US dollars with six decimals ("12.245000"), from the micro-dollars. Prefer it to periodSpentUsd.

  • remainingUsdnumber

    Owners and admins: what the organization's budget has left this period. Everyone else: what is left for them, the least room of the organization, their team's caps and their monthly limit, as the next 402 says it. 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.

  • periodstring

    Not owners and admins: the period of the cap that binds remainingUsd (2026-10-17, 2026-W43 or 2026-10). For the organization's budget, its current period

  • resetsAtstring

    When the binding cap's period ends and remainingUsd comes back; for owners and admins, when the budget's period ends

  • scope"org" | "own"

    org: the whole organization's calls (owners and admins); own: only the caller's

  • byProductarray of object
    • productstring
    • capabilitystring
    • costUsdnumber

      Deprecated: read costUsdDecimal, the exact decimal string (root rule 9).

    • costUsdDecimalstring

      costUsd as an exact decimal string in US dollars with six decimals ("12.245000"), from the micro-dollars. Prefer it to costUsd.

    • callsinteger
  • recentarray of object

    Recent calls. fundedBy says who paid the provider (own_key, nexus_key for Nexus's own organizations, nexus_subsidy, nexus_credit for the organization's prepaid credits, or nexus_invoiced for a contract's invoice); unset on refusals, typed decisions and calls from before it was recorded. A call a Nexus subsidy paid also has fundingOrg, the organization whose stored key paid it. A call Nexus paid the provider for (nexus_key or nexus_subsidy) also has markupBps, Nexus's rate on it in basis points (500 is 5%), as it was when the call settled; costUsd stays the provider's cost. A call a Nexus subsidy paid also has subsidyMarkupBps, the rate the subsidy was charged at: the subsidy spent costUsd plus that rate. It is unset on older calls, which spent costUsd alone. An Anthropic call also has inferenceGeo (us or global), where the provider said it ran; unset on other providers and on calls from before it was recorded. Each call also names the caller's key, never its secret: keyId (a token id key_…; a module's scoped key id scoped:<product>/<capability>/smk_…, which POST /v1/auth/scoped-keys/revoke takes; an agent's link id agl_…, so a call of the agent differs from the person's own; ui; or a system caller's name) and keyKind (the audit log's actor kind: api_key, cli, ui, module, service, sandbox, operator, agent or system). Both are unset on calls from before they were recorded: an unknown key Each call's costUsd, and its overspendPrevented.limitUsd and overUsd, also come as exact decimal strings: costUsdDecimal, limitUsdDecimal and overUsdDecimal. The numbers are deprecated.

  • subsidizedUsdnumber

    Organizations with a Nexus subsidy: what calls the subsidy paid cost the subsidy, each at its provider cost plus Nexus's rate (in your scope: a member gets what it paid for their own calls). Deprecated: read subsidizedUsdDecimal, the exact decimal string (root rule 9).

  • subsidizedUsdDecimalstring

    subsidizedUsd as an exact decimal string in US dollars with six decimals ("12.245000"), from the micro-dollars. Prefer it to subsidizedUsd.

  • subsidyobject

    Owners and admins only: the organization's Nexus subsidy (a personal organization's starting credit), funded by Nexus, never the organization's own money. A member's answer has none of it

    • grantedUsdnumber

      Deprecated: read grantedUsdDecimal, the exact decimal string (root rule 9).

    • grantedUsdDecimalstring

      grantedUsd as an exact decimal string in US dollars with six decimals ("12.245000"), from the micro-dollars. Prefer it to grantedUsd.

    • spentUsdnumber

      What settled calls cost the subsidy: each call's provider cost plus Nexus's rate, as for credits. 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

      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.

    • remainingUsdnumber

      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.

    • expiredUsdnumber

      What was left of the free start when it expired, 30 days after its grant (pricing v2.0). Absent before. Deprecated: read expiredUsdDecimal, the exact decimal string (root rule 9).

    • expiredUsdDecimalstring

      expiredUsd as an exact decimal string in US dollars with six decimals ("12.245000"), from the micro-dollars. Prefer it to expiredUsd.

    • fundedBy"nexus"
    • usableForModelCallsboolean

      Whether this Gateway pays a Nexus feature's model calls (chat sessions, module runs; never raw model access) of an organization with no key of its own from the subsidy (NEXUS_CREDIT_PROVIDER, and NEXUS_SUBSIDY_ORG's stored keys or a subsidy environment key)

  • subsidiesPaidobject

    The funding organization (NEXUS_SUBSIDY_ORG), owners and admins: what its stored provider keys paid for other organizations' subsidized calls. Never part of its own spend, budget or limits

    • usdnumber

      Deprecated: read usdDecimal, the exact decimal string (root rule 9).

    • usdDecimalstring

      usd as an exact decimal string in US dollars with six decimals ("12.245000"), from the micro-dollars. Prefer it to usd.

    • callsinteger
    • organizationsinteger
  • creditsobject

    Owners and admins: the organization's prepaid Nexus credits, its own money, never expiring, once it bought some. A Nexus feature's call spends them after the subsidy, 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 in basis points (500 is 5%).

  • payAfterTheFactboolean

    Owners and admins (pricing v2.0): the organization pays after the fact, so calls the free start and the credits cannot pay still run on its card.

  • nexusPaysobject

    Every member: whether Nexus can pay for the organization's next model call, and why not. It reads the payers in the ledger's order: a contract, the free start, other Nexus grants, the credits, then the card when it pays after the fact; an unpaid invoice past its grace stops all of them. It answers for a small call to a model the free start pays for, so a pricier model or a larger call can still be refused. Absent where Nexus pays for no model calls on this Gateway.

    • paysbooleanrequired
    • payer"contract" | "free_start" | "subsidy" | "credits" | "card" | nullrequired

      Who pays the next call; null when pays is false

    • reason"free_start_used_up" | "free_start_expired" | "credits_out" | "usage_limit_reached" | "charge_failed" | "card_needs_confirming" | "card_disputed" | "past_due" | "billing_off" | "charge_processing" | nullrequired

      Why Nexus cannot pay; null when pays is true. billing_off: nothing was set up to pay (no free start, no credits, and the card does not pay after the fact). card_disputed: a payment on the card was disputed, and only another card pays. past_due comes first, also under a contract. A balance under a cent does not count as paying.

    • changesAtstring (date-time) | nullrequired

      The next time this changes by itself: the free start's deadline while it pays, or the next month while the usage limit is reached; else null

    • limitUsedPercentinteger | null

      While the card pays: how much of this UTC month's usage limit it paid, in whole percent, rounded down. Null while another payer pays, or nobody, and always null for a caller who sees only their own spend: only billing managers see it. Absent from an older Gateway.

      min 0 · max 100

403A member who names a team they are not in with `x-nexus-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.

404A member names, with `x-nexus-team`, a team that does not exist in the organization (`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

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
402periodThe least room of the organization, the caps on the team their call is charged to (`x-nexus-team`, else their default team) and their monthly limit, the figure the next 402 gives, with the `period` and `resetsAt` of the cap that binds it
403role_requiredYour role does not have this permission
404A member names, with `x-nexus-team`, a team that does not exist in the organization (`unknown_team`)
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/spend" \
  -H "Authorization: Bearer $NEXUS_API_KEY"
TypeScript · @nexus/kit
import { createCoreClient } from "@nexus/kit";

const core = createCoreClient({ baseUrl: process.env.NEXUS_URL!, apiKey: process.env.NEXUS_API_KEY });
const result = await core.spend();

List spend calls

get/v1/spend/calls

One page of the organization's model calls, newest first, with the filters below (owners and admins). People and teams by id only. A bad filter or a range over 366 days is a 400. One request reads at most 10,000 calls, so a narrow filter can answer a short page, even an empty one, with a nextCursor that resumes the scan.

spend.read_allOwner, AdminTry it in the API Explorer

Parameters

  • fromquery · string (date)

    The first UTC day, YYYY-MM-DD; default 29 days before to

  • toquery · string (date)

    The last UTC day, YYYY-MM-DD, included; default today. A range covers at most 366 days

  • teamquery · string

    A team slug or id: that team and every team under it; unassigned for calls with no team

  • personquery · string

    A person's user id

  • modelquery · string

    A model, as the rows name it; - for the calls with none (released calls), as Analytics groups them

  • providerquery · string

    A provider, as the rows name it; - for the calls with none (refused and released calls), as Analytics groups them

  • productquery · string

    A product (agents) or a product and capability (intelligence/wiki): Analytics' group key

  • statusquery · string

    A comma-separated set of settled, failed, refused and released; default all four

  • sessionquery · string

    An agent session id or a chat session id: the calls attributed to it

  • limitquery · integer

    Calls per page, 1 to 500 (default 50)

  • cursorquery · string

    nextCursor from the previous page. It is bound to the organization, the caller and the query: anywhere else it is a 400 invalid_cursor

Responses

200OKapplication/json

  • fromstring (date)required

    The first UTC day the page covers.

  • tostring (date)required

    The last UTC day the page covers, included.

  • callsarray of SpendCallrequired
    • idstringrequired

      The call's record id.

    • atstring (date-time)required

      When the ledger recorded the call.

    • status"settled" | "failed" | "refused" | "released"required

      settled, failed, refused (Nexus Gateway refused it, and no money moved) or released (its reservation closed without a settle, by a job's cleanup or the ledger's age sweep).

    • modelstring | nullrequired

      The model the call asked for; null for a released call, whose model the ledger did not record.

    • providerstring | nullrequired

      The provider that served it; null for a refused or released call, which no provider served.

    • productstringrequired

      The product it is metered to: core for direct API calls, agents, chat or a module.

    • capabilitystring | nullrequired

      The module's capability, such as wiki.

    • userIdstring | nullrequired

      The person who made the call.

    • teamIdstring | nullrequired

      The team the call was attributed to; null for none (unassigned).

    • agentSessionIdstring | nullrequired

      The coding-agent session the call belongs to.

    • chatSessionIdstring | nullrequired

      The chat session the call belongs to (metadata only, never its content).

    • inputTokensinteger | nullrequired

      Prompt tokens, as the ledger charged them; null for a released call, whose tokens nobody reported.

    • outputTokensinteger | nullrequired

      Completion tokens, as the ledger charged them; null for a released call.

    • costUsdstringrequired

      What the call was charged.

      pattern ^-?[0-9]+\.[0-9]{6}$

    • reservedUsdstring | nullrequired

      What Nexus Gateway held for the call before it ran.

      pattern ^-?[0-9]+\.[0-9]{6}$

    • reasonstring | nullrequired

      The ledger's note on the call, with any secret redacted: why it was refused, failed or released, or what it charged past its hold.

    • overspendLevel"organization" | "team" | "person" | "product" | nullrequired

      The spend limit that refused the call.

    • overspendLimitUsdstring | nullrequired

      The person's limit, when a person's limit refused the call. Null for a team's cap and the organization's budget: the ledger does not keep their limit on the call.

      pattern ^-?[0-9]+\.[0-9]{6}$

    • overspendAmountUsdstring | nullrequired

      What the refused call asked to hold.

      pattern ^-?[0-9]+\.[0-9]{6}$

    • overspendOverUsdstring | nullrequired

      How far over the limit it would have gone.

      pattern ^-?[0-9]+\.[0-9]{6}$

    • overspendPeriodstring | nullrequired

      The limit's period (2026-10, 2026-W43 or 2026-10-23).

    • fundedBystring | nullrequired

      nexus_subsidy for a call a Nexus subsidy paid, nexus_credit for one the organization's prepaid credits paid; null for the organization's own.

  • nextCursorstring | nullrequired

    Pass as cursor for the next, older page; null on the last page.

400A filter Nexus cannot read: a date not YYYY-MM-DD, `from` after `to` or a range past 366 days, a `limit` outside 1 to 500 or an unknown `status` (`invalid_request`), a team that does not exist (`unknown_team`), or a cursor issued for another caller or query (`invalid_cursor`)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 list the organization's calls (`role_required`): a member without `spend.read_all`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

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
400A filter Nexus cannot read: a date not YYYY-MM-DD, `from` after `to` or a range past 366 days, a `limit` outside 1 to 500 or an unknown `status` (`invalid_request`), a team that does not exist (`unknown_team`), or a cursor issued for another caller or query (`invalid_cursor`)
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/spend/calls" \
  -H "Authorization: Bearer $NEXUS_API_KEY"
TypeScript · @nexus/kit
import { createCoreClient } from "@nexus/kit";

const core = createCoreClient({ baseUrl: process.env.NEXUS_URL!, apiKey: process.env.NEXUS_API_KEY });
const result = await core.spendCalls({ from: "2026-10-01", status: "failed,refused" });

Get spend call

get/v1/spend/calls/{id}

One of the organization's model calls, as its row in the files: what was reserved, what was charged and why it was refused (owners and admins). Another organization's call reads as missing: 404 unknown_call.

spend.read_allOwner, AdminTry it in the API Explorer

Parameters

  • idpath · stringrequired

    The call's record id

Responses

200OKapplication/json

  • idstringrequired

    The call's record id.

  • atstring (date-time)required

    When the ledger recorded the call.

  • status"settled" | "failed" | "refused" | "released"required

    settled, failed, refused (Nexus Gateway refused it, and no money moved) or released (its reservation closed without a settle, by a job's cleanup or the ledger's age sweep).

  • modelstring | nullrequired

    The model the call asked for; null for a released call, whose model the ledger did not record.

  • providerstring | nullrequired

    The provider that served it; null for a refused or released call, which no provider served.

  • productstringrequired

    The product it is metered to: core for direct API calls, agents, chat or a module.

  • capabilitystring | nullrequired

    The module's capability, such as wiki.

  • userIdstring | nullrequired

    The person who made the call.

  • teamIdstring | nullrequired

    The team the call was attributed to; null for none (unassigned).

  • agentSessionIdstring | nullrequired

    The coding-agent session the call belongs to.

  • chatSessionIdstring | nullrequired

    The chat session the call belongs to (metadata only, never its content).

  • inputTokensinteger | nullrequired

    Prompt tokens, as the ledger charged them; null for a released call, whose tokens nobody reported.

  • outputTokensinteger | nullrequired

    Completion tokens, as the ledger charged them; null for a released call.

  • costUsdstringrequired

    What the call was charged.

    pattern ^-?[0-9]+\.[0-9]{6}$

  • reservedUsdstring | nullrequired

    What Nexus Gateway held for the call before it ran.

    pattern ^-?[0-9]+\.[0-9]{6}$

  • reasonstring | nullrequired

    The ledger's note on the call, with any secret redacted: why it was refused, failed or released, or what it charged past its hold.

  • overspendLevel"organization" | "team" | "person" | "product" | nullrequired

    The spend limit that refused the call.

  • overspendLimitUsdstring | nullrequired

    The person's limit, when a person's limit refused the call. Null for a team's cap and the organization's budget: the ledger does not keep their limit on the call.

    pattern ^-?[0-9]+\.[0-9]{6}$

  • overspendAmountUsdstring | nullrequired

    What the refused call asked to hold.

    pattern ^-?[0-9]+\.[0-9]{6}$

  • overspendOverUsdstring | nullrequired

    How far over the limit it would have gone.

    pattern ^-?[0-9]+\.[0-9]{6}$

  • overspendPeriodstring | nullrequired

    The limit's period (2026-10, 2026-W43 or 2026-10-23).

  • fundedBystring | nullrequired

    nexus_subsidy for a call a Nexus subsidy paid, nexus_credit for one the organization's prepaid credits paid; null for the organization's own.

403Only owners and admins read the organization's calls (`role_required`): a member without `spend.read_all`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 call with this id in the caller's organization (`unknown_call`); another organization's call reads as 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.

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

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
404not_foundNothing matches the path in your organization
404No call with this id in the caller's organization (`unknown_call`); another organization's call reads as missing
404unknown_call404 `unknown_call`
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/spend/calls/<id>" \
  -H "Authorization: Bearer $NEXUS_API_KEY"
TypeScript · @nexus/kit
import { createCoreClient } from "@nexus/kit";

const core = createCoreClient({ baseUrl: process.env.NEXUS_URL!, apiKey: process.env.NEXUS_API_KEY });
const result = await core.spendCall("<call id>");

Export spend calls CSV

get/v1/spend/calls/export.csv

Every model call of the organization that matches the filters, newest first, as CSV (owners and admins): the rows listSpendCalls pages through, with its filters. A series of files reads the calls written up to the newest one when its first file started. At most 100,000 rows a file: past that the file stops, and its manifest says complete: false and gives nextCursor. Each export is an audit event (observability.exported) with the file's manifest, never its rows. An organization runs at most 60 exports an hour: the 61st is a 429 export_rate_limited, whose Retry-After is the seconds until the hour frees one (the RateLimit-* headers stay the per-minute limit's). A bad filter is a 400 before any row.

spend.exportOwner, AdminTry it in the API Explorer

Parameters

  • fromquery · string (date)

    The first UTC day, YYYY-MM-DD; default 29 days before to

  • toquery · string (date)

    The last UTC day, YYYY-MM-DD, included; default today. A range covers at most 366 days

  • teamquery · string

    A team slug or id: that team and every team under it; unassigned for calls with no team

  • personquery · string

    A person's user id

  • modelquery · string

    A model, as the rows name it; - for the calls with none (released calls), as Analytics groups them

  • providerquery · string

    A provider, as the rows name it; - for the calls with none (refused and released calls), as Analytics groups them

  • productquery · string

    A product (agents) or a product and capability (intelligence/wiki): Analytics' group key

  • statusquery · string

    A comma-separated set of settled, failed, refused and released; default all four

  • sessionquery · string

    An agent session id or a chat session id: the calls attributed to it

  • cursorquery · string

    A cut file's manifest.nextCursor: the next file of the same query. A manifest's watermark also works: it starts the same series again. It is bound to the organization, the caller and the query: anywhere else it is a 400 invalid_cursor

Responses

200CSV with a header row: one column per field of `SpendCall`, in its order.text/csv

string

400A filter Nexus cannot read: a date not YYYY-MM-DD, `from` after `to` or a range past 366 days, or an unknown `status` (`invalid_request`), a team that does not exist (`unknown_team`), or a cursor issued for another caller or query (`invalid_cursor`)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 export the organization's calls (`role_required`): a member without `spend.export`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

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
400A filter Nexus cannot read: a date not YYYY-MM-DD, `from` after `to` or a range past 366 days, or an unknown `status` (`invalid_request`), a team that does not exist (`unknown_team`), or a cursor issued for another caller or query (`invalid_cursor`)
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
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).
429export_rate_limitedThe 61st is a 429 `export_rate_limited`, whose `Retry-After` is the seconds until the hour frees one (the `RateLimit-*` headers stay the per-minute limit's)
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/spend/calls/export.csv" \
  -H "Authorization: Bearer $NEXUS_API_KEY"
TypeScript · @nexus/kit
import { createCoreClient } from "@nexus/kit";

const core = createCoreClient({ baseUrl: process.env.NEXUS_URL!, apiKey: process.env.NEXUS_API_KEY });
const result = await core.spendCallsExport("csv", { from: "2026-10-01" });

Export spend calls JSON Lines

get/v1/spend/calls/export.jsonl

Every model call of the organization that matches the filters, newest first, as JSON Lines (owners and admins): the rows listSpendCalls pages through, with its filters. A series of files reads the calls written up to the newest one when its first file started. At most 100,000 rows a file: past that the file stops, and its manifest says complete: false and gives nextCursor. Each export is an audit event (observability.exported) with the file's manifest, never its rows. An organization runs at most 60 exports an hour: the 61st is a 429 export_rate_limited, whose Retry-After is the seconds until the hour frees one (the RateLimit-* headers stay the per-minute limit's). A bad filter is a 400 before any row.

spend.exportOwner, AdminTry it in the API Explorer

Parameters

  • fromquery · string (date)

    The first UTC day, YYYY-MM-DD; default 29 days before to

  • toquery · string (date)

    The last UTC day, YYYY-MM-DD, included; default today. A range covers at most 366 days

  • teamquery · string

    A team slug or id: that team and every team under it; unassigned for calls with no team

  • personquery · string

    A person's user id

  • modelquery · string

    A model, as the rows name it; - for the calls with none (released calls), as Analytics groups them

  • providerquery · string

    A provider, as the rows name it; - for the calls with none (refused and released calls), as Analytics groups them

  • productquery · string

    A product (agents) or a product and capability (intelligence/wiki): Analytics' group key

  • statusquery · string

    A comma-separated set of settled, failed, refused and released; default all four

  • sessionquery · string

    An agent session id or a chat session id: the calls attributed to it

  • cursorquery · string

    A cut file's manifest.nextCursor: the next file of the same query. A manifest's watermark also works: it starts the same series again. It is bound to the organization, the caller and the query: anywhere else it is a 400 invalid_cursor

Responses

200JSON Lines: one `SpendCall` per line, then one line `{"manifest": ExportManifest}`.application/jsonl

string

400A filter Nexus cannot read: a date not YYYY-MM-DD, `from` after `to` or a range past 366 days, or an unknown `status` (`invalid_request`), a team that does not exist (`unknown_team`), or a cursor issued for another caller or query (`invalid_cursor`)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 export the organization's calls (`role_required`): a member without `spend.export`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

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
400A filter Nexus cannot read: a date not YYYY-MM-DD, `from` after `to` or a range past 366 days, or an unknown `status` (`invalid_request`), a team that does not exist (`unknown_team`), or a cursor issued for another caller or query (`invalid_cursor`)
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
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).
429export_rate_limitedThe 61st is a 429 `export_rate_limited`, whose `Retry-After` is the seconds until the hour frees one (the `RateLimit-*` headers stay the per-minute limit's)
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/spend/calls/export.jsonl" \
  -H "Authorization: Bearer $NEXUS_API_KEY"
TypeScript · @nexus/kit
import { createCoreClient } from "@nexus/kit";

const core = createCoreClient({ baseUrl: process.env.NEXUS_URL!, apiKey: process.env.NEXUS_API_KEY });
const result = await core.spendCallsExport("jsonl", { from: "2026-10-01" });

Modules

get/v1/modules

Manifests of the registered capability modules.

org.readEvery memberTry it in the API Explorer

Responses

200OKapplication/json

  • modulesarray of ModuleManifest
    • productobject
      • slugstring
      • namestring
    • capabilityobject
      • slugstring
      • namestring
      • descriptionstring
    • verbsarray of "connect" | "run" | "report" | "apply" | "watch"
    • inputsarray of object
    • panelobject
      • kindstring
    • operationsobject
  • unavailablearray of object
    • urlstring
    • errorstring

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

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/modules" \
  -H "Authorization: Bearer $NEXUS_API_KEY"
TypeScript · @nexus/kit
import { createCoreClient } from "@nexus/kit";

const core = createCoreClient({ baseUrl: process.env.NEXUS_URL!, apiKey: process.env.NEXUS_API_KEY });
const result = await core.modules();

Openapi

get/v1/openapi.json

This document, merged with every registered module's operations.

publicAnyone, signed in or notTry it in the API Explorer

Responses

200OpenAPI 3.1 document

Errors

StatusCodeWhen

Example

curl
curl "$NEXUS_URL/v1/openapi.json"
TypeScript · @nexus/kit
import { createCoreClient } from "@nexus/kit";

const core = createCoreClient({ baseUrl: process.env.NEXUS_URL!, apiKey: process.env.NEXUS_API_KEY });
const result = await core.openapi();

Healthz

get/healthz

Liveness: the process answers. It reads no database, and it stays 200 while Gateway drains.

publicAnyone, signed in or notTry it in the API Explorer

Responses

200The process is alive.application/json

  • status"ok"required
  • implementation"rust"required

    The gateway that answered.

  • versionstringrequired

    The Factory release this binary is (info.version of this document).

  • edition"licensed" | "open"required

    The build: licensed, or open for the open gateway (no licensed code; those routes answer 501 licensed).

  • provider"live" | "mock"required

    NEXUS_PROVIDER: live calls the providers; mock answers every chat and module model call with canned text.

  • agentProvider"live" | "mock"required

    NEXUS_AGENT_PROVIDER: the same for the agent gateway's pass-through.

  • catalogFingerprintstring | nullrequired

    The SHA-256 of the catalog file this process loaded (NEXUS_CATALOG_FILE), in hex, as sha256sum prints it; null when no file is set. Processes with the same value run the same catalog.

  • simSeedstring

    Local simulations only: the installed NEXUS_SIM_SEED, as a string. Absent everywhere else.

Errors

StatusCodeWhen

Example

curl
curl "$NEXUS_URL/healthz"

Readyz

get/readyz

Readiness: whether to send this process traffic (ready, degraded, draining or unavailable).

publicAnyone, signed in or notTry it in the API Explorer

Responses

200Send traffic: `ready`, or `degraded` with its reasons.application/json

object | object

503Send no traffic: Gateway is stopping (`draining`), or the database ping failed (`database`) or did not answer in time (`database_timeout`).application/json

object | object

Errors

StatusCodeWhen
503Send no traffic: Gateway is stopping (`draining`), or the database ping failed (`database`) or did not answer in time (`database_timeout`).

Example

curl
curl "$NEXUS_URL/readyz"

Cli version

get/cli/version

The nexus CLI this Gateway serves: its version, SHA-256, download URL and the oldest CLI Gateway talks to.

publicAnyone, signed in or notTry it in the API Explorer

Parameters

  • targetquery · string

    A platform, <os>-<arch>: lowercase letters and digits, 16 at most each.

Responses

200The build to install. `target` is present only when the request named one.application/json

  • versionstringrequired
  • sha256stringrequired

    pattern ^[0-9a-f]{64}$

  • urlstring (uri)required

    Where to download it, on this Gateway's public URL.

  • minimumstringrequired

    NEXUS_CLI_MINIMUM: an older CLI gets 426 cli_too_old on /v1.

  • targetstring

    The platform asked for.

404`cli_target_unavailable`: this Gateway publishes no native build for `target`.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.

405Not GET or HEAD.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`cli_bundle_unavailable` (`server_error`): no `target`, and no CLI bundle is built on this Gateway. Also `overloaded` or `draining`, as every route outside the health checks.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

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
404`cli_target_unavailable`: this Gateway publishes no native build for `target`.
405Not GET or HEAD.
503`cli_bundle_unavailable` (`server_error`): no `target`, and no CLI bundle is built on this Gateway. Also `overloaded` or `draining`, as every route outside the health checks.

Example

curl
curl "$NEXUS_URL/cli/version"

Stripe webhook

post/v1/stripe/webhook

Stripe's webhook, signed by Stripe with STRIPE_WEBHOOK_SECRET (the Stripe-Signature header, t=<unix>,v1=<hex>; refused more than five minutes from now). Gateway keeps the verified event's identity once in an inbox and nothing else: a repeated delivery changes nothing, and an event whose livemode differs from the key's is kept as ignored. After it answers, Gateway reads the event's object again from Stripe and updates the organization's card on file (GET /v1/billing). A signed event Gateway cannot keep (a thin event, no id) is a 200 with stored: false, so Stripe does not retry it. An event that stopped (unmatched, or failed on its last try) runs again when Stripe sends it again, with all its tries. 400 for a body that is not JSON; 401 invalid_signature for a bad or old signature; 413 over 1 MB; 503 not_configured until STRIPE_SECRET_KEY and STRIPE_WEBHOOK_SECRET are both set and well formed. The 503's message says only that Stripe is not configured; Gateway logs the reason at start.

publicAnyone, signed in or notTry it in the API Explorer

Responses

200OKapplication/json

  • okbooleanrequired
  • eventstring | nullrequired

    The event's type. Null when the signed event has no string type (or the body is not a JSON object); Stripe's own events always have one.

  • storedbooleanrequired

    True when this delivery added a row to process. False for a repeat that changes nothing. False too for a resend of a stopped (dead) or unmatched event: no row is added, but the event runs again from its first try. False for an event whose livemode differs from the key's: it is kept as ignored and never processed.

400Not JSON (`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.

401The signature is bad or too old (`invalid_signature`)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.

413Over 1 MBapplication/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

StatusCodeWhen
400Not JSON (`invalid_request_error`)
401invalid_signature400 for a body that is not JSON; 401 `invalid_signature` for a bad or old signature; 413 over 1 MB; 503 `not_configured` until STRIPE_SECRET_KEY and STRIPE_WEBHOOK_SECRET are both set and well formed
413Over 1 MB
503Stripe is not configured (`not_configured`)
503not_configured400 for a body that is not JSON; 401 `invalid_signature` for a bad or old signature; 413 over 1 MB; 503 `not_configured` until STRIPE_SECRET_KEY and STRIPE_WEBHOOK_SECRET are both set and well formed

Example

curl
curl -X POST "$NEXUS_URL/v1/stripe/webhook"
get/v1/search

Search what you may read, grouped by type and ranked: your own chat sessions (titles and message text), artifacts shared with or by you, people, teams, models and model policies.

search.useEvery memberTry it in the API Explorer

Parameters

  • qquery · stringrequired

    What to search for, 1 to 200 characters. Words match as prefixes (depl finds deploy)

  • typesquery · string

    Comma-separated: chats, artifacts, people, teams, models (default: all you may read). actions and pages are accepted and ignored: the palette answers them itself

  • limitquery · integer

    Results per group, 1 to 20 (default 5)

Responses

200OKapplication/json

  • querystringrequired
  • typesarray of stringrequired

    The types searched: those asked for that your role may read

  • groupsarray of SearchGrouprequired

    Groups with results, best first

    • typestringrequired
    • labelstringrequired
    • resultsarray of SearchResultrequired
      • type"chats" | "artifacts" | "people" | "teams" | "models"required
      • entity"session" | "artifact" | "member" | "invitation" | "team" | "model" | "policy"required
      • idstringrequired
      • titlestringrequired
      • titleMatchesarray of array of integerrequired

        Ranges of title that matched (UTF-16)

      • subtitlestring
      • snippetSearchSnippet
        • textstringrequired

          An excerpt; … where cut

        • matchesarray of array of integerrequired

          [start, end) ranges of text that matched, in UTF-16 code units

      • urlstringrequired

        Nexus UI's page for it, under the organization's slug: /app/<org>/sessions/<id> (a chat message match ends in #m-<message id>)

      • scorenumberrequired

        min 0 · max 1

      • messageIdstring

        Chats: the message that matched

    • morebooleanrequired

      More matched than limit

  • tookMsnumberrequired

    The server's time for the search

400A query parameter is not valid (`invalid_search`): `q` empty or over 200 characters, an unknown type in `types`, or `limit` not 1 to 20.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.

401No credential (`missing_credential`), or a credential Gateway does not accept (`invalid_credential`).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.

403The key does not hold `search.use` (`role_required`: a service account, a sandbox, or an agent not granted it), or the caller is not a person, such as a module key (`person_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.

Errors

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
400A query parameter is not valid (`invalid_search`): `q` empty or over 200 characters, an unknown type in `types`, or `limit` not 1 to 20.
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/search?q=%3Cq%3E" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Decisions

post/v1/decisions

Typed decisions: a batch of requests to a decision model (TypeSafe's Jev), each a state and its questions, answered with typed judgments and probabilities, never text. Metered as one model call: one model policy decision on the decisions surface, one reservation of the batch's maximum cost, one settlement on the summed reported input tokens, one spend record. Only decision models serve it, and nexus/auto does not resolve here.

models.useEvery member, module keysTry it in the API Explorer

Parameters

  • x-nexus-teamheader · string

    The team (slug) this batch's spend goes to; you must be in it. Default: your default team.

  • Idempotency-Keyheader · string

    Send the same key again to retry safely: the request runs once. See Idempotency keys.

Request body · application/json

  • modelstringrequired

    A decision model: typesafe/jev

  • requestsarray of objectrequired

    at most 100 items

    • statestring | object | array of anyrequired

      What the questions are about: a string, an object or an array

    • questionsobjectrequired

      { <name>: { type, instructions, criteria } }, passed through: choice (criteria: 1 to 255 options), score (an ordered list of 1 to 10 levels), noul (a yes/no probability; criteria optional)

  • teamstring

    The team (slug), as x-nexus-team

Responses

200OKapplication/json

  • modelstringrequired

    The canonical model that answered

  • resultsarray of object | objectrequired

    One per request, in order

  • nexusobjectrequired
    • cost_usdnumberrequired

      What the batch cost the organization

    • input_tokensintegerrequired

      The input tokens charged, summed

    • notesarray of string

      What the caller should know about the answer; absent when there is none. When the batch's settlement failed, a note says the charge is not confirmed: cost_usd is then the Gateway's computed charge, not a ledger record.

402The organization has nothing to pay the batch with (`subsidy_exhausted`, the shape a model call returns), the batch's maximum cost is more than the budget left (`budget_exceeded`), or the organization has an unpaid Nexus invoice past its grace (`payment_past_due`). A `budget_exceeded` refusal carries `notified: true` in its details once Gateway has told the refused person and the organization's owners and admins. The details are a BudgetRefusal: each money figure with its exact decimal twin.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.

  • errorobject
    • nexusBudgetRefusal

      The details (error.nexus) of a 402 budget_exceeded or subsidy_exhausted. Each money figure comes as its number (deprecated) and its exact decimal twin (requestedUsd, requestedUsdDecimal). A refusal below the person level names only what is left and what was asked, never a limit above the caller. credit_exhausted sends remainingUsd and requestedUsd as decimal strings already, without twins.

      • level"organization" | "team" | "person" | "product"

        The level whose limit refused the call (budget_exceeded)

      • periodstring

        The period the refusal counted in: 2026-10, 2026-W44 or 2026-10-21

      • resetsAtstring (date-time)

        When the period ends (UTC)

      • source"override" | "default"

        Person level only: whether the limit was set for them or is the organization's default per person

      • limitUsdnumber

        Person level only: their monthly limit. 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.

      • spentUsdnumber

        Person level only: what they spent this month. 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

        Person level only: what their calls in flight hold. 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.

      • remainingUsdnumber

        Every level, and subsidy_exhausted: what is left, 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.

      • requestedUsdnumber

        What the call may cost at most, the amount it asked to hold. Deprecated: read requestedUsdDecimal, the exact decimal string (root rule 9).

      • requestedUsdDecimalstring

        requestedUsd as an exact decimal string in US dollars with six decimals ("12.245000"), from the micro-dollars. Prefer it to requestedUsd.

      • notifiedboolean

        budget_exceeded: true once Gateway has told the refused person and the organization's owners and admins

      • fundedBystring

        subsidy_exhausted: who funds the subsidy (nexus)

      • nextarray of string

        subsidy_exhausted: what the caller can do next (billing, own_key)

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

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
401authentication_errorNo key, or a key Gateway does not accept
402budget_exceededThe organization has nothing to pay the batch with (`subsidy_exhausted`, the shape a model call returns), the batch's maximum cost is more than the budget left (`budget_exceeded`), or the organization has an unpaid Nexus invoice past its grace (`payment_past_due`). A `budget_exceeded` refusal carries `notified: true` in its details once Gateway has told the refused person and the organization's owners and admins. The details are a BudgetRefusal: each money figure with its exact decimal twin.
403role_requiredYour role does not have this permission
409idempotency_in_progressA request with the same Idempotency-Key is still running
409idempotency_interruptedThe first request with this Idempotency-Key was cut off and may have run in part
422idempotency_key_reusedThe Idempotency-Key was used with a different request
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/decisions" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "<model>",
    "requests": [
      {
        "state": "…",
        "questions": {}
      }
    ]
  }'

List notifications

get/v1/notifications

Your inbox in this organization: items not yet done, newest first, 50 a page.

notifications.useEvery memberTry it in the API Explorer

Parameters

  • cursorquery · string

    A nextCursor this list returned

  • unreadquery · boolean

    Only items not yet read

  • groupquery · "my_sessions" | "usage_and_billing" | "requests_and_approvals" | "automations_and_integrations" | "account_and_security"

    Only this group's kinds

Responses

200OKapplication/json

  • itemsarray of NotificationItemrequired
    • idstringrequired

      ntf_…

    • kindstringrequired

      The kind's stable name, as GET /v1/notifications/kinds lists it

    • group"my_sessions" | "usage_and_billing" | "requests_and_approvals" | "automations_and_integrations" | "account_and_security"required
    • subjectTextstringrequired

      The kind's fixed text

    • titlestring

      A month report's summary, from its figures only: the month and the total. Absent for other kinds

    • detailstring

      A month report's second line, from its figures only: the calls. Absent for other kinds

    • subjectNotificationSubjectrequired
      • type"organization" | "team" | "user" | "artifact"required
      • idstringrequired
    • sourcesarray of NotificationSourcerequired

      at most 20 items

    • countintegerrequired

      The events this item collapses; it can pass the 20 sources kept

      min 1

    • readAtstring (date-time)
    • doneAtstring (date-time)
    • createdAtstring (date-time)required
    • updatedAtstring (date-time)required
  • nextCursorstring

    Pass as cursor for the next page; absent on the last

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

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/notifications" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Read notification

post/v1/notifications/{id}/read

Mark your item read. Not yours, or the audience rule no longer gives it to you: 404.

notifications.useEvery memberTry it in the API Explorer

Parameters

  • idpath · stringrequired

    The item's id (ntf_…)

Responses

200OKapplication/json

  • idstringrequired

    ntf_…

  • kindstringrequired

    The kind's stable name, as GET /v1/notifications/kinds lists it

  • group"my_sessions" | "usage_and_billing" | "requests_and_approvals" | "automations_and_integrations" | "account_and_security"required
  • subjectTextstringrequired

    The kind's fixed text

  • titlestring

    A month report's summary, from its figures only: the month and the total. Absent for other kinds

  • detailstring

    A month report's second line, from its figures only: the calls. Absent for other kinds

  • subjectNotificationSubjectrequired
    • type"organization" | "team" | "user" | "artifact"required
    • idstringrequired
  • sourcesarray of NotificationSourcerequired

    at most 20 items

  • countintegerrequired

    The events this item collapses; it can pass the 20 sources kept

    min 1

  • readAtstring (date-time)
  • doneAtstring (date-time)
  • createdAtstring (date-time)required
  • updatedAtstring (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

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
404not_foundNothing matches the path in your organization
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/notifications/<id>/read" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Done notification

post/v1/notifications/{id}/done

Mark your item done (and read): it leaves the list. Not yours, or the audience rule no longer gives it to you: 404.

notifications.useEvery memberTry it in the API Explorer

Parameters

  • idpath · stringrequired

    The item's id (ntf_…)

Responses

200OKapplication/json

  • idstringrequired

    ntf_…

  • kindstringrequired

    The kind's stable name, as GET /v1/notifications/kinds lists it

  • group"my_sessions" | "usage_and_billing" | "requests_and_approvals" | "automations_and_integrations" | "account_and_security"required
  • subjectTextstringrequired

    The kind's fixed text

  • titlestring

    A month report's summary, from its figures only: the month and the total. Absent for other kinds

  • detailstring

    A month report's second line, from its figures only: the calls. Absent for other kinds

  • subjectNotificationSubjectrequired
    • type"organization" | "team" | "user" | "artifact"required
    • idstringrequired
  • sourcesarray of NotificationSourcerequired

    at most 20 items

  • countintegerrequired

    The events this item collapses; it can pass the 20 sources kept

    min 1

  • readAtstring (date-time)
  • doneAtstring (date-time)
  • createdAtstring (date-time)required
  • updatedAtstring (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

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
404not_foundNothing matches the path in your organization
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/notifications/<id>/done" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

List notification kinds

get/v1/notifications/kinds

The notification catalogue: each kind's name, group, fixed text, whether it is required, and its default channels.

notifications.useEvery memberTry it in the API Explorer

Responses

200OKapplication/json

  • kindsarray of NotificationKindrequired
    • namestringrequired
    • group"my_sessions" | "usage_and_billing" | "requests_and_approvals" | "automations_and_integrations" | "account_and_security"required
    • subjectTextstringrequired
    • requiredbooleanrequired

      A required kind can move between channels but never be muted

    • defaultsarray of "inbox" | "email" | "push"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

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/notifications/kinds" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Get growth activation

get/v1/growth/activation

When your organization first reached each value, computed on read (Growth Capabilities): activation through Gateway (the first agent session), through Nexus Wiki (the first Wiki run on a repository the organization links now; a repository unlinked since no longer counts), and the first settled model call, each with its minutes after sign-up. exact is false when older records were pruned or not listed, so the true first may be earlier. The Wiki row reads the Wiki module; when it is missing (wiki_not_configured) or fails (wiki_unavailable), that row carries error and the answer stays 200. Nothing here writes, and no person is named.

growth.readOwner, AdminTry it in the API Explorer

Responses

200OKapplication/json

  • tenantIdstringrequired
  • mark"staff" | "test" | "demo" | nullrequired

    The organization's mark; null for a customer's. A figure that leaves the organization counts a marked one apart

  • tenantZerobooleanrequired

    Whether the organization is marked staff: Nexus's own, where C1 is measured. A figure that leaves it counts it apart

  • signedUpAtstring (date-time)required

    The organization's creation: every minutesAfterSignup counts from it

  • activatedFirstValuerequired

    Activated by either definition: the earlier of gateway and wiki. Exact only when both are; carries the Wiki's error, since an unknown Wiki run may be the earlier

    • atstring (date-time) | nullrequired

      When the organization first reached it; null when it has not, or when error says it could not be read

    • minutesAfterSignupinteger | nullrequired

      Whole minutes from signedUpAt to at; 0 for a value recorded before the sign-up

    • exactbooleanrequired

      False when older records were pruned or not listed, so the true first may be earlier than at

    • errorstring | nullrequired

      wiki_not_configured or wiki_unavailable: why the value could not be read; the rest of the answer stands

  • gatewayFirstValuerequired

    Activated: Gateway. The first agent session through nexus claude or nexus codex

    • atstring (date-time) | nullrequired

      When the organization first reached it; null when it has not, or when error says it could not be read

    • minutesAfterSignupinteger | nullrequired

      Whole minutes from signedUpAt to at; 0 for a value recorded before the sign-up

    • exactbooleanrequired

      False when older records were pruned or not listed, so the true first may be earlier than at

    • errorstring | nullrequired

      wiki_not_configured or wiki_unavailable: why the value could not be read; the rest of the answer stands

  • wikiFirstValuerequired

    Activated: Wiki. The first Nexus Wiki run

    • atstring (date-time) | nullrequired

      When the organization first reached it; null when it has not, or when error says it could not be read

    • minutesAfterSignupinteger | nullrequired

      Whole minutes from signedUpAt to at; 0 for a value recorded before the sign-up

    • exactbooleanrequired

      False when older records were pruned or not listed, so the true first may be earlier than at

    • errorstring | nullrequired

      wiki_not_configured or wiki_unavailable: why the value could not be read; the rest of the answer stands

  • firstSettledCallFirstValuerequired

    The first model call that settled; refused and failed calls do not count

    • atstring (date-time) | nullrequired

      When the organization first reached it; null when it has not, or when error says it could not be read

    • minutesAfterSignupinteger | nullrequired

      Whole minutes from signedUpAt to at; 0 for a value recorded before the sign-up

    • exactbooleanrequired

      False when older records were pruned or not listed, so the true first may be earlier than at

    • errorstring | nullrequired

      wiki_not_configured or wiki_unavailable: why the value could not be read; the rest of the answer stands

403Not an owner or admin (`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

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/growth/activation" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Get growth member paths

get/v1/growth/paths

How far your organization's members got on the path to first value, computed on read (Growth Capabilities): per step (joined, signed in on the CLI, first key, first agent session, first settled call), how many reached it, how many stopped just before it, and how long they waited from each member's previous step reached (shown from five waits, so no one person's wait shows). stall is the step the most members stopped just before. Counts only: no person is named. exact is false when older records were pruned or not read.

growth.readOwner, AdminTry it in the API Explorer

Responses

200OKapplication/json

  • tenantIdstringrequired
  • mark"staff" | "test" | "demo" | nullrequired

    The organization's mark, as in GrowthActivation

  • tenantZerobooleanrequired

    Whether the organization is marked staff, as in GrowthActivation

  • membersintegerrequired

    The organization's members now with no mark; a removed member is not counted

  • markedMembersintegerrequired

    Its members marked staff, test or demo; no step counts them. At an organization marked staff, staff stay in members

  • stepsarray of PathSteprequired

    Every step, over the members with no mark, in order

    • step"joined" | "cli_signed_in" | "first_key" | "first_agent_session" | "first_settled_call"required
    • reachedintegerrequired

      Members who reached it

    • waitingintegerrequired

      Members whose furthest step is the one before it: they stopped there

    • waitMinutesWaitMinutes | nullrequired

      Whole minutes from each member's previous step reached to this one, never below 0; null for joined, and below five waits, so no one person's wait shows

    • exactbooleanrequired

      False when older records were pruned or not read, so a member may have reached it earlier, or at all

  • stall"joined" | "cli_signed_in" | "first_key" | "first_agent_session" | "first_settled_call" | nullrequired

    The step the most members stopped just before (the earlier one on a tie); null when no one stopped short

403Not an owner or admin (`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

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/growth/paths" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

List referrals

get/v1/referrals

Your referral code and the people whose sign-up carried it, oldest first, each with when they joined and their email masked. The code is made on the first read: ten random characters of lowercase base 32, with no name in it, and it never changes after. A code made earlier from your name gets a random one on its next read, and the old code still works. It is a person's, whichever organization you call from. The people always page: the first 100 without limit or cursor.

referrals.readEvery memberTry it in the API Explorer

Parameters

  • limitquery · integer

    People per page, 1 to 500 (default 100).

  • cursorquery · string

    NextCursor from the previous page. A cursor whose person left the list answers 400 invalid_cursor.

Responses

200OKapplication/json

  • codestringrequired

    Your referral code: ten random characters of lowercase base 32, made on the first read. A code made earlier from your name gets one on its next read, and the old code still works.

  • referredarray of ReferredPersonrequired
    • joinedAtstring (date-time)required

      When their sign-up was recorded.

    • emailstring | nullrequired

      Their email with all but its first character before the @ hidden (a***@example.com). null when they erased their account (erased), or when their sign-in carried no email Nexus could keep.

    • erasedboolean

      Whether the person erased their account. A person with no email who is not erased is still live: a reward needs their email. Absent on older Gateways, which a client reads from a null email.

    • rewardedboolean | null

      Whether this referral earned the caller a reward. Absent or null when unavailable. No payment date is disclosed.

    • reward"pending" | "rewarded" | "not_rewarded"

      This referral's reward. pending: none yet, and one may come; a payment is never disclosed while a reward can still come. rewarded: your personal organization got it. not_rewarded: final, it never will (its reward was voided, you reached the lifetime limit, or you have no personal organization). Absent on older Gateways.

  • nextCursorstring

    The next page's cursor, while more people follow.

  • invitesLeftinteger

    While sign-up is invite-only: how many more people your code admits, as an operator approved. Only the people who joined through your code after the approval use one. Absent while sign-up is open, and for a staff member's code with no approval, which admits anyone.

    min 0

  • invitesAllowedinteger

    While sign-up is invite-only: how many people an operator approved your code to admit in all, used or not. 0: not approved. With invitesLeft 0 and this above 0, you used every invitation. Absent while sign-up is open, for a staff member's code with no approval, and on older Gateways.

    min 0

  • enabledbooleanrequired

    False while the personal referral program is stopped. Existing referrals remain readable.

  • rewardProgressReferralRewardProgress

    Lifetime referral rewards for the person's personal organization, across all pages, including credit already spent or expired, against its limit. Absent for a staff member, whose account has no limit, and on older Gateways.

    • grantedintegerrequired

      How many referral rewards this account has received.

      min 0

    • limitintegerrequired

      The maximum number of rewarded referrals per account, currently 10.

      min 1

  • rewardsGrantedinteger

    How many referral rewards your personal organization got in all, across all pages, including credit already spent or expired, limit or not. Absent on older Gateways.

    min 0

  • rewardUsdDecimalstring

    What one rewarded referral gives your personal organization, in US dollars with six decimals ("1.000000"). "0.000000" while no reward is set. Absent on older Gateways.

  • rewardsActiveboolean

    Whether your referrals earn rewards now: the program is on, a reward and a program cap are set, the cap has room for one more reward, and you are below your lifetime limit (rewardProgress) or are staff, who have none. False: no referral of yours earns credit now. Absent on older Gateways, which a client reads as false.

400A bad `limit` or `cursor` (`invalid_request_error`, `invalid_cursor`)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 a person: a module, a service account, an agent or an operator (`person_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.

Errors

StatusCodeWhen
100limitThe first 100 without `limit` or `cursor`
400invalid_request_errorA field is missing or not valid; the message names it
400A bad `limit` or `cursor` (`invalid_request_error`, `invalid_cursor`)
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/referrals" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Send diagnostic reports

post/v1/diagnostics/reports

Send the app's own error and crash reports to the observability store. Each report becomes one nexus::client_report line in the Gateway's log, which reaches Cloud Logging with the Gateway's other lines; the Gateway keeps no copy. A report names what failed and where, never content: its fields are a closed set, each one bounded, and its free text (name, message) is logged redacted, with quoted text, URL paths and queries, emails and anything shaped like a key or token taken out. A stack frame is logged only as a code location (at <function> (<file>:<line>:<column>) or <binary> +0x<offset>), with every key or token shape taken out; any other frame is logged as [redacted].

diagnostics.reportEvery memberTry it in the API Explorer

Request body · application/json

  • reportsarray of DiagnosticReportrequired

    at most 20 items

    • kind"error" | "crash"required

      error: an error in the app's JavaScript; crash: a native crash (the OS's, or a desktop panic) seen at the next start

    • fatalbooleanrequired

      Whether it ended the app

    • namestringrequired

      The error's name (TypeError), or the crash's exception and signal

      min length 1 · max length 120

    • messagestring

      The error's message, already redacted by the app; may be empty

      max length 500

    • stackarray of string

      The top frames: a function and its place in the bundle, or a binary and its offset

      at most 64 items

    • occurredAtstring (date-time)required

      When it happened

    • appVersionstringrequired

      The app's version

      min length 1 · max length 40

    • appBuildstring | null

      The store build number, when the app knows it

      min length 1 · max length 40

    • platform"ios" | "android" | "macos" | "windows" | "linux" | "web"required
    • osVersionstringrequired

      The OS version the report came from

      min length 1 · max length 40

Responses

202Loggedapplication/json

  • acceptedintegerrequired

    How many reports went to the log

400A report breaks the contract (`invalid_report`)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 one of the organization's people: a service account, a module or a sandbox (`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

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
400A report breaks the contract (`invalid_report`)
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/diagnostics/reports" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "reports": [
      {
        "kind": "error",
        "fatal": false,
        "name": "Platform",
        "occurredAt": "2026-10-01T00:00:00Z",
        "appVersion": "<appVersion>",
        "platform": "ios",
        "osVersion": "<osVersion>"
      }
    ]
  }'

Send activity heartbeat

post/v1/diagnostics/heartbeat

Report one active minute of the caller on an app: the app's window has focus and the person acted in the last minute. The Gateway keeps active minutes per UTC day, organization, person, surface, app, app version and OS, and the last minute per app. Labels come from fixed lists and versions are bounded: no content, path or address is kept.

diagnostics.reportEvery memberTry it in the API Explorer

Request body · application/json

  • surface"code" | "chat" | "wiki" | "review" | "pages" | "other"required

    What the person looks at: Code (or an agent session), Chat, Wiki, Review, Pages (with Slides and Design), or any other screen

  • app"desktop" | "desktop-gpui" | "web" | "cli" | "mobile"required

    The app that reports

  • appVersionstringrequired

    The app's version, such as 0.31.0+abc1234

    pattern ^[0-9A-Za-z.+-]{1,32}$

  • os"macos" | "windows" | "linux" | "ios" | "android" | "other"required

    The OS family

  • osVersionstring

    The OS release, such as 15.1

    pattern ^[0-9A-Za-z._-]{1,32}$

  • browser"chrome" | "safari" | "firefox" | "edge" | "other"

    The web app's browser; the web app only

  • browserVersionstring

    The browser's major version; the web app only

    pattern ^[0-9]{1,4}$

Responses

200Checked; `recorded` says whether a minute countedapplication/json

  • recordedbooleanrequired

    Whether the heartbeat counted a minute: false when collection is off, or when the person's minute on this app was already counted

400A value outside its list or pattern (`invalid_heartbeat`)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 a person: a service account, a module, an agent link or an operator (`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.

Errors

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
400A value outside its list or pattern (`invalid_heartbeat`)
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/diagnostics/heartbeat" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "surface": "code",
    "app": "desktop",
    "appVersion": "<appVersion>",
    "os": "macos"
  }'

Send client errors

post/v1/diagnostics/errors

Report errors the caller's app caught, with no content: the app, its version and OS, a kind from a fixed list, and a component and a code the app names from its own code. Never a message, a stack, a path or a URL: the pattern refuses spaces, '/', ':' and '@', and the app must not put content in a name. The Gateway counts them per UTC day, organization, person, app, version, OS, kind, component and code, and keeps each person's last 50 per organization.

diagnostics.reportEvery memberTry it in the API Explorer

Request body · application/json

  • errorsarray of ClientErrorrequired

    at most 20 items

    • app"desktop" | "desktop-gpui" | "web" | "cli" | "mobile"required

      The app that reports

    • appVersionstringrequired

      The app's version, such as 0.31.0+abc1234

      pattern ^[0-9A-Za-z.+-]{1,32}$

    • os"macos" | "windows" | "linux" | "ios" | "android" | "other"required

      The OS family

    • osVersionstring

      The OS release, such as 15.1

      pattern ^[0-9A-Za-z._-]{1,32}$

    • kind"crash" | "render" | "network" | "sign_in" | "update" | "agent" | "storage" | "other"required

      Crash: a panic or native crash; render: a UI error boundary; network: a request from the app failed; sign_in; update: the updater; agent: a local agent did not start or ended badly; storage: local files or the keychain; other

    • componentstringrequired

      The app's own name for where it failed, such as diff_view: never text from the error

      pattern ^[a-z0-9_.-]{1,64}$

    • codestringrequired

      The app's own error code, such as panic or callback_timeout: never text from the error

      pattern ^[a-z0-9_.-]{1,64}$

    • fatalboolean

      Whether it ended the app or the window; false when absent

    • occurredAtstring (date-time)

      When it happened (RFC 3339); the Gateway's now when absent or out of bounds

Responses

200Checked; `recorded` says how many were storedapplication/json

  • recordedintegerrequired

    How many errors were stored: 0 when collection is off

400A value outside its list or pattern (`invalid_client_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 a person: a service account, a module, an agent link or an operator (`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.

Errors

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
400A value outside its list or pattern (`invalid_client_error`)
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/diagnostics/errors" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "errors": [
      {
        "app": "desktop",
        "appVersion": "<appVersion>",
        "os": "macos",
        "kind": "crash",
        "component": "<component>",
        "code": "<code>"
      }
    ]
  }'

Send frame failures

post/v1/diagnostics/frame-failures

Report artifact frames that failed to load, with no content: the surface, how it failed, the app and browser versions, and the frame's host, the artifact's id and the HTTP status when the app knows them. Never a URL, a path, a share token or free text: each field is a fixed list or a pattern. The Gateway counts each failure in nexus_gateway_artifact_frame_failures_total, which holds no identity, and stores nothing. With NEXUS_COLLECT_FRAME_FAILURES=true it also writes one nexus::artifact_frame_failure log line per failure; off, the default, it logs nothing and accepted is 0.

diagnostics.reportEvery memberTry it in the API Explorer

Request body · application/json

  • failuresarray of FrameFailurerequired

    at most 10 items

    • surface"api" | "share_link" | "subdomain"required
    • kind"error" | "timeout" | "blocked" | "csp" | "http"required
    • app"web" | "desktop-gpui"required
    • appVersionstringrequired

      pattern ^[0-9A-Za-z.+-]{1,32}$

    • browser"chrome" | "safari" | "firefox" | "edge" | "webkit" | "other"
    • browserVersionstring

      pattern ^[0-9]{1,4}$

    • artifactIdstring

      pattern ^[A-Za-z0-9_-]{1,64}$

    • hoststring

      The frame's host name: the sandbox subdomain

      pattern ^[a-z0-9.-]{1,253}$

    • statusinteger

      min 100 · max 599

    • occurredAtstring (date-time)

      max length 40

Responses

202Logged; `accepted` says how manyapplication/json

  • acceptedintegerrequired

    How many failures were logged: 0 while NEXUS_COLLECT_FRAME_FAILURES is off

400A value outside its list or pattern (`invalid_frame_failure`)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 a person: a service account, a module, an agent link or an operator (`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.

Errors

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
400A value outside its list or pattern (`invalid_frame_failure`)
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/diagnostics/frame-failures" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "failures": [
      {
        "surface": "api",
        "kind": "error",
        "app": "web",
        "appVersion": "<appVersion>"
      }
    ]
  }'

Send public frame failures

post/v1/public/frame-failures

Report artifact frames that failed to load from the public share-link viewer: the same body as the signed-in route. No credential; limited per address, one count per request, on the public artifact reads' limit. With logging on, the line carries org "public" and no person.

publicAnyone, signed in or notTry it in the API Explorer

Request body · application/json

  • failuresarray of FrameFailurerequired

    at most 10 items

    • surface"api" | "share_link" | "subdomain"required
    • kind"error" | "timeout" | "blocked" | "csp" | "http"required
    • app"web" | "desktop-gpui"required
    • appVersionstringrequired

      pattern ^[0-9A-Za-z.+-]{1,32}$

    • browser"chrome" | "safari" | "firefox" | "edge" | "webkit" | "other"
    • browserVersionstring

      pattern ^[0-9]{1,4}$

    • artifactIdstring

      pattern ^[A-Za-z0-9_-]{1,64}$

    • hoststring

      The frame's host name: the sandbox subdomain

      pattern ^[a-z0-9.-]{1,253}$

    • statusinteger

      min 100 · max 599

    • occurredAtstring (date-time)

      max length 40

Responses

202Logged; `accepted` says how manyapplication/json

  • acceptedintegerrequired

    How many failures were logged: 0 while NEXUS_COLLECT_FRAME_FAILURES is off

400A value outside its list or pattern (`invalid_frame_failure`)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

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
400A value outside its list or pattern (`invalid_frame_failure`)
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).

Example

curl
curl -X POST "$NEXUS_URL/v1/public/frame-failures" \
  -H "Content-Type: application/json" \
  -d '{
    "failures": [
      {
        "surface": "api",
        "kind": "error",
        "app": "web",
        "appVersion": "<appVersion>"
      }
    ]
  }'

Send daily active

post/v1/public/daily-active

Report that this install of the open-source desktop app was used today: a random install ID, the day, the app version and release channel, the OS, its major and minor version, the CPU type, and how the app reached models. No credential: the app sends it at most once a day, only while its person has "Send usage data" on. Never a prompt, code, path, name or account. With NEXUS_COLLECT_DAILY_ACTIVE=true the Gateway keeps one row per UTC day and install ID for 90 days, then only counts with no install ID; off, the default, it keeps nothing and accepted is false. The client's address is never kept with the event.

publicAnyone, signed in or notTry it in the API Explorer

Request body · application/json

  • install_idstringrequired

    A random UUID v4 the app made when its person turned usage data on, in lower case. No account links to it

    pattern ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$

  • daystring (date)required

    The UTC day the app was used, from a week ago to tomorrow

  • app_versionstringrequired

    pattern ^[0-9A-Za-z.+-]{1,32}$

  • channel"stable" | "beta" | "internal" | "other"required
  • os"macos" | "linux" | "windows"required
  • os_versionstring

    Major and minor only. Absent when the system names none

    pattern ^[0-9]{1,4}(\.[0-9]{1,4})?$

  • arch"arm64" | "x86_64"required
  • modesarray of "own_subscription" | "own_key" | "own_model" | "cloud"

    How the app reached models that day. cloud: signed in to Nexus Cloud

    at most 4 items

Responses

202Checked; `accepted` says whether it was keptapplication/json

  • acceptedbooleanrequired

    Whether the day was kept: false while NEXUS_COLLECT_DAILY_ACTIVE is off

400A value outside its list or pattern, or a day outside the last week (`invalid_daily_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.

Errors

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
400A value outside its list or pattern, or a day outside the last week (`invalid_daily_active`)
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).

Example

curl
curl -X POST "$NEXUS_URL/v1/public/daily-active" \
  -H "Content-Type: application/json" \
  -d '{
    "install_id": "<install_id>",
    "day": "2026-10-01",
    "app_version": "<app_version>",
    "channel": "stable",
    "os": "macos",
    "arch": "arm64"
  }'

Send feedback

post/v1/diagnostics/feedback

Send feedback, a crash report the person chose to send, or a report on a model's answer (App Review 1.2), to Nexus's team. The Gateway posts one message to the feedback channel in Slack (NEXUS_FEEDBACK_SLACK_WEBHOOK_URL) and keeps no copy. The message names the person (name and email) and the organization, so the team can answer, with the app, its version, the OS and the screen. What the person wrote is shown as plain text, so it cannot mention a channel or a person, hide a link, or pass for the Gateway's own lines; names are code spans, and Slack previews no link. A crash shows its redacted name and message and its top frames, as POST /v1/diagnostics/reports logs them, and is logged as one nexus::client_report line too. A reported answer shows its reason and model, then the answer as plain text, as the app showed it.

feedback.sendEvery memberTry it in the API Explorer

Request body · application/json

  • category"bug" | "idea" | "other" | "crash" | "report" | "triage"required

    What it is. crash carries crash, and only it does; report carries answer, and only it does; triage is a report that nexus triage's agent wrote, sent only by Nexus's own people to the triage channel (NEXUS_TRIAGE_SLACK_WEBHOOK_URL)

  • messagestring

    What the person wrote: 1 to 4000 characters (12000 with triage), or empty with a crash or a report. Slack shows it as plain text

    max length 12000

  • screenstring | null

    The screen the person was on, as its route's shape (/acme/sessions/:id): letters, digits and / _ . ~ - :, never a query

    min length 1 · max length 120 · pattern ^/[A-Za-z0-9/_.~:-]*$

  • appVersionstringrequired

    The app's version

    min length 1 · max length 40

  • appBuildstring | null

    The build, when the app knows it

    min length 1 · max length 40

  • platform"ios" | "android" | "macos" | "windows" | "linux" | "web"required
  • osVersionstringrequired

    The OS's version, or the browser's

    min length 1 · max length 40

  • crashDiagnosticReport | null

    The crash the app saw at this start, which the person chose to send; logged as a diagnostic report too

  • answerReportedAnswer | null

    With the category report: the model's answer the person reported, as the app showed it

Responses

200Posted to the channelapplication/json

  • senttruerequired

400Feedback that breaks the contract (`invalid_feedback`)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 one of the organization's people: a service account, a module or a sandbox (`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.

502Slack did not take the message (`upstream_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.

503No feedback channel on this Gateway (`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

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
400Feedback that breaks the contract (`invalid_feedback`)
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
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).
429rate_limit_errorToo many requests from this key in a minute
502Slack did not take the message (`upstream_error`)
503No feedback channel on this Gateway (`not_configured`)

Example

curl
curl -X POST "$NEXUS_URL/v1/diagnostics/feedback" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "category": "bug",
    "appVersion": "<appVersion>",
    "platform": "ios",
    "osVersion": "<osVersion>"
  }'

Get notification settings

get/v1/notifications/settings

Your notification settings in this organization: one row per group and channel.

notifications.useEvery memberTry it in the API Explorer

Responses

200OKapplication/json

  • settingsarray of NotificationSettingrequired
    • group"my_sessions" | "usage_and_billing" | "requests_and_approvals" | "automations_and_integrations" | "account_and_security"required
    • channel"inbox" | "email" | "push"required
    • setting"on" | "off"required

      Your choice, else the default

    • default"on" | "off"required

      On when one of the group's kinds uses the channel before anyone chooses

    • lockedbooleanrequired

      The inbox: always on, no setting changes it

    • requiredbooleanrequired

      The group holds a required kind, which off does not mute

    • availablebooleanrequired

      The channel can reach the person on this Gateway. Always true: push reaches a desktop app, which collects its deliveries, even where Web Push has no keys. Kept for older clients

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

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/notifications/settings" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Set notification settings

put/v1/notifications/settings

Change one or more of your notification settings. Answers with every setting.

notifications.useEvery memberTry it in the API Explorer

Request body · application/json

  • settingsarray of objectrequired

    at most 20 items

    • group"my_sessions" | "usage_and_billing" | "requests_and_approvals" | "automations_and_integrations" | "account_and_security"required
    • channel"email" | "push"required
    • setting"on" | "off"required

Responses

200OKapplication/json

  • settingsarray of NotificationSettingrequired
    • group"my_sessions" | "usage_and_billing" | "requests_and_approvals" | "automations_and_integrations" | "account_and_security"required
    • channel"inbox" | "email" | "push"required
    • setting"on" | "off"required

      Your choice, else the default

    • default"on" | "off"required

      On when one of the group's kinds uses the channel before anyone chooses

    • lockedbooleanrequired

      The inbox: always on, no setting changes it

    • requiredbooleanrequired

      The group holds a required kind, which off does not mute

    • availablebooleanrequired

      The channel can reach the person on this Gateway. Always true: push reaches a desktop app, which collects its deliveries, even where Web Push has no keys. Kept for older clients

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

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X PUT "$NEXUS_URL/v1/notifications/settings" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "settings": [
      {
        "group": "my_sessions",
        "channel": "email",
        "setting": "on"
      }
    ]
  }'

Get notification push key

get/v1/notifications/push-key

The public key a browser subscribes to Web Push with.

notifications.useEvery memberTry it in the API Explorer

Responses

200OKapplication/json

  • publicKeystringrequired

    The application server's secp256r1 public key (VAPID), uncompressed, base64url without padding: the browser's applicationServerKey

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.

503Web Push is not configured on this Gateway (`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

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
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).
429rate_limit_errorToo many requests from this key in a minute
503Web Push is not configured on this Gateway (`not_configured`).

Example

curl
curl "$NEXUS_URL/v1/notifications/push-key" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

List notification devices

get/v1/notifications/devices

Your devices that take push in this organization. No answer holds a token.

notifications.useEvery memberTry it in the API Explorer

Responses

200OKapplication/json

  • devicesarray of NotificationDevicerequired
    • idstringrequired
    • platform"web" | "desktop" | "ios" | "android"required
    • createdAtstring (date-time)required
    • lastSeenAtstring (date-time)required
    • revokedAtstring (date-time)
    • revokedReason"signed_out" | "lost" | "left" | "rejected" | "replaced"

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

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/notifications/devices" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Register notification device

post/v1/notifications/devices

Register this device for push, or refresh it. Registering the same token again answers the same device.

notifications.useEvery memberTry it in the API Explorer

Request body · application/json

  • platform"web" | "desktop" | "ios" | "android"required
  • tokenstringrequired

    The push service's token: for web, the browser's push subscription JSON (endpoint on a known push service, keys.p256dh, keys.auth), checked at registration; an APNs or FCM token otherwise. Sealed, never answered back.

    min length 1 · max length 4096

Responses

200OKapplication/json

  • idstringrequired
  • platform"web" | "desktop" | "ios" | "android"required
  • createdAtstring (date-time)required
  • lastSeenAtstring (date-time)required
  • revokedAtstring (date-time)
  • revokedReason"signed_out" | "lost" | "left" | "rejected" | "replaced"

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.

409You hold 20 live devices in this organization (`device_limit`). Remove one first.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

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
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`).
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
409You hold 20 live devices in this organization (`device_limit`). Remove one first.
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/notifications/devices" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "platform": "web",
    "token": "<token>"
  }'

Revoke notification device

DEL/v1/notifications/devices/{id}

Stop push to one of your devices. Not yours, revoked already or unknown: 404.

notifications.useEvery memberTry it in the API Explorer

Parameters

  • idpath · stringrequired

    The device's id (ndv_…)

  • reasonquery · "lost" | "signed_out"

    Why the device stops: lost when omitted

Responses

200OKapplication/json

  • idstringrequired
  • platform"web" | "desktop" | "ios" | "android"required
  • createdAtstring (date-time)required
  • lastSeenAtstring (date-time)required
  • revokedAtstring (date-time)
  • revokedReason"signed_out" | "lost" | "left" | "rejected" | "replaced"

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

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
404not_foundNothing matches the path in your organization
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X DELETE "$NEXUS_URL/v1/notifications/devices/<id>" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Collect notification deliveries

post/v1/notifications/devices/{id}/collect

Collect a desktop device's notifications, once each. Not yours, revoked or unknown: 404.

notifications.useEvery memberTry it in the API Explorer

Parameters

  • idpath · stringrequired

    The device's id (ndv_…)

Responses

200OKapplication/json

  • itemsarray of CollectedNotificationrequired
    • kindstringrequired

      The kind's name

    • eventIdstringrequired

      The inbox item's key

    • titlestringrequired

      The kind's fixed subject, or a month report's summary from its figures only: no text a tenant wrote

    • bodystring

      A month report's second line, from its figures only. Absent for other kinds

    • pathstringrequired

      The path the notice opens. It names no organization; a month report opens Usage on its month

    • deliveryIdstringrequired

      The delivery's id (ndl_…)

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

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
404not_foundNothing matches the path in your organization
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/notifications/devices/<id>/collect" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Create voice speech

post/v1/chat/voice-speech

A piece of a voice-mode answer, said by ElevenLabs: the app plays the audio/mpeg it answers, and Nexus's own key stays on the Gateway.

chat.useEvery memberTry it in the API Explorer

Request body · application/json

  • textstringrequired

    The text to say: 1 to 500 characters, not only spaces.

    min length 1 · max length 500

Responses

200The speech, as MP3.audio/mpeg

string (binary)

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

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/chat/voice-speech" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "<text>"
  }'

Create voice token

post/v1/chat/voice-token

A short-lived token for dictation: the app's microphone button streams audio to AssemblyAI's speech to text with it, and Nexus's own key stays on the Gateway.

chat.useEvery memberTry it in the API Explorer

Responses

200OKapplication/json

  • tokenstringrequired

    The streaming token. It opens one session.

  • urlstringrequired

    The WebSocket to open, token included.

  • sampleRateintegerrequired

    The sample rate the audio must have: 16000.

  • expiresInSecondsintegerrequired

    Seconds from now until the token can no longer open a session.

  • maxSessionSecondsintegerrequired

    The longest one session may run, in seconds.

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

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/chat/voice-token" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Ask owners

post/v1/notifications/ask-owner

Ask the organization's owners about a billing block: a reached usage limit, used-up credits or free start, a failed charge, an unpaid invoice, or the plan.

notifications.useEvery memberTry it in the API Explorer

Request body · application/json

  • block"usage_limit" | "credits_out" | "free_start_used" | "payment_failed" | "past_due" | "billing"required

    What stops you: a reached usage limit, used-up credits, a used-up free start, a failed charge, an unpaid invoice, or billing for a question about the plan and its usage

Responses

200OKapplication/json

  • status"sent" | "already_asked"required

    sent: each owner gets an inbox item and an email now. already_asked: you asked about this block today (UTC), so nobody is told again.

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.

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

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
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`).
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/notifications/ask-owner" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "block": "usage_limit"
  }'