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

API reference

Models and policies

The model catalog (supported and coming soon), model access policies (allow and deny lists per organization, team and coding agent; a deny always wins; levels only narrow), and the policy test. Nexus calls providers directly.

View as Markdown

List models

get/v1/models

The models you may use under your organization's, team's and key's policies (OpenAI-compatible list, with Nexus's fields: each supported model's context window, output limit, reasoning and list prices, enough for a client to offer it without a catalog of its own). Send the key as Authorization: Bearer <key> or x-api-key: <key>. With a key: status=allowed (the default) gives the models you may use; status=all the whole catalog with allowed and status; supported or coming_soon filter it. team: as for a call (else x-nexus-team, else your default team). Without a key (the public catalog, for the model pages and other readers): the catalog itself, the same for everyone, supported models by default and status=all or coming_soon on request, with no allowed field, no status=allowed and no team (asking for status=allowed or a team, by team or x-nexus-team, is a 401); limited per address, and cacheable (Cache-Control: public, Vary: Authorization, X-Api-Key, X-Nexus-Ui-Secret). A wrong key is a 401, as on every route.

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

Parameters

  • statusquery · "allowed" | "all" | "supported" | "coming_soon"

    With a key: allowed (the default), all, supported or coming_soon. Without a key: supported (the default), all or coming_soon; allowed needs a key and is a 401 without one.

  • teamquery · string

Responses

200OKapplication/json

  • object"list"
  • dataarray of Model
    • idstring

      Canonical: maker/model

    • object"model"
    • createdinteger
    • owned_bystring

      The maker: who made the model, the first part of its id

    • providerstring

      Supported models: the host that serves it, whose rules price it and whose key pays for it

    • namestring
    • familystring
    • status"supported" | "coming_soon"
    • allowedboolean
    • surfacesarray of string
    • inputarray of "text" | "image"

      Supported models: what it reads; image when chat questions with images may use it

    • provider_modelstring
    • context_windowinteger

      Supported models: input and output tokens together, at most

    • web_search_usdnumber

      One hosted web search's list price in US dollars, set when the model can run a chat's web search; absent otherwise

    • max_output_tokensinteger

      Supported models: the longest output, which Core reserves when a call names no limit. It holds on the agents' pass-through (/v1/anthropic, /v1/openai); the chat paths cap output at the deployment's limit (NEXUS_MAX_TOKENS, 4,096 by default): /v1/chat/completions refuses a larger max_tokens with a 400, and Nexus chat answers within it, except rounds that offer the write_page tool, which ask for up to 16,384 tokens within the model's own limit

    • reasoningobject

      Supported models: how it reasons

      • mode"effort" | "budget" | "none"

        How a call steers it: an effort level (efforts), a token budget (Anthropic extended thinking, budget_tokens), or not at all (the model does not reason)

      • effortsarray of "low" | "medium" | "high" | "xhigh" | "max"

        The values the provider's effort setting takes (Anthropic output_config.effort, OpenAI reasoning.effort), lowest first; empty unless mode is effort

      • default_effortstring | null

        The provider's default effort; null where the provider states none

      • can_disableboolean

        Whether a call may turn reasoning off with the provider's own switch (Anthropic thinking: {"type": "disabled"}, OpenAI reasoning.effort: "none"), at some effort at least: see disable_max_effort

      • disable_max_effort"low" | "medium" | "high" | "xhigh" | "max" | null

        The highest effort at which can_disable holds (Claude Opus 5 and Claude Haiku 5.5: high); null when it holds at every effort, or can_disable is false

    • pricingobject

      List prices Core meters with, per million tokens (supported models). An OpenAI model's cache_write sizes a call's reservation, but settlement does not charge it yet

      • inputnumber
      • outputnumber
      • cache_readnumber

        Cache reads

      • cache_writenumber

        Cache writes (Anthropic: 5-minute writes; 0 where the provider does not price them)

      • cache_write_1hnumber

        Anthropic: 1-hour cache writes

      • long_contextobject

        The rates above above input tokens, where the model has a long-context tier

        • aboveinteger
        • inputnumber
        • outputnumber
        • cache_readnumber

          Cache reads

        • cache_writenumber

          Cache writes (Anthropic: 5-minute writes; 0 where the provider does not price them)

        • cache_write_1hnumber

          Anthropic: 1-hour cache writes

      • unitstring
    • default_forarray of string
    • notestring
    • openWeightsboolean | null

      Catalog classification. True means open weights. Null means unclassified.

  • unavailablearray of object

    Models the Gateway knows of but cannot serve yet, each with why. They are not in data and cannot be called. A model may move from here to data without notice.

    • idstringrequired
    • reasonstringrequired
  • teamstring

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.

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.

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.

503Gateway takes no new request now: it is at its limit of requests in flight (`overloaded`), or it is stopping (`draining`). Retry after `Retry-After` seconds.application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

504The request passed Gateway's deadline, 30 seconds by default (`timeout`). Model calls that may stream are outside it.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
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`.
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
503Gateway takes no new request now: it is at its limit of requests in flight (`overloaded`), or it is stopping (`draining`). Retry after `Retry-After` seconds.
504The request passed Gateway's deadline, 30 seconds by default (`timeout`). Model calls that may stream are outside it.

Example

curl
curl "$NEXUS_URL/v1/models" \
  -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.models({ status: "all" });

List providers

get/v1/providers

The providers the Gateway calls, from the catalog: each one's id, name, country, whether an organization may bring its own key (byok), whether the Gateway calls it (status), how many listed models it hosts, its rates (what a model on it costs beyond its input and output prices), the host of its API (apiHost) and what the Gateway calls it for (serving). Send the key as Authorization: Bearer <key> or x-api-key: <key>. With a key: each BYOK provider also carries key, the state of the organization's own key: none (none stored, or disabled), valid or rejected. It never returns the key or any part of it; listProviderKeys shows the last four characters. Without a key: the same list for everyone, with no key field; limited per address with the public model catalog, and cacheable (Cache-Control: public, Vary: Authorization, X-Api-Key, X-Nexus-Ui-Secret). A wrong key is a 401, as on every route.

org.readEvery memberTry it in the API Explorer

Responses

200OKapplication/json

  • object"list"required
  • dataarray of Providerrequired
    • idstringrequired

      Its id in stored keys, spend records and the policy's providers lists (anthropic).

    • namestringrequired

      Its name in messages (Anthropic).

    • countrystringrequired

      The ISO 3166-1 alpha-2 code of the country it is headquartered in.

    • byokbooleanrequired

      Whether an organization may bring its own key for it (addProviderKey).

    • status"active" | "inactive"required

      Whether the Gateway calls it. A model on an inactive provider is neither listed nor callable.

    • modelsintegerrequired

      How many listed models it hosts.

      min 0

    • ratesProviderRatesrequired

      What a model on the provider costs beyond its input and output prices, where the model states no price of its own. listModels gives each model's own prices.

      • cacheReadSharenumber | nullrequired

        A cache read's price, as a share of the model's input price (0.1 is 10%). null: each model has its own cache-read price.

      • cacheWriteobject | objectrequired

        How a cache write is priced. multipliers: a multiple of the model's input price, by how long the cache entry lives. model_rate: the model's own cache-write price, or its input price when it has none.

      • webSearchUsdstring | nullrequired

        One hosted web search, in US dollars, as a decimal string ("0.010000"). null: the Gateway runs no hosted web search on this provider.

    • apiHoststringrequired

      The host of the provider's public API (api.anthropic.com).

    • serving"model_api" | "decisions"required

      What the Gateway calls the provider for. model_api: its models, on chat completions and the pass-through APIs. decisions: typed decisions only (POST /v1/decisions).

    • key"none" | "valid" | "rejected"

      With a key, on a BYOK provider only: the organization's own key. none: none stored, or disabled. rejected: the provider refused it. valid: a call uses it.

    • enabledboolean

      With a key: whether the organization's provider policy (ModelRule.providers) lets calls use it.

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 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.

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/providers" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Get organization policy

get/v1/policies/organization

The organization's model policy, what it inherits from this Gateway, and what it allows.

policy.readEvery memberTry it in the API Explorer

Responses

200OKapplication/json

  • level"organization" | "team" | "agent"
  • subjectstring
  • teamobject
  • ruleModelRule

    A model access rule. Patterns: an exact model (anthropic/claude-opus-5.5, any spelling), a provider (anthropic/*) or a family (openai/gpt-6-*). No allow list (or an empty one): every model the levels above allow. A deny wins at any level. Coming-soon models may be named (accepted with a note; no effect until supported).

    • allowarray of string

      at most 100 items

    • denyarray of string

      at most 100 items

    • defaultsobject

      What nexus/auto and nexus/default resolve to, per kind; the most specific level that names one wins. Must be supported and allowed by this rule's own lists.

      • chatstring
      • claudestring
      • codexstring
    • maxPriceobject

      Refuses a model priced above either limit, in USD per million tokens. A price equal to the limit passes. A side left out has no limit. A model with no price is refused. Applies at every level, and a lower level only narrows.

      • inputnumber

        min 0

      • outputnumber

        min 0

    • denyCountriesobject

      Refuses a model whose maker country or provider country is listed. Countries are ISO 3166-1 alpha-2 codes, listed one by one. A model with no catalog entry is refused when a side is listed. Applies at every level, and a lower level only narrows.

      • makerarray of string
      • providerarray of string
    • providersobject

      Which providers calls may use, by catalog provider id (GET /v1/providers). A provider in deny is off. With allow, only the providers it lists are on, so a provider added to the catalog later stays off until it is listed. Without either, every provider is on. A provider in both lists is off: deny wins. An empty allow is refused with 400 providers_allow_empty: omit allow to allow every provider. A model whose providers are all off is refused with 403 provider_disabled, and is not allowed in GET /v1/models. Set on the organization's policy only. An unknown id is refused with 400 unknown_provider.

      • allowarray of string
      • denyarray of string
  • customboolean

    False: no rule at this level

  • migratedboolean

    Read from the old agent policy, not saved since

  • updatedAtstring (date-time)
  • inheritedarray of object
  • effectiveobject

    What the levels down to this one allow, and the defaults they resolve to

  • notesarray of string

403The credential does not hold `policy.read`. Every person in the organization holds it; a service account or sandbox key does not (`role_required`), nor a scoped module key (`module_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
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
403model_not_allowedThe credential does not hold `policy.read`. Every person in the organization holds it; a service account or sandbox key does not (`role_required`), nor a scoped module key (`module_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).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/policies/organization" \
  -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.policy("organization");

Set organization policy

put/v1/policies/organization

Replace the organization's model policy (owners and admins). An empty rule removes it. Audited as policy.changed.

policy.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

  • allowarray of string

    at most 100 items

  • denyarray of string

    at most 100 items

  • defaultsobject

    What nexus/auto and nexus/default resolve to, per kind; the most specific level that names one wins. Must be supported and allowed by this rule's own lists.

    • chatstring
    • claudestring
    • codexstring
  • maxPriceobject

    Refuses a model priced above either limit, in USD per million tokens. A price equal to the limit passes. A side left out has no limit. A model with no price is refused. Applies at every level, and a lower level only narrows.

    • inputnumber

      min 0

    • outputnumber

      min 0

  • denyCountriesobject

    Refuses a model whose maker country or provider country is listed. Countries are ISO 3166-1 alpha-2 codes, listed one by one. A model with no catalog entry is refused when a side is listed. Applies at every level, and a lower level only narrows.

    • makerarray of string
    • providerarray of string
  • providersobject

    Which providers calls may use, by catalog provider id (GET /v1/providers). A provider in deny is off. With allow, only the providers it lists are on, so a provider added to the catalog later stays off until it is listed. Without either, every provider is on. A provider in both lists is off: deny wins. An empty allow is refused with 400 providers_allow_empty: omit allow to allow every provider. A model whose providers are all off is refused with 403 provider_disabled, and is not allowed in GET /v1/models. Set on the organization's policy only. An unknown id is refused with 400 unknown_provider.

    • allowarray of string
    • denyarray of string

Responses

200OKapplication/json

  • level"organization" | "team" | "agent"
  • subjectstring
  • teamobject
  • ruleModelRule

    A model access rule. Patterns: an exact model (anthropic/claude-opus-5.5, any spelling), a provider (anthropic/*) or a family (openai/gpt-6-*). No allow list (or an empty one): every model the levels above allow. A deny wins at any level. Coming-soon models may be named (accepted with a note; no effect until supported).

    • allowarray of string

      at most 100 items

    • denyarray of string

      at most 100 items

    • defaultsobject

      What nexus/auto and nexus/default resolve to, per kind; the most specific level that names one wins. Must be supported and allowed by this rule's own lists.

      • chatstring
      • claudestring
      • codexstring
    • maxPriceobject

      Refuses a model priced above either limit, in USD per million tokens. A price equal to the limit passes. A side left out has no limit. A model with no price is refused. Applies at every level, and a lower level only narrows.

      • inputnumber

        min 0

      • outputnumber

        min 0

    • denyCountriesobject

      Refuses a model whose maker country or provider country is listed. Countries are ISO 3166-1 alpha-2 codes, listed one by one. A model with no catalog entry is refused when a side is listed. Applies at every level, and a lower level only narrows.

      • makerarray of string
      • providerarray of string
    • providersobject

      Which providers calls may use, by catalog provider id (GET /v1/providers). A provider in deny is off. With allow, only the providers it lists are on, so a provider added to the catalog later stays off until it is listed. Without either, every provider is on. A provider in both lists is off: deny wins. An empty allow is refused with 400 providers_allow_empty: omit allow to allow every provider. A model whose providers are all off is refused with 403 provider_disabled, and is not allowed in GET /v1/models. Set on the organization's policy only. An unknown id is refused with 400 unknown_provider.

      • allowarray of string
      • denyarray of string
  • customboolean

    False: no rule at this level

  • migratedboolean

    Read from the old agent policy, not saved since

  • updatedAtstring (date-time)
  • inheritedarray of object
  • effectiveobject

    What the levels down to this one allow, and the defaults they resolve to

  • notesarray of string

400Not a valid rule (`invalid_policy`), or `providers` names an id that is not a catalog provider (`unknown_provider`), or `providers.allow` is empty (`providers_allow_empty`): omit `allow` to allow every providerapplication/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule 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 caller does not hold `policy.manage`: only owners and admins set the organization's policy (`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
400Not a valid rule (`invalid_policy`), or `providers` names an id that is not a catalog provider (`unknown_provider`), or `providers.allow` is empty (`providers_allow_empty`): omit `allow` to allow every provider
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
403model_not_allowedThe caller does not hold `policy.manage`: only owners and admins set the organization's policy (`role_required`).
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 PUT "$NEXUS_URL/v1/policies/organization" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "deny": [
      "anthropic/claude-fable-*"
    ]
  }'
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.setPolicy("organization", undefined, { deny: ["anthropic/claude-fable-*"] });

Get team policy

get/v1/policies/teams/{slug}

A team's model policy: its own rule, the organization's and its parent teams' (it only narrows them), and what they add up to.

policy.readEvery memberTry it in the API Explorer

Parameters

  • slugpath · stringrequired

Responses

200OKapplication/json

  • level"organization" | "team" | "agent"
  • subjectstring
  • teamobject
  • ruleModelRule

    A model access rule. Patterns: an exact model (anthropic/claude-opus-5.5, any spelling), a provider (anthropic/*) or a family (openai/gpt-6-*). No allow list (or an empty one): every model the levels above allow. A deny wins at any level. Coming-soon models may be named (accepted with a note; no effect until supported).

    • allowarray of string

      at most 100 items

    • denyarray of string

      at most 100 items

    • defaultsobject

      What nexus/auto and nexus/default resolve to, per kind; the most specific level that names one wins. Must be supported and allowed by this rule's own lists.

      • chatstring
      • claudestring
      • codexstring
    • maxPriceobject

      Refuses a model priced above either limit, in USD per million tokens. A price equal to the limit passes. A side left out has no limit. A model with no price is refused. Applies at every level, and a lower level only narrows.

      • inputnumber

        min 0

      • outputnumber

        min 0

    • denyCountriesobject

      Refuses a model whose maker country or provider country is listed. Countries are ISO 3166-1 alpha-2 codes, listed one by one. A model with no catalog entry is refused when a side is listed. Applies at every level, and a lower level only narrows.

      • makerarray of string
      • providerarray of string
    • providersobject

      Which providers calls may use, by catalog provider id (GET /v1/providers). A provider in deny is off. With allow, only the providers it lists are on, so a provider added to the catalog later stays off until it is listed. Without either, every provider is on. A provider in both lists is off: deny wins. An empty allow is refused with 400 providers_allow_empty: omit allow to allow every provider. A model whose providers are all off is refused with 403 provider_disabled, and is not allowed in GET /v1/models. Set on the organization's policy only. An unknown id is refused with 400 unknown_provider.

      • allowarray of string
      • denyarray of string
  • customboolean

    False: no rule at this level

  • migratedboolean

    Read from the old agent policy, not saved since

  • updatedAtstring (date-time)
  • inheritedarray of object
  • effectiveobject

    What the levels down to this one allow, and the defaults they resolve to

  • notesarray of string

403The credential does not hold `policy.read`. Every person in the organization holds it; a service account or sandbox key does not (`role_required`), nor a scoped module key (`module_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.

404No team with this slug or id in this 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
403role_requiredYour role does not have this permission
403model_not_allowedThe credential does not hold `policy.read`. Every person in the organization holds it; a service account or sandbox key does not (`role_required`), nor a scoped module key (`module_key`).
404not_foundNothing matches the path in your organization
404No team with this slug or id in this 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/policies/teams/platform" \
  -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.policy("team", "platform");

Set team policy

put/v1/policies/teams/{slug}

Replace a team's model policy (owners and admins; a team lead for a team they lead or one under it, and only to narrow it). Audited.

policy.manage_teamOwner, Admin, Team leadTry it in the API Explorer

Parameters

  • slugpath · stringrequired
  • Idempotency-Keyheader · string

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

Request body · application/json

  • allowarray of string

    at most 100 items

  • denyarray of string

    at most 100 items

  • defaultsobject

    What nexus/auto and nexus/default resolve to, per kind; the most specific level that names one wins. Must be supported and allowed by this rule's own lists.

    • chatstring
    • claudestring
    • codexstring
  • maxPriceobject

    Refuses a model priced above either limit, in USD per million tokens. A price equal to the limit passes. A side left out has no limit. A model with no price is refused. Applies at every level, and a lower level only narrows.

    • inputnumber

      min 0

    • outputnumber

      min 0

  • denyCountriesobject

    Refuses a model whose maker country or provider country is listed. Countries are ISO 3166-1 alpha-2 codes, listed one by one. A model with no catalog entry is refused when a side is listed. Applies at every level, and a lower level only narrows.

    • makerarray of string
    • providerarray of string
  • providersobject

    Which providers calls may use, by catalog provider id (GET /v1/providers). A provider in deny is off. With allow, only the providers it lists are on, so a provider added to the catalog later stays off until it is listed. Without either, every provider is on. A provider in both lists is off: deny wins. An empty allow is refused with 400 providers_allow_empty: omit allow to allow every provider. A model whose providers are all off is refused with 403 provider_disabled, and is not allowed in GET /v1/models. Set on the organization's policy only. An unknown id is refused with 400 unknown_provider.

    • allowarray of string
    • denyarray of string

Responses

200OKapplication/json

  • level"organization" | "team" | "agent"
  • subjectstring
  • teamobject
  • ruleModelRule

    A model access rule. Patterns: an exact model (anthropic/claude-opus-5.5, any spelling), a provider (anthropic/*) or a family (openai/gpt-6-*). No allow list (or an empty one): every model the levels above allow. A deny wins at any level. Coming-soon models may be named (accepted with a note; no effect until supported).

    • allowarray of string

      at most 100 items

    • denyarray of string

      at most 100 items

    • defaultsobject

      What nexus/auto and nexus/default resolve to, per kind; the most specific level that names one wins. Must be supported and allowed by this rule's own lists.

      • chatstring
      • claudestring
      • codexstring
    • maxPriceobject

      Refuses a model priced above either limit, in USD per million tokens. A price equal to the limit passes. A side left out has no limit. A model with no price is refused. Applies at every level, and a lower level only narrows.

      • inputnumber

        min 0

      • outputnumber

        min 0

    • denyCountriesobject

      Refuses a model whose maker country or provider country is listed. Countries are ISO 3166-1 alpha-2 codes, listed one by one. A model with no catalog entry is refused when a side is listed. Applies at every level, and a lower level only narrows.

      • makerarray of string
      • providerarray of string
    • providersobject

      Which providers calls may use, by catalog provider id (GET /v1/providers). A provider in deny is off. With allow, only the providers it lists are on, so a provider added to the catalog later stays off until it is listed. Without either, every provider is on. A provider in both lists is off: deny wins. An empty allow is refused with 400 providers_allow_empty: omit allow to allow every provider. A model whose providers are all off is refused with 403 provider_disabled, and is not allowed in GET /v1/models. Set on the organization's policy only. An unknown id is refused with 400 unknown_provider.

      • allowarray of string
      • denyarray of string
  • customboolean

    False: no rule at this level

  • migratedboolean

    Read from the old agent policy, not saved since

  • updatedAtstring (date-time)
  • inheritedarray of object
  • effectiveobject

    What the levels down to this one allow, and the defaults they resolve to

  • notesarray of string

400Not a valid rule (`invalid_policy`). `providers` is refused here too: it is set on the organization's policy only.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 caller is not an owner, an admin or a team lead (`role_required`); a lead names a team outside their teams (`outside_led_teams`); or a lead's rule widens the stored one (`policy_widens`)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.

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 a valid rule (`invalid_policy`). `providers` is refused here too: it is set on the organization's policy only.
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
403model_not_allowedThe caller is not an owner, an admin or a team lead (`role_required`); a lead names a team outside their teams (`outside_led_teams`); or a lead's rule widens the stored one (`policy_widens`)
404not_foundNothing matches the path in your organization
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`.
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 PUT "$NEXUS_URL/v1/policies/teams/platform" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "allow": [
      "anthropic/*"
    ],
    "defaults": {
      "chat": "anthropic/claude-haiku-5.5"
    }
  }'
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.setPolicy("team", "platform", { allow: ["anthropic/*"] });

Get agent policy

get/v1/policies/agents/{agent}

A coding agent's model policy (was the old agent policy, migrated as its allow list and default).

policy.readEvery memberTry it in the API Explorer

Parameters

  • agentpath · "claude" | "codex" | "antigravity" | "cursor" | "opencode"required

Responses

200OKapplication/json

  • level"organization" | "team" | "agent"
  • subjectstring
  • teamobject
  • ruleModelRule

    A model access rule. Patterns: an exact model (anthropic/claude-opus-5.5, any spelling), a provider (anthropic/*) or a family (openai/gpt-6-*). No allow list (or an empty one): every model the levels above allow. A deny wins at any level. Coming-soon models may be named (accepted with a note; no effect until supported).

    • allowarray of string

      at most 100 items

    • denyarray of string

      at most 100 items

    • defaultsobject

      What nexus/auto and nexus/default resolve to, per kind; the most specific level that names one wins. Must be supported and allowed by this rule's own lists.

      • chatstring
      • claudestring
      • codexstring
    • maxPriceobject

      Refuses a model priced above either limit, in USD per million tokens. A price equal to the limit passes. A side left out has no limit. A model with no price is refused. Applies at every level, and a lower level only narrows.

      • inputnumber

        min 0

      • outputnumber

        min 0

    • denyCountriesobject

      Refuses a model whose maker country or provider country is listed. Countries are ISO 3166-1 alpha-2 codes, listed one by one. A model with no catalog entry is refused when a side is listed. Applies at every level, and a lower level only narrows.

      • makerarray of string
      • providerarray of string
    • providersobject

      Which providers calls may use, by catalog provider id (GET /v1/providers). A provider in deny is off. With allow, only the providers it lists are on, so a provider added to the catalog later stays off until it is listed. Without either, every provider is on. A provider in both lists is off: deny wins. An empty allow is refused with 400 providers_allow_empty: omit allow to allow every provider. A model whose providers are all off is refused with 403 provider_disabled, and is not allowed in GET /v1/models. Set on the organization's policy only. An unknown id is refused with 400 unknown_provider.

      • allowarray of string
      • denyarray of string
  • customboolean

    False: no rule at this level

  • migratedboolean

    Read from the old agent policy, not saved since

  • updatedAtstring (date-time)
  • inheritedarray of object
  • effectiveobject

    What the levels down to this one allow, and the defaults they resolve to

  • notesarray of string

400The path names no coding agent: `agent` must be `claude`, `codex`, `antigravity` or `cursor` (`invalid_request`); or it names one without a Gateway route, which has no model policy (`route_unsupported`).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 credential does not hold `policy.read`. Every person in the organization holds it; a service account or sandbox key does not (`role_required`), nor a scoped module key (`module_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
400The path names no coding agent: `agent` must be `claude`, `codex`, `antigravity` or `cursor` (`invalid_request`); or it names one without a Gateway route, which has no model policy (`route_unsupported`).
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
403model_not_allowedThe credential does not hold `policy.read`. Every person in the organization holds it; a service account or sandbox key does not (`role_required`), nor a scoped module key (`module_key`).
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 "$NEXUS_URL/v1/policies/agents/claude" \
  -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.policy("agent", "claude");

Set agent policy

put/v1/policies/agents/{agent}

Replace a coding agent's model policy (owners and admins). Audited.

policy.manageOwner, AdminTry it in the API Explorer

Parameters

  • agentpath · "claude" | "codex" | "antigravity" | "cursor" | "opencode"required
  • Idempotency-Keyheader · string

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

Request body · application/json

  • allowarray of string

    at most 100 items

  • denyarray of string

    at most 100 items

  • defaultsobject

    What nexus/auto and nexus/default resolve to, per kind; the most specific level that names one wins. Must be supported and allowed by this rule's own lists.

    • chatstring
    • claudestring
    • codexstring
  • maxPriceobject

    Refuses a model priced above either limit, in USD per million tokens. A price equal to the limit passes. A side left out has no limit. A model with no price is refused. Applies at every level, and a lower level only narrows.

    • inputnumber

      min 0

    • outputnumber

      min 0

  • denyCountriesobject

    Refuses a model whose maker country or provider country is listed. Countries are ISO 3166-1 alpha-2 codes, listed one by one. A model with no catalog entry is refused when a side is listed. Applies at every level, and a lower level only narrows.

    • makerarray of string
    • providerarray of string
  • providersobject

    Which providers calls may use, by catalog provider id (GET /v1/providers). A provider in deny is off. With allow, only the providers it lists are on, so a provider added to the catalog later stays off until it is listed. Without either, every provider is on. A provider in both lists is off: deny wins. An empty allow is refused with 400 providers_allow_empty: omit allow to allow every provider. A model whose providers are all off is refused with 403 provider_disabled, and is not allowed in GET /v1/models. Set on the organization's policy only. An unknown id is refused with 400 unknown_provider.

    • allowarray of string
    • denyarray of string

Responses

200OKapplication/json

  • level"organization" | "team" | "agent"
  • subjectstring
  • teamobject
  • ruleModelRule

    A model access rule. Patterns: an exact model (anthropic/claude-opus-5.5, any spelling), a provider (anthropic/*) or a family (openai/gpt-6-*). No allow list (or an empty one): every model the levels above allow. A deny wins at any level. Coming-soon models may be named (accepted with a note; no effect until supported).

    • allowarray of string

      at most 100 items

    • denyarray of string

      at most 100 items

    • defaultsobject

      What nexus/auto and nexus/default resolve to, per kind; the most specific level that names one wins. Must be supported and allowed by this rule's own lists.

      • chatstring
      • claudestring
      • codexstring
    • maxPriceobject

      Refuses a model priced above either limit, in USD per million tokens. A price equal to the limit passes. A side left out has no limit. A model with no price is refused. Applies at every level, and a lower level only narrows.

      • inputnumber

        min 0

      • outputnumber

        min 0

    • denyCountriesobject

      Refuses a model whose maker country or provider country is listed. Countries are ISO 3166-1 alpha-2 codes, listed one by one. A model with no catalog entry is refused when a side is listed. Applies at every level, and a lower level only narrows.

      • makerarray of string
      • providerarray of string
    • providersobject

      Which providers calls may use, by catalog provider id (GET /v1/providers). A provider in deny is off. With allow, only the providers it lists are on, so a provider added to the catalog later stays off until it is listed. Without either, every provider is on. A provider in both lists is off: deny wins. An empty allow is refused with 400 providers_allow_empty: omit allow to allow every provider. A model whose providers are all off is refused with 403 provider_disabled, and is not allowed in GET /v1/models. Set on the organization's policy only. An unknown id is refused with 400 unknown_provider.

      • allowarray of string
      • denyarray of string
  • customboolean

    False: no rule at this level

  • migratedboolean

    Read from the old agent policy, not saved since

  • updatedAtstring (date-time)
  • inheritedarray of object
  • effectiveobject

    What the levels down to this one allow, and the defaults they resolve to

  • notesarray of string

400Not a valid rule (`invalid_policy`), including `providers`, which is set on the organization's policy only; or the path names no coding agent (`invalid_request`); or it names one without a Gateway route, which has no model policy (`route_unsupported`).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 caller does not hold `policy.manage`: only owners and admins set the coding agents' policies (`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
400Not a valid rule (`invalid_policy`), including `providers`, which is set on the organization's policy only; or the path names no coding agent (`invalid_request`); or it names one without a Gateway route, which has no model policy (`route_unsupported`).
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
403model_not_allowedThe caller does not hold `policy.manage`: only owners and admins set the coding agents' policies (`role_required`).
404not_foundNothing matches the path in your organization
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 PUT "$NEXUS_URL/v1/policies/agents/claude" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "allow": [
      "anthropic/claude-opus-*",
      "anthropic/claude-haiku-*"
    ],
    "defaults": {
      "claude": "anthropic/claude-opus-5.5"
    }
  }'
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.setPolicy("agent", "claude", { allow: ["anthropic/claude-opus-*", "anthropic/claude-haiku-*"], defaults: { claude: "anthropic/claude-opus-5.5" } });

Test policy

post/v1/policies/test

Would this person (or key) be allowed this model, in this team, with this agent, and by which rule? The same decision enforcement makes, plus warnings (e.g. a rule that blocks Claude Code's small background Haiku model). Testing for someone else needs owner or admin.

policy.readEvery memberTry 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

  • asstring

    An email, a user id or a key id; default: you

  • teamstring
  • agent"claude" | "codex" | "antigravity" | "cursor" | "opencode"

    A coding agent's id. It names the agent in sessions, policies and routes. Its command may differ: antigravity runs as nexus agy.

  • modelstring

    Default: nexus/default

  • surface"chat" | "anthropic_messages" | "openai_responses" | "decisions"

Responses

200OKapplication/json

  • allowedboolean
  • requestedstring
  • modelstring | null

    Canonical id of the model that runs (or would)

  • providerModelstring
  • surface"chat" | "anthropic_messages" | "openai_responses" | "decisions"
  • reasonstring
  • rulePolicyRuleRef
    • level"deployment" | "organization" | "team" | "agent" | "key" | "catalog" | "none"
    • subjectstring
    • list"allow" | "deny" | "defaults" | "maxPrice" | "denyCountries" | "providers"
    • patternstring
  • code"model_not_allowed" | "model_not_found" | "model_not_supported" | "provider_disabled"
  • resolvedFrom"nexus/auto" | "nexus/default"
  • defaultFromPolicyRuleRef
    • level"deployment" | "organization" | "team" | "agent" | "key" | "catalog" | "none"
    • subjectstring
    • list"allow" | "deny" | "defaults" | "maxPrice" | "denyCountries" | "providers"
    • patternstring
  • notesarray of string
  • asobject
  • teamstring
  • agent"claude" | "codex" | "antigravity" | "cursor" | "opencode"

    A coding agent's id. It names the agent in sessions, policies and routes. Its command may differ: antigravity runs as nexus agy.

  • allowedModelsarray of string
  • warningsarray of string

400A field has the wrong type or value: `agent` is not `claude`, `codex`, `antigravity` or `cursor`, `surface` is not one of its values, or `as`, `team` or `model` is not a string (`invalid_request`); or `agent` has no Gateway route (`route_unsupported`).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.

403`as` names someone else and the caller does not hold `policy.manage`: only owners and admins test the policy for others (`role_required`). A credential without `policy.read` (a service account or sandbox key) gets the same code; a scoped module key gets `module_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.

404`team` names no team in this organization (`unknown_team`), or `as` names no member or key in it (`not_found`).application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

Errors

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
400A field has the wrong type or value: `agent` is not `claude`, `codex`, `antigravity` or `cursor`, `surface` is not one of its values, or `as`, `team` or `model` is not a string (`invalid_request`); or `agent` has no Gateway route (`route_unsupported`).
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
403model_not_allowed`as` names someone else and the caller does not hold `policy.manage`: only owners and admins test the policy for others (`role_required`). A credential without `policy.read` (a service account or sandbox key) gets the same code; a scoped module key gets `module_key`.
404`team` names no team in this organization (`unknown_team`), or `as` names no member or key in it (`not_found`).
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/policies/test" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "agent": "claude",
    "model": "claude-haiku-5-5"
  }'
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.testPolicy({ agent: "claude", model: "claude-haiku-5-5" });

List write grants

get/v1/policies/grants

The organization's write grants (owners, admins, leads and members: policy.read; not module keys): which module may write through which connector operation (for Nexus Review: robustness/review may github/pull_review, check_run, issue_comment, reaction, resolve_thread; pull_review also covers pull_review_dismiss; pull_ready, pull_merge, pull_edit, pull_state, pull_reviewers and pull_labels each have their own grant, and no other grant covers a merge), who granted each and when, and the write operations that may be granted. A connector write without its grant is refused (403 write_not_granted).

policy.readEvery memberTry it in the API Explorer

Responses

200OKapplication/json

  • grantsarray of WriteGrantrequired
    • modulestringrequired

      <product>/<capability>

    • connectorstringrequired
    • actionstringrequired

      The write operation

    • grantedBystring | null

      The user id of who granted it

    • atstring (date-time)required
  • grantableobjectrequired

    The write operations that may be granted, by connector

403The credential does not hold `policy.read`. Every person in the organization holds it; a service account or sandbox key does not (`role_required`), nor a scoped module key (`module_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.

Errors

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
403model_not_allowedThe credential does not hold `policy.read`. Every person in the organization holds it; a service account or sandbox key does not (`role_required`), nor a scoped module key (`module_key`).
429rate_limit_errorToo many requests from this key in a minute

Example

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

Set write grants

put/v1/policies/grants/{product}/{capability}

Set the write operations of one connector a module may run in this organization (owners and admins: policy.manage), in full: the operations not listed are revoked, and an empty list revokes them all. Each grant and each revocation is audited (connector_grant.granted, connector_grant.revoked); a revocation applies from the module's next call. Policy's decide_call reads these grants before every scoped connector call. Each write attempt is audited as connector.write: outcome written; denied with the refusal's code (no grant, a review event other than COMMENT, a thread of another repository); or failed with the error's code and status when an allowed write failed (a rate limit, a timeout). A grant is per organization, module, connector and operation, not per repository: the module scopes repositories itself.

policy.manageOwner, AdminTry it in the API Explorer

Parameters

  • productpath · stringrequired

    The module's product slug (robustness)

  • capabilitypath · stringrequired

    The module's capability slug (review)

  • Idempotency-Keyheader · string

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

Request body · application/json

  • connectorstringrequired
  • actionsarray of stringrequired

Responses

200OKapplication/json

  • modulestringrequired
  • connectorstringrequired
  • actionsarray of stringrequired

    What the module now holds for this connector

  • grantedarray of stringrequired
  • revokedarray of stringrequired

400Not a connector with writes, or not one of its write operations (`invalid_grant`)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 caller does not hold `policy.manage`: only owners and admins grant connector writes (`role_required`). Under an operator grant, only a revoke (an empty `actions` list) is allowed (`operator_scope`).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 a connector with writes, or not one of its write operations (`invalid_grant`)
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
403model_not_allowedThe caller does not hold `policy.manage`: only owners and admins grant connector writes (`role_required`). Under an operator grant, only a revoke (an empty `actions` list) is allowed (`operator_scope`).
404not_foundNothing matches the path in your organization
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
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X PUT "$NEXUS_URL/v1/policies/grants/<product>/<capability>" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "connector": "github",
    "actions": [
      "pull_review",
      "check_run"
    ]
  }'

Get review events

get/v1/policies/review-events

Which review events a module may post on this organization's pull requests (owners, admins, leads and members: policy.read; not module keys): comment (COMMENT only), request_changes (COMMENT and REQUEST_CHANGES) or full (COMMENT, REQUEST_CHANGES and APPROVE). full by default: default is true while the organization never chose.

policy.readEvery memberTry it in the API Explorer

Responses

200OKapplication/json

  • level"comment" | "request_changes" | "full"required

    comment: COMMENT only. request_changes: COMMENT and REQUEST_CHANGES. full: COMMENT, REQUEST_CHANGES and APPROVE.

  • defaultbooleanrequired

    The organization never chose: full

  • changedBystring
  • changedAtstring (date-time)

Errors

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/policies/review-events" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Set review events

put/v1/policies/review-events

Choose which review events a module may post on this organization's pull requests (owners and admins: policy.manage; an operator may only lower it to comment). The github connector refuses a pull_review whose event is above it (403 review_event_refused) on the next call. Nexus Review reads it to choose its event: it requests changes on a failing check and approves a pull request it read in full with none, each only where the level allows. Audited as review_event_setting.changed with the setting before and after.

policy.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

  • level"comment" | "request_changes" | "full"required

    comment: COMMENT only. request_changes: COMMENT and REQUEST_CHANGES. full: COMMENT, REQUEST_CHANGES and APPROVE.

Responses

200OKapplication/json

  • level"comment" | "request_changes" | "full"required

    comment: COMMENT only. request_changes: COMMENT and REQUEST_CHANGES. full: COMMENT, REQUEST_CHANGES and APPROVE.

  • defaultbooleanrequired

    The organization never chose: full

  • changedBystring
  • changedAtstring (date-time)

400Not a level (`invalid_setting`)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 a level (`invalid_setting`)
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
403review_event_refusedThe github connector refuses a `pull_review` whose event is above it (403 `review_event_refused`) on the next call
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
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X PUT "$NEXUS_URL/v1/policies/review-events" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "level": "comment"
  }'

List connector availability

get/v1/policies/connectors

Every connector Gateway offers, with its availability in this organization (owners, admins, leads and members: policy.read): disabled, available (members opt in) or enabled_for_all, the teams it is limited to, and whether it is the connector's default (the organization never chose: enabled_for_all for github, disabled for every other connector).

policy.readEvery memberTry it in the API Explorer

Responses

200OKapplication/json

  • connectorsarray of ConnectorAvailabilityrequired
    • namestringrequired
    • availability"disabled" | "available" | "enabled_for_all"required

      Available: members opt in

    • teamsarray of string | nullrequired

      Team slugs (a deleted team's id); null for the whole organization

    • defaultbooleanrequired

      The connector's default: the organization never chose

    • offeredbooleanrequired

      Whether this Gateway offers the connector. The organization's choice of one it does not offer is kept; no one uses it, and it may only be set to disabled

    • changedBystring
    • changedAtstring (date-time)

403The credential does not hold `policy.read`. Every person in the organization holds it; a service account or sandbox key does not (`role_required`), nor a scoped module key (`module_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.

Errors

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
403model_not_allowedThe credential does not hold `policy.read`. Every person in the organization holds it; a service account or sandbox key does not (`role_required`), nor a scoped module key (`module_key`).
429rate_limit_errorToo many requests from this key in a minute

Example

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

Set connector availability

put/v1/policies/connectors/{name}

Set one connector's availability in this organization, in full (owners and admins: policy.manage; an operator may only turn it off). With teams, only their members and the members of the teams under them may use it, and a module acting for no person may not. Every connector call reads it first: a person, or a module acting for one, it does not reach is refused with 403 connector_disabled. Audited as connector_availability.changed with the availability before and after.

policy.manageOwner, AdminTry it in the API Explorer

Parameters

  • namepath · stringrequired

    The connector (github)

  • Idempotency-Keyheader · string

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

Request body · application/json

  • availability"disabled" | "available" | "enabled_for_all"required

    Available: members opt in

  • teamsarray of string

    Team slugs; leave it out for the whole organization

Responses

200OKapplication/json

  • namestringrequired
  • availability"disabled" | "available" | "enabled_for_all"required

    Available: members opt in

  • teamsarray of string | nullrequired

    Team slugs (a deleted team's id); null for the whole organization

  • defaultbooleanrequired

    The connector's default: the organization never chose

  • offeredbooleanrequired

    Whether this Gateway offers the connector. The organization's choice of one it does not offer is kept; no one uses it, and it may only be set to disabled

  • changedBystring
  • changedAtstring (date-time)

400Not an availability: an empty or unknown team, or a state the connector cannot hold (`available` for one only the organization connects, `enabled_for_all` for one only a person connects) (`invalid_availability`)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 caller does not hold `policy.manage`: only owners and admins choose which connectors members may use (`role_required`). Under an operator grant, only `disabled` is allowed (`operator_scope`). A connector this Gateway does not offer may only be set to `disabled` (`connector_not_offered`).application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

404No such connectorapplication/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule 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 an availability: an empty or unknown team, or a state the connector cannot hold (`available` for one only the organization connects, `enabled_for_all` for one only a person connects) (`invalid_availability`)
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
403model_not_allowedThe caller does not hold `policy.manage`: only owners and admins choose which connectors members may use (`role_required`). Under an operator grant, only `disabled` is allowed (`operator_scope`). A connector this Gateway does not offer may only be set to `disabled` (`connector_not_offered`).
404not_foundNothing matches the path in your organization
404No such connector
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
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X PUT "$NEXUS_URL/v1/policies/connectors/Platform" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "availability": "disabled"
  }'

Get chat writes

get/v1/policies/chat-writes

Whether this organization lets a person's confirmed write from chat run, and which connector operations it may run (owners, admins, leads and members: policy.read). On with every registered connector write by default. Saved organization choices, including empty operation lists, take precedence. default is true while the organization never chose.

policy.readEvery memberTry it in the API Explorer

Responses

200OKapplication/json

  • enabledbooleanrequired
  • defaultbooleanrequired

    The organization never chose: on with every registered write

  • operationsarray of ChatWriteOperationrequired

    The effective allowed connector writes, sorted. Defaults to every registered write; saved lists take precedence

    • connectorstringrequired

      pattern ^[a-z][a-z0-9-]*$

    • operationstringrequired

      pattern ^[a-z][a-z0-9_-]*$

  • changedBystring
  • changedAtstring (date-time)

Errors

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/policies/chat-writes" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Set chat writes

put/v1/policies/chat-writes

Turn writes from chat on or off for this organization and, with operations, replace its allowlist of connector operations; left out, the list is kept (owners and admins: policy.manage; an operator may only turn them off, and never sets the list). Each entry must be a connector write Core has. A write of an operation the list does not name is refused (403 operation_not_allowed), even with a confirmed record. Off, a chat agent's approval record is not made, confirmed or used, so a record confirmed before stops working too. What an allowed write lets a member's agent do: a github write runs as that member's own GitHub account, connected with POST /v1/connections/github/oauth, so GitHub allows it only what it allows the member, and it is refused (403 connection_required) while they have none connected; a module's write runs as the Nexus GitHub App. Audited as chat_write_setting.changed with the setting before and after.

policy.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

  • enabledbooleanrequired
  • operationsarray of ChatWriteOperation

    Replaces the allowlist. Left out, the list is kept

    • connectorstringrequired

      pattern ^[a-z][a-z0-9-]*$

    • operationstringrequired

      pattern ^[a-z][a-z0-9_-]*$

Responses

200OKapplication/json

  • enabledbooleanrequired
  • defaultbooleanrequired

    The organization never chose: on with every registered write

  • operationsarray of ChatWriteOperationrequired

    The effective allowed connector writes, sorted. Defaults to every registered write; saved lists take precedence

    • connectorstringrequired

      pattern ^[a-z][a-z0-9-]*$

    • operationstringrequired

      pattern ^[a-z][a-z0-9_-]*$

  • changedBystring
  • changedAtstring (date-time)

400Not a setting, or an entry that is no connector write (`invalid_setting`)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 a setting, or an entry that is no connector write (`invalid_setting`)
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
403operation_not_allowedA write of an operation the list does not name is refused (403 `operation_not_allowed`), even with a confirmed record
403connection_requiredA `github` write runs as that member's own GitHub account, connected with POST /v1/connections/github/oauth, so GitHub allows it only what it allows the member, and it is refused (403 `connection_required`) while they have none connected; a module's write runs as the Nexus GitHub App
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
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X PUT "$NEXUS_URL/v1/policies/chat-writes" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": false
  }'

Get agent writes

get/v1/policies/agent-writes

Whether your agents may write in this organization: with it on, your agent links make the connector writes the organization allows its agents (/v1/policies/chat-writes) with no approval record per call. On by default; a saved OFF choice restores approval records per call. Your own session or key only (approvals.decide): an agent link gets 403 person_only.

approvals.decideEvery memberTry it in the API Explorer

Responses

200OKapplication/json

  • enabledbooleanrequired

    Whether your agent links make the organization's allowed writes with no record per call

403Not your own session or key: an agent link or any other credential (`person_only`)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
403person_onlyAn agent link gets 403 `person_only`
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/policies/agent-writes" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Set agent writes

put/v1/policies/agent-writes

Turn your agents' writes on or off in this organization. On, your agent links make the connector writes the organization allows its agents, while it has them on, with no approval record per call; the agent's own mode decides whether it asks first. A github write runs as your own GitHub account (POST /v1/connections/github/oauth), never as the Nexus GitHub App: without one connected it is refused (403 connection_required). Off, a write needs a record you confirmed. Your own session or key only (approvals.decide): no agent link and no operator grant holds it. Audited as agent_write_setting.changed with the setting before and after.

approvals.decideEvery memberTry 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

  • enabledbooleanrequired

    Whether your agent links make the organization's allowed writes with no record per call

Responses

200OKapplication/json

  • enabledbooleanrequired

    Whether your agent links make the organization's allowed writes with no record per call

400Not a setting (`invalid_setting`)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 your own session or key: an agent link or any other credential (`person_only`)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 a setting (`invalid_setting`)
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
403connection_requiredWithout one connected it is refused (403 `connection_required`)
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
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X PUT "$NEXUS_URL/v1/policies/agent-writes" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": false
  }'

Create approval

post/v1/approvals

Ask Policy for an approval record bound to one exact connector call: the person, this agent link, the connector, the operation and a SHA-256 of the arguments' canonical JSON (keys sorted at every depth, no spaces). It keeps the arguments, so the person sees them. It is pending, expires in 30 minutes and allows the call once, after the person confirms it in Nexus (confirmUrl). A chat agent's link only (connectors.use): any other caller gets 403 agent_only. Refused while chat writes are off (chat_writes_off) and for an operation the organization's allowlist does not name (operation_not_allowed). Audited as policy.approval.requested, with the hash and never the arguments.

connectors.useEvery member, module keysTry 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

  • connectorstringrequired

    pattern ^[a-z][a-z0-9-]*$

  • operationstringrequired

    pattern ^[a-z][a-z0-9_-]*$

  • argumentsobjectrequired

    The body the write will send, exactly

Responses

201Createdapplication/json

  • idstringrequired

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

  • connectorstringrequired
  • operationstringrequired
  • argumentsobjectrequired

    The call's body, as stored: what the person confirms, and what the write must send

  • argumentsHashstringrequired

    SHA-256 of the arguments' canonical JSON

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

  • status"pending" | "confirmed" | "denied" | "used" | "expired"required
  • expiredbooleanrequired

    Its expiry passed: it can no longer be confirmed or used

  • createdAtstring (date-time)required
  • expiresAtstring (date-time)required
  • decidedAtstring (date-time)
  • decidedBy"person" | "agent"

    Who decided it: the person (confirm or deny in Nexus), or the agent link that cancelled it

  • usedAtstring (date-time)
  • confirmUrlstring (uri)

    Nexus UI's page where the person confirms or denies it, when Gateway knows Nexus UI's URL (NEXUS_UI_URL)

400Not a body (`invalid_approval`), or the operation only reads (`not_a_write`)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 chat agent's link (`agent_only`), chat writes are off (`chat_writes_off`), or the operation is not on the allowlist (`operation_not_allowed`)application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

404No such connector operationapplication/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule 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 a body (`invalid_approval`), or the operation only reads (`not_a_write`)
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
403agent_onlyAny other caller gets 403 `agent_only`
404No such connector operation
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
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/approvals" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "connector": "<connector>",
    "operation": "<operation>",
    "arguments": {}
  }'

Get approval

get/v1/approvals/{id}

One approval record, with its arguments. The agent link that asked (connectors.use), or its person from their own session or key: any other caller of the organization gets 404 approval_not_found, and a caller that is neither a link nor a person 403 agent_only.

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

Parameters

  • idpath · stringrequired

    The approval's id (apr_…)

Responses

200OKapplication/json

  • idstringrequired

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

  • connectorstringrequired
  • operationstringrequired
  • argumentsobjectrequired

    The call's body, as stored: what the person confirms, and what the write must send

  • argumentsHashstringrequired

    SHA-256 of the arguments' canonical JSON

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

  • status"pending" | "confirmed" | "denied" | "used" | "expired"required
  • expiredbooleanrequired

    Its expiry passed: it can no longer be confirmed or used

  • createdAtstring (date-time)required
  • expiresAtstring (date-time)required
  • decidedAtstring (date-time)
  • decidedBy"person" | "agent"

    Who decided it: the person (confirm or deny in Nexus), or the agent link that cancelled it

  • usedAtstring (date-time)
  • confirmUrlstring (uri)

    Nexus UI's page where the person confirms or denies it, when Gateway knows Nexus UI's URL (NEXUS_UI_URL)

403Neither an agent link nor a person (`agent_only`)application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

404No such approval of this link's or this person's (`approval_not_found`)application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

Errors

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
403agent_onlyAny other caller of the organization gets 404 `approval_not_found`, and a caller that is neither a link nor a person 403 `agent_only`
404not_foundNothing matches the path in your organization
404No such approval of this link's or this person's (`approval_not_found`)
404approval_not_foundAny other caller of the organization gets 404 `approval_not_found`, and a caller that is neither a link nor a person 403 `agent_only`
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/approvals/<id>" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Confirm approval

post/v1/approvals/{id}/confirm

The record's person confirms it, once, before it expires, from their own session in Nexus UI or their own key (approvals.decide). An agent link never confirms: it gets 403 person_only, so a link cannot approve its own write. Another person's record is 404 approval_not_found. Confirmed again, it answers the stored record. Refused while chat writes are off, and for an operation the allowlist does not name. Audited as policy.approval.confirmed, with the person as its actor.

approvals.decideEvery memberTry it in the API Explorer

Parameters

  • idpath · stringrequired

    The approval's id (apr_…)

  • Idempotency-Keyheader · string

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

Responses

200OKapplication/json

  • idstringrequired

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

  • connectorstringrequired
  • operationstringrequired
  • argumentsobjectrequired

    The call's body, as stored: what the person confirms, and what the write must send

  • argumentsHashstringrequired

    SHA-256 of the arguments' canonical JSON

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

  • status"pending" | "confirmed" | "denied" | "used" | "expired"required
  • expiredbooleanrequired

    Its expiry passed: it can no longer be confirmed or used

  • createdAtstring (date-time)required
  • expiresAtstring (date-time)required
  • decidedAtstring (date-time)
  • decidedBy"person" | "agent"

    Who decided it: the person (confirm or deny in Nexus), or the agent link that cancelled it

  • usedAtstring (date-time)
  • confirmUrlstring (uri)

    Nexus UI's page where the person confirms or denies it, when Gateway knows Nexus UI's URL (NEXUS_UI_URL)

403An agent link or another credential that is no person (`person_only`), chat writes are off (`chat_writes_off`), or the operation is not on the allowlist (`operation_not_allowed`)application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

404No such approval of this person's (`approval_not_found`)application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

409Expired (`approval_expired`), or already decided another way or used (`approval_settled`)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
403person_onlyIt gets 403 `person_only`, so a link cannot approve its own write
404not_foundNothing matches the path in your organization
404No such approval of this person's (`approval_not_found`)
404approval_not_foundAnother person's record is 404 `approval_not_found`
409Expired (`approval_expired`), or already decided another way or used (`approval_settled`)
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
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/approvals/<id>/confirm" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Deny approval

post/v1/approvals/{id}/deny

The record's person denies it, once, from their own session in Nexus UI or their own key (approvals.decide). An agent link gets 403 person_only and cancels instead. Another person's record is 404 approval_not_found. Denied again, it answers the stored record. Audited as policy.approval.denied.

approvals.decideEvery memberTry it in the API Explorer

Parameters

  • idpath · stringrequired

    The approval's id (apr_…)

  • Idempotency-Keyheader · string

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

Responses

200OKapplication/json

  • idstringrequired

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

  • connectorstringrequired
  • operationstringrequired
  • argumentsobjectrequired

    The call's body, as stored: what the person confirms, and what the write must send

  • argumentsHashstringrequired

    SHA-256 of the arguments' canonical JSON

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

  • status"pending" | "confirmed" | "denied" | "used" | "expired"required
  • expiredbooleanrequired

    Its expiry passed: it can no longer be confirmed or used

  • createdAtstring (date-time)required
  • expiresAtstring (date-time)required
  • decidedAtstring (date-time)
  • decidedBy"person" | "agent"

    Who decided it: the person (confirm or deny in Nexus), or the agent link that cancelled it

  • usedAtstring (date-time)
  • confirmUrlstring (uri)

    Nexus UI's page where the person confirms or denies it, when Gateway knows Nexus UI's URL (NEXUS_UI_URL)

403An agent link or another credential that is no person (`person_only`)application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

404No such approval of this person's (`approval_not_found`)application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

409Expired (`approval_expired`), or already decided another way or used (`approval_settled`)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
403person_onlyAn agent link gets 403 `person_only` and cancels instead
404not_foundNothing matches the path in your organization
404No such approval of this person's (`approval_not_found`)
404approval_not_foundAnother person's record is 404 `approval_not_found`
409Expired (`approval_expired`), or already decided another way or used (`approval_settled`)
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
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/approvals/<id>/deny" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Cancel approval

post/v1/approvals/{id}/cancel

The agent link that asked cancels its own pending record (connectors.use): it moves to denied, once. Cancelling never confirms, so it needs no person. Any other caller gets 403 agent_only, and another link's record is 404 approval_not_found. Cancelled again, it answers the stored record; a confirmed or used one is 409 approval_settled. Audited as policy.approval.cancelled.

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

Parameters

  • idpath · stringrequired

    The approval's id (apr_…)

  • Idempotency-Keyheader · string

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

Responses

200OKapplication/json

  • idstringrequired

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

  • connectorstringrequired
  • operationstringrequired
  • argumentsobjectrequired

    The call's body, as stored: what the person confirms, and what the write must send

  • argumentsHashstringrequired

    SHA-256 of the arguments' canonical JSON

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

  • status"pending" | "confirmed" | "denied" | "used" | "expired"required
  • expiredbooleanrequired

    Its expiry passed: it can no longer be confirmed or used

  • createdAtstring (date-time)required
  • expiresAtstring (date-time)required
  • decidedAtstring (date-time)
  • decidedBy"person" | "agent"

    Who decided it: the person (confirm or deny in Nexus), or the agent link that cancelled it

  • usedAtstring (date-time)
  • confirmUrlstring (uri)

    Nexus UI's page where the person confirms or denies it, when Gateway knows Nexus UI's URL (NEXUS_UI_URL)

403Not a chat agent's link (`agent_only`)application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

404No such approval of this link's (`approval_not_found`)application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

409Already confirmed or used (`approval_settled`)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
403agent_onlyAny other caller gets 403 `agent_only`, and another link's record is 404 `approval_not_found`
404not_foundNothing matches the path in your organization
404No such approval of this link's (`approval_not_found`)
404approval_not_foundAny other caller gets 403 `agent_only`, and another link's record is 404 `approval_not_found`
409Already confirmed or used (`approval_settled`)
409approval_settledCancelled again, it answers the stored record; a confirmed or used one is 409 `approval_settled`
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
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/approvals/<id>/cancel" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

List operator controls

get/v1/policies/controls

The operator controls in force (policy.read). Owners and admins see every unexpired control of the organization. A lead or member sees only the controls that apply to them: the organization's, those on every team they are in and the teams above them, their own and their key's. An expired control is not listed.

policy.readEvery memberTry it in the API Explorer

Responses

200OKapplication/json

  • controlsarray of OperatorControlrequired
    • idstringrequired
    • tenantIdstringrequired
    • kindstringrequired
    • subjectLevelstringrequired
    • subjectstring
    • modelsarray of string
    • reasonstringrequired
    • createdBystring
    • createdAtstringrequired
    • expiresAtstringrequired

403The credential does not hold `policy.read`. Every person in the organization holds it; a service account or sandbox key does not (`role_required`), nor a scoped module key (`module_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.

Errors

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
403model_not_allowedThe credential does not hold `policy.read`. Every person in the organization holds it; a service account or sandbox key does not (`role_required`), nor a scoped module key (`module_key`).
429rate_limit_errorToo many requests from this key in a minute

Example

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

Set operator control

post/v1/policies/controls

Put an operator control in force (owners and admins: policy.manage). A pause refuses every model call of its subject, a limit allows only the listed models and an override allows the listed models over the rules. A control expires at expiresAt and applies from the next decision. An unknown team, person or key answers 404. It is audited (policy.control_set).

policy.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

  • kind"pause" | "limit" | "override"required
  • level"organization" | "team" | "person" | "key"required
  • subjectstring

    A team's slug, a user id or a key id. Ignored for organization.

  • modelsarray of string

    Required for a limit or an override; not allowed for a pause.

  • reasonstringrequired
  • expiresAtstringrequired

    An ISO 8601 time in the future.

Responses

201Createdapplication/json

  • idstringrequired
  • tenantIdstringrequired
  • kindstringrequired
  • subjectLevelstringrequired
  • subjectstring
  • modelsarray of string
  • reasonstringrequired
  • createdBystring
  • createdAtstringrequired
  • expiresAtstringrequired

400Not a valid control (`invalid_control`): an unknown kind, level or model, no reason, an expiry in the past, models on a pause, or none on a limit or an override. Also when the organization already holds 200 live controls.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 caller does not hold `policy.manage`: only owners and admins set an organization-wide control (`role_required`). Team leads use the team's controls route.application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

404No such team, person or key in this organizationapplication/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule 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 a valid control (`invalid_control`): an unknown kind, level or model, no reason, an expiry in the past, models on a pause, or none on a limit or an override. Also when the organization already holds 200 live controls.
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
403model_not_allowedThe caller does not hold `policy.manage`: only owners and admins set an organization-wide control (`role_required`). Team leads use the team's controls route.
404No such team, person or key in this organization
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
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/policies/controls" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "kind": "pause",
    "level": "organization",
    "reason": "<reason>",
    "expiresAt": "<expiresAt>"
  }'

Clear operator control

DEL/v1/policies/controls/{id}

Take an operator control out of force (owners and admins: policy.manage). It answers with the cleared control. It is audited (policy.control_cleared).

policy.manageOwner, AdminTry it in the API Explorer

Parameters

  • idpath · stringrequired

    The control's id

  • Idempotency-Keyheader · string

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

Responses

200OKapplication/json

  • idstringrequired
  • tenantIdstringrequired
  • kindstringrequired
  • subjectLevelstringrequired
  • subjectstring
  • modelsarray of string
  • reasonstringrequired
  • createdBystring
  • createdAtstringrequired
  • expiresAtstringrequired

403The caller does not hold `policy.manage`: only owners and admins clear a control here (`role_required`). Team leads use the team's controls route.application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

404No such control in this organizationapplication/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule 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
403model_not_allowedThe caller does not hold `policy.manage`: only owners and admins clear a control here (`role_required`). Team leads use the team's controls route.
404not_foundNothing matches the path in your organization
404No such control in this organization
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
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X DELETE "$NEXUS_URL/v1/policies/controls/<id>" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

List team operator controls

get/v1/policies/teams/{slug}/controls

The operator controls in force on a team, on the teams under it, and on the people and keys in them (owners and admins; a team lead for a team they lead). Controls on the organization and on the teams above it are not listed. An expired control is not listed.

policy.manage_teamOwner, Admin, Team leadTry it in the API Explorer

Parameters

  • slugpath · stringrequired

Responses

200OKapplication/json

  • controlsarray of OperatorControlrequired
    • idstringrequired
    • tenantIdstringrequired
    • kindstringrequired
    • subjectLevelstringrequired
    • subjectstring
    • modelsarray of string
    • reasonstringrequired
    • createdBystring
    • createdAtstringrequired
    • expiresAtstringrequired

403The caller is not an owner, an admin or a team lead (`role_required`), or the team is not one they lead (`outside_led_teams`)application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

404No such team in this 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.

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 such team in this organization (`unknown_team`)
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/policies/teams/platform/controls" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Set team operator control

post/v1/policies/teams/{slug}/controls

Put an operator control in force on a team, or on a person or key in it or in a team under it (owners and admins; a team lead for a team they lead, who may pause or limit but not override). It works as setOperatorControl otherwise. It is audited (policy.control_set).

policy.manage_teamOwner, Admin, Team leadTry it in the API Explorer

Parameters

  • slugpath · stringrequired
  • Idempotency-Keyheader · string

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

Request body · application/json

  • kind"pause" | "limit" | "override"required
  • level"organization" | "team" | "person" | "key"required
  • subjectstring

    A team's slug, a user id or a key id. Ignored for organization.

  • modelsarray of string

    Required for a limit or an override; not allowed for a pause.

  • reasonstringrequired
  • expiresAtstringrequired

    An ISO 8601 time in the future.

Responses

201Createdapplication/json

  • idstringrequired
  • tenantIdstringrequired
  • kindstringrequired
  • subjectLevelstringrequired
  • subjectstring
  • modelsarray of string
  • reasonstringrequired
  • createdBystring
  • createdAtstringrequired
  • expiresAtstringrequired

400Not a valid control (`invalid_control`): an unknown kind, level or model, no reason, an expiry in the past, models on a pause, or none on a limit or an override. Also when the organization already holds 200 live controls.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 caller is not an owner, an admin or a team lead (`role_required`), the team is not one they lead (`outside_led_teams`), the subject is outside the team and the teams under it (`outside_team`), or a lead asked for an override (`override_needs_admin`)application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

404No such team in this organization (`unknown_team` for the team in the path), or no such team, person or key as the subjectapplication/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule 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 a valid control (`invalid_control`): an unknown kind, level or model, no reason, an expiry in the past, models on a pause, or none on a limit or an override. Also when the organization already holds 200 live controls.
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 such team in this organization (`unknown_team` for the team in the path), or no such team, person or key as the subject
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
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/policies/teams/platform/controls" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "kind": "pause",
    "level": "organization",
    "reason": "<reason>",
    "expiresAt": "<expiresAt>"
  }'

Clear team operator control

DEL/v1/policies/teams/{slug}/controls/{id}

Take an operator control on a team, or on a person or key in it or in a team under it, out of force (owners and admins; a team lead for a team they lead, only a control that lead set and never an override). It answers with the cleared control. It is audited (policy.control_cleared).

policy.manage_teamOwner, Admin, Team leadTry it in the API Explorer

Parameters

  • slugpath · stringrequired
  • idpath · stringrequired

    The control's id

  • Idempotency-Keyheader · string

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

Responses

200OKapplication/json

  • idstringrequired
  • tenantIdstringrequired
  • kindstringrequired
  • subjectLevelstringrequired
  • subjectstring
  • modelsarray of string
  • reasonstringrequired
  • createdBystring
  • createdAtstringrequired
  • expiresAtstringrequired

403The caller is not an owner, an admin or a team lead (`role_required`), the team is not one they lead (`outside_led_teams`), the control's subject is outside the team and the teams under it (`outside_team`), a lead tried to clear an override (`override_needs_admin`), or a lead tried to clear a control someone else set (`control_needs_admin`)application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

404No such team (`unknown_team`), or no such control in this organizationapplication/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule 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 such team (`unknown_team`), or no such control in this organization
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
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X DELETE "$NEXUS_URL/v1/policies/teams/platform/controls/<id>" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

List team keys

get/v1/policies/teams/{slug}/keys

The live API keys of the people in a team and the teams under it (owners and admins; a team lead for a team they lead). Key-minted CLI tokens are not listed. Lets a lead pick a key to pause or limit. It grants no revoke.

policy.manage_teamOwner, Admin, Team leadTry it in the API Explorer

Parameters

  • slugpath · stringrequired

Responses

200OKapplication/json

  • tokensarray of Token
    • idstringrequired
    • userIdstringrequired
    • kind"api" | "cli" | "ui"required
    • prefixstringrequired
    • labelstring
    • createdAtstring (date-time)required
    • expiresAtstring (date-time)
    • currentboolean
  • nextCursorstring

    Never set: this route returns every key in one page.

403The caller is not an owner, an admin or a team lead (`role_required`), the team is not one they lead (`outside_led_teams`), or the caller acts under an operator grant (`operator_scope`)application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

404No such team in this 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.

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 such team in this organization (`unknown_team`)
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/policies/teams/platform/keys" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Connect

post/v1/connections/{connector}

Connect an account with the connector's key form (GET /v1/connectors lists who may connect and the form). The vendor checks the key first; nothing it refuses is kept. scope: org connects the organization's account (owners and admins: policy.manage); otherwise it is yours, and the organization must have made the connector available to you. Connecting an account again replaces its credential. Audited as connector_credential.added or .replaced, with the last four characters only.

connections.manage_ownEvery memberTry it in the API Explorer

Parameters

  • connectorpath · stringrequired

    The connector (jira)

  • Idempotency-Keyheader · string

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

Request body · application/json

  • scope"user" | "org"

    default "user"

Responses

200OKapplication/json

  • connectionsarray of Connectionrequired
    • connectorstringrequired
    • scope"user" | "org"required

      A person's own (user) or the organization's (org)

    • scopeIdstringrequired

      The person's user id, or the organization's id

    • accountstringrequired

      The vendor's stable id for the account (an Atlassian cloud id)

    • namestringrequired

      The account's name, as a call's account may name it

    • dataobject

      What reaches the account and is not secret (its host)

    • identitystring

      Who the vendor says the holder is there

    • status"active" | "needs_reconnect"required
    • suspendedbooleanrequired

      Its connector is in preview and this Gateway does not offer it: no call uses the connection until the connector is offered. It can still be disconnected

    • kind"api_key" | "basic" | "oauth2" | "installation"required
    • last4string

      The last four characters of its secret; never the secret

    • scopesarray of string
    • expiresAtstring (date-time)
    • createdAtstring (date-time)required

400A field the form does not take, a host the vendor does not serve, or a key the vendor refused (`credential_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.

403The organization's needs an owner or admin (`role_required`); the connector is not available to you (`connector_disabled`)application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

404No such connectorapplication/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

429The vendor is rate limiting the check (`rate_limited`, with `retry_after`)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 vendor failed the check (`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.

Errors

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
400A field the form does not take, a host the vendor does not serve, or a key the vendor refused (`credential_refused`)
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 such connector
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
429The vendor is rate limiting the check (`rate_limited`, with `retry_after`)
429rate_limit_errorToo many requests from this key in a minute
502The vendor failed the check (`upstream_error`)

Example

curl
curl -X POST "$NEXUS_URL/v1/connections/<connector>" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "scope": "user"
  }'

List connections

get/v1/connections

Your own live connections and the organization's (what it may lend), never a secret. The organization's GitHub App installations are listed too, as its github connections (the account is the installation id). A member sees the organization's without whose account it is or its last four characters.

connections.manage_ownEvery memberTry it in the API Explorer

Responses

200OKapplication/json

  • connectionsarray of Connectionrequired
    • connectorstringrequired
    • scope"user" | "org"required

      A person's own (user) or the organization's (org)

    • scopeIdstringrequired

      The person's user id, or the organization's id

    • accountstringrequired

      The vendor's stable id for the account (an Atlassian cloud id)

    • namestringrequired

      The account's name, as a call's account may name it

    • dataobject

      What reaches the account and is not secret (its host)

    • identitystring

      Who the vendor says the holder is there

    • status"active" | "needs_reconnect"required
    • suspendedbooleanrequired

      Its connector is in preview and this Gateway does not offer it: no call uses the connection until the connector is offered. It can still be disconnected

    • kind"api_key" | "basic" | "oauth2" | "installation"required
    • last4string

      The last four characters of its secret; never the secret

    • scopesarray of string
    • expiresAtstring (date-time)
    • createdAtstring (date-time)required

Errors

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
429rate_limit_errorToo many requests from this key in a minute

Example

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

Disconnect

DEL/v1/connections/{connector}/{account}

Disconnect your own connection to an account (or, with scope=org, the organization's: owners and admins). The account is named by its id, name or host. Its credential is revoked once no live connection uses it; an OAuth grant is then revoked at the vendor too, and vendorRevoked says whether the vendor confirmed it. Audited as connector_credential.revoked.

connections.manage_ownEvery memberTry it in the API Explorer

Parameters

  • connectorpath · stringrequired
  • accountpath · stringrequired

    The account's id, name or host

  • scopequery · "user" | "org"
  • Idempotency-Keyheader · string

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

Responses

200OKapplication/json

object

400The connector takes no connection at that scope: a GitHub installation is unlinked with DELETE /v1/github/installations/{id}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 live connection to that accountapplication/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule 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 connector takes no connection at that scope: a GitHub installation is unlinked with DELETE /v1/github/installations/{id}
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 live connection to that account
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
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X DELETE "$NEXUS_URL/v1/connections/<connector>/<account>" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Start oauth connection

post/v1/connections/{connector}/oauth

Start connecting an account with OAuth: the vendor's authorize URL, good once for ten minutes. scope: org connects the organization's (owners and admins); otherwise it is yours, and the organization must have made the connector available to you. The vendor returns the person to Nexus UI, which finishes with POST /v1/connections/oauth/finish.

connections.manage_ownEvery memberTry it in the API Explorer

Parameters

  • connectorpath · stringrequired

    The connector (notion)

  • Idempotency-Keyheader · string

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

Request body (optional) · application/json

  • scope"user" | "org"

    default "user"

  • access"read" | "write"

    Only when the server asks for write scopes on demand (NEXUS_CONNECTOR_WRITE_CONSENT); otherwise refused with 400. read asks the vendor for the connector's reads only. write asks for its reads and its write scopes: send it after a write answered 403 write_consent_required. The new tokens replace the connection's.

    default "read"

Responses

200OKapplication/json

  • authorizeUrlstring (uri)required

403The organization's needs an owner or admin (`role_required`); the connector is not available to you (`connector_disabled`)application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

404No such connectorapplication/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule of a model refusal, the seconds of a 408.

    • minimumstring

      On a 426 cli_too_old only: the oldest nexus CLI version Gateway supports.

503This gateway has no OAuth app for the connector (`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
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 such connector
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
429rate_limit_errorToo many requests from this key in a minute
503This gateway has no OAuth app for the connector (`not_configured`)

Example

curl
curl -X POST "$NEXUS_URL/v1/connections/<connector>/oauth" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "scope": "user",
    "access": "read"
  }'

Finish oauth connection

post/v1/connections/oauth/finish

Finish connecting an account with OAuth: the vendor returned the person to Nexus UI (/settings/connectors/oauth), which hands back its code (or error) and state with the person's session. Only the person who started may finish, so an authorize link sent to someone else connects nothing; availability and role are checked again. The tokens are kept for the holder the state names.

connections.manage_ownEvery memberTry 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

  • statestringrequired
  • codestring
  • errorstring
  • realmIdstring

    The company QuickBooks names on its return, which Gateway checks with the new token. Another vendor's return adds nothing.

Responses

200OKapplication/json

  • connectorstring
  • connectionsarray of Connection
    • connectorstringrequired
    • scope"user" | "org"required

      A person's own (user) or the organization's (org)

    • scopeIdstringrequired

      The person's user id, or the organization's id

    • accountstringrequired

      The vendor's stable id for the account (an Atlassian cloud id)

    • namestringrequired

      The account's name, as a call's account may name it

    • dataobject

      What reaches the account and is not secret (its host)

    • identitystring

      Who the vendor says the holder is there

    • status"active" | "needs_reconnect"required
    • suspendedbooleanrequired

      Its connector is in preview and this Gateway does not offer it: no call uses the connection until the connector is offered. It can still be disconnected

    • kind"api_key" | "basic" | "oauth2" | "installation"required
    • last4string

      The last four characters of its secret; never the secret

    • scopesarray of string
    • expiresAtstring (date-time)
    • createdAtstring (date-time)required

400No state (`oauth_state_missing`); a state Nexus did not issue, not yours, or already finished (`oauth_state_invalid`); the person declined (`oauth_denied`); the vendor refused the code, or the account it names (`credential_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.

403The organization's needs an owner or admin (`role_required`); the connector is no longer available to you (`connector_disabled`)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.

409Your state is older than ten minutes (`oauth_state_invalid`): connect againapplication/json

  • errorobject
    • messagestringrequired
    • typestringrequired

      The class of the error: invalid_request_error (400, 405, 408, 409, 413, 422, 426), authentication_error (401), billing_error (402), permission_error (403), not_found (404), rate_limit_error (429), or a 5xx type such as server_error.

    • codestring

      Stable: branch on it, not on message. Every 4xx carries one: its site's own code, else the default for its status (400 invalid_request, 401 unauthenticated, 402 payment_required, 403 forbidden, 404 not_found, 405 method_not_allowed, 408 request_timeout, 409 conflict, 422 unprocessable, 429 rate_limited, any other 4xx invalid_request). A 502 carries its site's code, else upstream_error. Any other 5xx carries one only when its site sets it. The agent routes (/v1/anthropic/, /v1/openai/) answer in the provider's shape.

    • paramstring

      model when the error is a model refusal (a code starting with model_); absent otherwise.

    • nexusobject

      Details of the error, when it has any: the policy rule 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
400No state (`oauth_state_missing`); a state Nexus did not issue, not yours, or already finished (`oauth_state_invalid`); the person declined (`oauth_denied`); the vendor refused the code, or the account it names (`credential_refused`)
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
409Your state is older than ten minutes (`oauth_state_invalid`): connect 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
422idempotency_key_reusedThe Idempotency-Key was used with a different request
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/connections/oauth/finish" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "state": "…"
  }'