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

API reference

Chat sessions

Chat sessions, Nexus UI's home and nexus chat. Two modes: Chat, with any model you may use, and Ask your code, grounded in your organization's Nexus Wiki. Sessions are private to their author; messages are kept for the organization's retention window (90 days by default, GET/PUT /v1/orgs/settings).

View as Markdown

List chat sessions

get/v1/chat/sessions

Your own chat sessions, most recently active first, a page at a time. Private: nobody else's are listed, for owners and admins too.

chat.useEvery memberTry it in the API Explorer

Parameters

  • limitquery · integer
  • cursorquery · string

    NextCursor of the previous page

  • qquery · string

    Words in the title or the messages

  • archivedquery · "exclude" | "include" | "only"

Responses

200OKapplication/json

  • sessionsarray of ChatSessionrequired
    • idstringrequired
    • titlestringrequired

      The first question until you rename it

    • mode"chat" | "ask"required

      chat with any model you may use; ask (Ask your code) answers from your organization's Nexus Wiki, citing its pages

    • modelstringrequired

      The model asked for: nexus/auto by default

    • lastModelstring

      The model that ran last

    • teamstring

      The team its spend is attributed to

    • archivedbooleanrequired
    • webSearchboolean

      Whether the model may search the web in this session (default false)

    • messageCountintegerrequired
    • costUsdnumberrequired

      The sum of its model calls and of the web searches that returned results, settled in the ledger; a search that fails after the provider billed it is in the ledger, not in this sum

    • createdAtstring (date-time)required
    • updatedAtstring (date-time)required
    • visibility"private" | "shared"

      Private (the default) or shared: at least one active artifact

    • sharingChatSessionSharing

      How a shared session is shared: its newest active artifact

      • artifactIdstringrequired
      • versionintegerrequired
      • audienceArtifactAudiencerequired

        Who may read an artifact, besides its author: inside the organization, the whole organization, chosen teams (their members and the members of the teams under them) or chosen people; outside it, named people by email (external) or anyone with the link (public). Readers outside the organization see the kind only.

        • kind"org" | "teams" | "people" | "external" | "public"required
        • teamsarray of stringrequired

          Team slugs (kind teams)

        • peoplearray of stringrequired

          Members' emails (kind people); the outsiders with access (kind external). Empty for readers outside the organization.

      • allowContinuebooleanrequired
      • urlstringrequired

        The link to hand out: a public link (kind public), the fast viewer (kind external), else the artifact in Nexus UI; absolute when the Gateway knows Nexus UI's URL (NEXUS_UI_URL), else a path

      • pathstringrequired

        /app/<org>/artifacts/<id>

      • viewerUrlstring

        The fast viewer: <origin>/a/<id>

      • publicUrlstring

        Kind public: <origin>/a/<token>

      • expiresAtstring (date-time)

        Kind public: when the link stops opening

    • artifactsarray of ArtifactLink

      Every version shared from this session, newest first (revoked ones included)

      • idstringrequired
      • versionintegerrequired

        min 1

      • status"active" | "revoked"required
      • audience"org" | "teams" | "people" | "external" | "public"required
      • createdAtstring (date-time)required
      • revokedAtstring (date-time)
    • authorArtifactAuthor

      You (listed and read sessions)

      • emailstring
      • namestring
    • forkedFromobject

      The artifact this session continues (POST /v1/artifacts/{id}/continue)

      • artifactIdstringrequired
      • versionintegerrequired
      • titlestring
  • nextCursorstring

400A query parameter is not valid: `limit` is not 1 to the page maximum, `cursor` is not one this API returned, or `archived` is not exclude, include or 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.

401No credential (`missing_credential`), or a credential Gateway does not accept (`invalid_credential`).application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

403The key does not hold `chat.use` (`role_required`: a service account, a sandbox, or an agent not granted it), or the caller is not a person, such as a module key (`person_required`).application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

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

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

Errors

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
400A query parameter is not valid: `limit` is not 1 to the page maximum, `cursor` is not one this API returned, or `archived` is not exclude, include or only.
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/chat/sessions" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Create chat session

post/v1/chat/sessions

Start a chat session. It is yours alone; its spend goes to you, the team (named, else your default) and the product chat. Audited as chat.session_created (never the title).

chat.useEvery 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 (optional) · application/json

  • titlestring

    Default: the first question

    max length 120

  • mode"chat" | "ask"

    chat with any model you may use; ask (Ask your code) answers from your organization's Nexus Wiki, citing its pages

  • modelstring

    Nexus/auto (default), nexus/default or a catalog id; whether you may use it is decided on each message

  • teamstring

    A team slug you are in

  • webSearchboolean

    Whether the model may search the web in this chat. It takes effect only while the organization's webSearch.engine is on

    default false

Responses

201Createdapplication/json

  • idstringrequired
  • titlestringrequired

    The first question until you rename it

  • mode"chat" | "ask"required

    chat with any model you may use; ask (Ask your code) answers from your organization's Nexus Wiki, citing its pages

  • modelstringrequired

    The model asked for: nexus/auto by default

  • lastModelstring

    The model that ran last

  • teamstring

    The team its spend is attributed to

  • archivedbooleanrequired
  • webSearchboolean

    Whether the model may search the web in this session (default false)

  • messageCountintegerrequired
  • costUsdnumberrequired

    The sum of its model calls and of the web searches that returned results, settled in the ledger; a search that fails after the provider billed it is in the ledger, not in this sum

  • createdAtstring (date-time)required
  • updatedAtstring (date-time)required
  • visibility"private" | "shared"

    Private (the default) or shared: at least one active artifact

  • sharingChatSessionSharing

    How a shared session is shared: its newest active artifact

    • artifactIdstringrequired
    • versionintegerrequired
    • audienceArtifactAudiencerequired

      Who may read an artifact, besides its author: inside the organization, the whole organization, chosen teams (their members and the members of the teams under them) or chosen people; outside it, named people by email (external) or anyone with the link (public). Readers outside the organization see the kind only.

      • kind"org" | "teams" | "people" | "external" | "public"required
      • teamsarray of stringrequired

        Team slugs (kind teams)

      • peoplearray of stringrequired

        Members' emails (kind people); the outsiders with access (kind external). Empty for readers outside the organization.

    • allowContinuebooleanrequired
    • urlstringrequired

      The link to hand out: a public link (kind public), the fast viewer (kind external), else the artifact in Nexus UI; absolute when the Gateway knows Nexus UI's URL (NEXUS_UI_URL), else a path

    • pathstringrequired

      /app/<org>/artifacts/<id>

    • viewerUrlstring

      The fast viewer: <origin>/a/<id>

    • publicUrlstring

      Kind public: <origin>/a/<token>

    • expiresAtstring (date-time)

      Kind public: when the link stops opening

  • artifactsarray of ArtifactLink

    Every version shared from this session, newest first (revoked ones included)

    • idstringrequired
    • versionintegerrequired

      min 1

    • status"active" | "revoked"required
    • audience"org" | "teams" | "people" | "external" | "public"required
    • createdAtstring (date-time)required
    • revokedAtstring (date-time)
  • authorArtifactAuthor

    You (listed and read sessions)

    • emailstring
    • namestring
  • forkedFromobject

    The artifact this session continues (POST /v1/artifacts/{id}/continue)

    • artifactIdstringrequired
    • versionintegerrequired
    • titlestring

400The body is not valid: `title` over 120 characters, `mode` not chat or ask, a `model` that is not a string, `webSearch` not a boolean, `team` not a slug, or a bad `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 key does not hold `chat.use` (`role_required`: a service account, a sandbox, or an agent not granted it), the caller is not a person (`person_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.

404The team named does not exist 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.

409The `Idempotency-Key`'s first request still runs (`idempotency_in_progress`) or was interrupted (`idempotency_interrupted`). The request does not run again.application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

422The `Idempotency-Key` was used for a different request (`idempotency_key_reused`).application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

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

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

Errors

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
400The body is not valid: `title` over 120 characters, `mode` not chat or ask, a `model` that is not a string, `webSearch` not a boolean, `team` not a slug, or a bad `Idempotency-Key`.
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
404The team named does not exist in this organization (`unknown_team`).
409The `Idempotency-Key`'s first request still runs (`idempotency_in_progress`) or was interrupted (`idempotency_interrupted`). The request does not run again.
409idempotency_in_progressA request with the same Idempotency-Key is still running
409idempotency_interruptedThe first request with this Idempotency-Key was cut off and may have run in part
422The `Idempotency-Key` was used for a different request (`idempotency_key_reused`).
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/chat/sessions" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "<title>",
    "mode": "chat",
    "model": "<model>",
    "team": "platform",
    "webSearch": false
  }'

Get chat session

get/v1/chat/sessions/{id}

One of your sessions with its messages, oldest first. Anyone else's session is 404.

chat.useEvery memberTry it in the API Explorer

Parameters

  • idpath · stringrequired

    The session's id (chs_…)

Responses

200OKapplication/json

  • idstringrequired
  • titlestringrequired

    The first question until you rename it

  • mode"chat" | "ask"required

    chat with any model you may use; ask (Ask your code) answers from your organization's Nexus Wiki, citing its pages

  • modelstringrequired

    The model asked for: nexus/auto by default

  • lastModelstring

    The model that ran last

  • teamstring

    The team its spend is attributed to

  • archivedbooleanrequired
  • webSearchboolean

    Whether the model may search the web in this session (default false)

  • messageCountintegerrequired
  • costUsdnumberrequired

    The sum of its model calls and of the web searches that returned results, settled in the ledger; a search that fails after the provider billed it is in the ledger, not in this sum

  • createdAtstring (date-time)required
  • updatedAtstring (date-time)required
  • visibility"private" | "shared"

    Private (the default) or shared: at least one active artifact

  • sharingChatSessionSharing

    How a shared session is shared: its newest active artifact

    • artifactIdstringrequired
    • versionintegerrequired
    • audienceArtifactAudiencerequired

      Who may read an artifact, besides its author: inside the organization, the whole organization, chosen teams (their members and the members of the teams under them) or chosen people; outside it, named people by email (external) or anyone with the link (public). Readers outside the organization see the kind only.

      • kind"org" | "teams" | "people" | "external" | "public"required
      • teamsarray of stringrequired

        Team slugs (kind teams)

      • peoplearray of stringrequired

        Members' emails (kind people); the outsiders with access (kind external). Empty for readers outside the organization.

    • allowContinuebooleanrequired
    • urlstringrequired

      The link to hand out: a public link (kind public), the fast viewer (kind external), else the artifact in Nexus UI; absolute when the Gateway knows Nexus UI's URL (NEXUS_UI_URL), else a path

    • pathstringrequired

      /app/<org>/artifacts/<id>

    • viewerUrlstring

      The fast viewer: <origin>/a/<id>

    • publicUrlstring

      Kind public: <origin>/a/<token>

    • expiresAtstring (date-time)

      Kind public: when the link stops opening

  • artifactsarray of ArtifactLink

    Every version shared from this session, newest first (revoked ones included)

    • idstringrequired
    • versionintegerrequired

      min 1

    • status"active" | "revoked"required
    • audience"org" | "teams" | "people" | "external" | "public"required
    • createdAtstring (date-time)required
    • revokedAtstring (date-time)
  • authorArtifactAuthor

    You (listed and read sessions)

    • emailstring
    • namestring
  • forkedFromobject

    The artifact this session continues (POST /v1/artifacts/{id}/continue)

    • artifactIdstringrequired
    • versionintegerrequired
    • titlestring
  • messagesarray of ChatSessionMessagerequired
    • idstringrequired
    • sessionIdstringrequired
    • role"user" | "assistant"required
    • contentstringrequired

      Markdown (a question with images may have none)

    • status"complete" | "failed" | "refused"required

      Refused: the policy or budget refused the call (error says why); failed: it broke mid-way (content is what arrived)

    • mode"chat" | "ask"

      chat with any model you may use; ask (Ask your code) answers from your organization's Nexus Wiki, citing its pages

    • requestedModelstring
    • modelstring

      The model that ran

    • costUsdnumber
    • usageobject
      • promptTokensinteger
      • completionTokensinteger
    • citationsarray of ChatCitation
      • nintegerrequired

        The number the answer cites it by

      • repostringrequired

        Owner/name

      • pagestringrequired
      • slugstringrequired
      • sectionstring
      • pathstringrequired

        <slug>#<anchor> in the repository's wiki

      • filesarray of string

        Repository files the section names

      • runIdstringrequired

        The Nexus Wiki run that wrote the page

    • errorobject
      • codestring
      • messagestring
      • statusinteger
      • notifiedboolean

        A budget refusal told the organization's owners and admins (licensed build). Absent otherwise.

      • remainingUsdDecimalstring

        A budget refusal's remainingUsdDecimal: what was left of that level's budget, as an exact decimal. Absent when the 402 had none.

      • requestedUsdstring

        A usage-limit refusal's (usage_limit_reached) requestedUsd: the most the call may cost with Nexus's rate, as an exact decimal. Absent for any other refusal, or when the 402 had none.

      • remainingUsdstring

        A usage-limit refusal's (usage_limit_reached) remainingUsd: what this month's usage limit had left, as an exact decimal. Absent for any other refusal, or when the 402 had none.

      • detailsobject

        A 402's details, as the live error's error.nexus had them, cut to an allow-list: short codes, ways forward, notified and decimal dollar amounts. Absent for any other status, when none was kept, and on an answer stored before it.

        • reasonstring

          Why the refusal happened, such as authentication_required or disputed for payment_failed.

        • levelstring

          A budget refusal's level.

        • freeStartstring

          cheaper_models_only when the free start pays for cheaper models only.

        • nextarray of string

          The ways forward, such as billing and own_key; at most 4.

        • notifiedboolean

          The organization's owners and admins were told.

        • owedUsdstring
        • unpaidUsdstring
        • remainingUsdstring
        • remainingUsdDecimalstring
        • requestedUsdstring
        • limitUsdstring
        • chargeUsdstring
        • capUsdstring
    • createdAtstring (date-time)required
    • attachmentsarray of ChatAttachmentRef

      The images attached to a question

      • idstringrequired
      • type"image" | "file"required
      • mediaType"image/png" | "image/jpeg" | "image/gif" | "image/webp" | "text/csv" | "text/tab-separated-values" | "application/json" | "text/plain" | "text/markdown" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"required

        An image's from the bytes, not as it was named; a data file's from its extension, checked against the bytes

      • bytesintegerrequired
      • widthinteger
      • heightinteger
      • namestring
    • pageChatPageBlock

      A page this answer created or revised through write_page

      • pageIdstringrequired
      • versionintegerrequired

        min 1

      • titlestringrequired
      • format"html" | "md" | "jsx" | "sheet" | "board"required
    • skillsarray of ChatSkillBlock

      The skills this answer loaded through load_skill, in the order it loaded them. The file stays in the skills store

      • skillIdstringrequired

        Skl_… For a library skill, the library skill's id, which getSkill and getSkillVersion also take

      • namestringrequired

        The name the version had when it was served

      • versionintegerrequired

        The version served: a personal skill's latest, or a library skill's latest approved version that nobody withdrew

        min 1

      • scope"personal" | "team" | "org"

        Where the skill came from: your own skills, a team's library, or the organization's. Left out on an answer stored before skills had a scope: read it as personal

      • teamIdstring

        The team (team_…), for scope team. Map it to the team's name with listTeams

    • connectorsarray of ChatConnectorBlock

      The connector reads this answer ran through read_connector, in order. What they returned is never kept. In a shared artifact, a reader sees only the reads of connectors they may use

      • connectorstringrequired
      • operationstringrequired
      • inputobjectrequired
      • accountobject

        The connection the read ran with: whose it is and the account's name. Absent while the read streams, and on reads kept before it was recorded

        • scope"org" | "team" | "user"required
        • namestringrequired
    • sourcesarray of ChatWebSource

      The web pages this answer's searches gave the model, one per URL, in the order they were found. Only the session's author reads them; a shared artifact keeps none

      • titlestringrequired
      • urlstringrequired
      • datestring

        The page's date as the engine gave it, cut as the model read it

      • querystringrequired

        The first query in the turn that found this page

    • rewoundboolean

      Retained for the author, but excluded from future model context after a conversation rewind.

404No such session among yours (`chat_session_not_found`): someone else's session answers the same.application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

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

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

Errors

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
404not_foundNothing matches the path in your organization
404No such session among yours (`chat_session_not_found`): someone else's session answers the same.
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/chat/sessions/<id>" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Update chat session

patch/v1/chat/sessions/{id}

Rename, archive or restore a session, or change the model, mode, web search switch or team its next messages use.

chat.useEvery memberTry it in the API Explorer

Parameters

  • idpath · stringrequired

    The session's id (chs_…)

  • Idempotency-Keyheader · string

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

Request body · application/json

  • titlestring

    max length 120

  • archivedboolean
  • modelstring
  • mode"chat" | "ask"

    chat with any model you may use; ask (Ask your code) answers from your organization's Nexus Wiki, citing its pages

  • teamstring | null
  • webSearchboolean

    Whether the model may search the web in this chat. It takes effect only while the organization's webSearch.engine is on

Responses

200OKapplication/json

  • idstringrequired
  • titlestringrequired

    The first question until you rename it

  • mode"chat" | "ask"required

    chat with any model you may use; ask (Ask your code) answers from your organization's Nexus Wiki, citing its pages

  • modelstringrequired

    The model asked for: nexus/auto by default

  • lastModelstring

    The model that ran last

  • teamstring

    The team its spend is attributed to

  • archivedbooleanrequired
  • webSearchboolean

    Whether the model may search the web in this session (default false)

  • messageCountintegerrequired
  • costUsdnumberrequired

    The sum of its model calls and of the web searches that returned results, settled in the ledger; a search that fails after the provider billed it is in the ledger, not in this sum

  • createdAtstring (date-time)required
  • updatedAtstring (date-time)required
  • visibility"private" | "shared"

    Private (the default) or shared: at least one active artifact

  • sharingChatSessionSharing

    How a shared session is shared: its newest active artifact

    • artifactIdstringrequired
    • versionintegerrequired
    • audienceArtifactAudiencerequired

      Who may read an artifact, besides its author: inside the organization, the whole organization, chosen teams (their members and the members of the teams under them) or chosen people; outside it, named people by email (external) or anyone with the link (public). Readers outside the organization see the kind only.

      • kind"org" | "teams" | "people" | "external" | "public"required
      • teamsarray of stringrequired

        Team slugs (kind teams)

      • peoplearray of stringrequired

        Members' emails (kind people); the outsiders with access (kind external). Empty for readers outside the organization.

    • allowContinuebooleanrequired
    • urlstringrequired

      The link to hand out: a public link (kind public), the fast viewer (kind external), else the artifact in Nexus UI; absolute when the Gateway knows Nexus UI's URL (NEXUS_UI_URL), else a path

    • pathstringrequired

      /app/<org>/artifacts/<id>

    • viewerUrlstring

      The fast viewer: <origin>/a/<id>

    • publicUrlstring

      Kind public: <origin>/a/<token>

    • expiresAtstring (date-time)

      Kind public: when the link stops opening

  • artifactsarray of ArtifactLink

    Every version shared from this session, newest first (revoked ones included)

    • idstringrequired
    • versionintegerrequired

      min 1

    • status"active" | "revoked"required
    • audience"org" | "teams" | "people" | "external" | "public"required
    • createdAtstring (date-time)required
    • revokedAtstring (date-time)
  • authorArtifactAuthor

    You (listed and read sessions)

    • emailstring
    • namestring
  • forkedFromobject

    The artifact this session continues (POST /v1/artifacts/{id}/continue)

    • artifactIdstringrequired
    • versionintegerrequired
    • titlestring

404No such session among yours (`chat_session_not_found`): someone else's session answers the same.application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

      Details of the error, when it has any: the policy rule 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
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 session among yours (`chat_session_not_found`): someone else's session answers the same.
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 PATCH "$NEXUS_URL/v1/chat/sessions/<id>" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "<title>",
    "archived": false,
    "model": "<model>",
    "mode": "chat",
    "team": "platform",
    "webSearch": false
  }'

Delete chat session

DEL/v1/chat/sessions/{id}

Delete a session and its messages. Audited as chat.session_deleted (never the content).

chat.useEvery memberTry it in the API Explorer

Parameters

  • idpath · stringrequired

    The session's id (chs_…)

  • Idempotency-Keyheader · string

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

Responses

200OKapplication/json

  • deletedboolean
  • idstring
  • messagesinteger

404No such session among yours (`chat_session_not_found`): someone else's session answers the same.application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

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

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

Errors

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
404not_foundNothing matches the path in your organization
404No such session among yours (`chat_session_not_found`): someone else's session answers the same.
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 DELETE "$NEXUS_URL/v1/chat/sessions/<id>" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Send chat message

post/v1/chat/sessions/{id}/messages

Send a message; the answer streams as server-sent events (OpenAI chat.completion.chunk; stream: false answers with JSON). The call takes the same path as /v1/chat/completions: the model policy decision (nexus/auto by default), the ledger's reserve and settle, attribution to you, your team and chat. Ask your code ranks your organization's Nexus Wiki sections (BM25) and cites them. A refusal is stored in the session and answered before any stream: 403 model_not_allowed (naming the level and rule), 402 budget_exceeded or payment_past_due; error.nexus names the session and the stored message. With an Idempotency-Key a message runs at most once; a finished stream is not replayed (409 idempotency_stream_replay). With images a question carries up to 8 images, PNG, JPEG, GIF or WebP by their bytes, at most 5 MB each and 20 MB in all; content may then be empty. They go to the model with the question (and with the next ones while they are among the last two questions that had any) and are stored beside it: the message lists them in attachments, and getChatAttachment returns their bytes. 400 invalid_image, 413 image_too_large, 400 model_no_image_input for a model that does not read images.

chat.useEvery memberTry it in the API Explorer

Parameters

  • idpath · stringrequired

    The session's id (chs_…)

  • x-nexus-teamheader · string

    The team (slug) this message's spend goes to; you must be in it. Default: the session's team.

  • Idempotency-Keyheader · string

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

Request body · application/json

  • contentstringrequired

    The question; may be empty when images or files has at least one

    max length 32000

  • imagesarray of ChatImageInput

    Images that go with the question.

    at most 8 items

    • datastringrequired

      The image as base64, or a data:image/…;base64,… URL

    • namestring

      Its file name, shown with it

      max length 200

  • filesarray of ChatFileInput

    Data files that go with the question: the model reads a text file's text, and a page written in this chat keeps a copy. With the images, at most 20 MB.

    at most 8 items

    • datastringrequired

      Standard base64, or a data: URL

    • namestringrequired

      With its extension. The name a page reads it by

      max length 200

  • modelstring

    For this message and the next ones

  • mode"chat" | "ask"

    chat with any model you may use; ask (Ask your code) answers from your organization's Nexus Wiki, citing its pages

  • teamstring
  • streamboolean

    default true

Responses

200The answer: an event stream, or with stream false the stored question and answertext/event-stream

  • idstring
  • object"chat.completion.chunk"
  • createdinteger
  • modelstring | null

    The model that runs

  • choicesarray of object
    • indexinteger
    • deltaobject
      • rolestring
      • contentstring
    • finish_reasonstring | null
  • usageobject
    • prompt_tokensinteger
    • completion_tokensinteger
    • total_tokensinteger
  • nexusobject
    • sessionChatSession

      A chat session, private to its author unless shared as an artifact.

      • idstringrequired
      • titlestringrequired

        The first question until you rename it

      • mode"chat" | "ask"required

        chat with any model you may use; ask (Ask your code) answers from your organization's Nexus Wiki, citing its pages

      • modelstringrequired

        The model asked for: nexus/auto by default

      • lastModelstring

        The model that ran last

      • teamstring

        The team its spend is attributed to

      • archivedbooleanrequired
      • webSearchboolean

        Whether the model may search the web in this session (default false)

      • messageCountintegerrequired
      • costUsdnumberrequired

        The sum of its model calls and of the web searches that returned results, settled in the ledger; a search that fails after the provider billed it is in the ledger, not in this sum

      • createdAtstring (date-time)required
      • updatedAtstring (date-time)required
      • visibility"private" | "shared"

        Private (the default) or shared: at least one active artifact

      • sharingChatSessionSharing

        How a shared session is shared: its newest active artifact

        • artifactIdstringrequired
        • versionintegerrequired
        • audienceArtifactAudiencerequired

          Who may read an artifact, besides its author: inside the organization, the whole organization, chosen teams (their members and the members of the teams under them) or chosen people; outside it, named people by email (external) or anyone with the link (public). Readers outside the organization see the kind only.

          • kind"org" | "teams" | "people" | "external" | "public"required
          • teamsarray of stringrequired

            Team slugs (kind teams)

          • peoplearray of stringrequired

            Members' emails (kind people); the outsiders with access (kind external). Empty for readers outside the organization.

        • allowContinuebooleanrequired
        • urlstringrequired

          The link to hand out: a public link (kind public), the fast viewer (kind external), else the artifact in Nexus UI; absolute when the Gateway knows Nexus UI's URL (NEXUS_UI_URL), else a path

        • pathstringrequired

          /app/<org>/artifacts/<id>

        • viewerUrlstring

          The fast viewer: <origin>/a/<id>

        • publicUrlstring

          Kind public: <origin>/a/<token>

        • expiresAtstring (date-time)

          Kind public: when the link stops opening

      • artifactsarray of ArtifactLink

        Every version shared from this session, newest first (revoked ones included)

        • idstringrequired
        • versionintegerrequired

          min 1

        • status"active" | "revoked"required
        • audience"org" | "teams" | "people" | "external" | "public"required
        • createdAtstring (date-time)required
        • revokedAtstring (date-time)
      • authorArtifactAuthor

        You (listed and read sessions)

        • emailstring
        • namestring
      • forkedFromobject

        The artifact this session continues (POST /v1/artifacts/{id}/continue)

        • artifactIdstringrequired
        • versionintegerrequired
        • titlestring
    • questionChatSessionMessage
      • idstringrequired
      • sessionIdstringrequired
      • role"user" | "assistant"required
      • contentstringrequired

        Markdown (a question with images may have none)

      • status"complete" | "failed" | "refused"required

        Refused: the policy or budget refused the call (error says why); failed: it broke mid-way (content is what arrived)

      • mode"chat" | "ask"

        chat with any model you may use; ask (Ask your code) answers from your organization's Nexus Wiki, citing its pages

      • requestedModelstring
      • modelstring

        The model that ran

      • costUsdnumber
      • usageobject
        • promptTokensinteger
        • completionTokensinteger
      • citationsarray of ChatCitation
        • nintegerrequired

          The number the answer cites it by

        • repostringrequired

          Owner/name

        • pagestringrequired
        • slugstringrequired
        • sectionstring
        • pathstringrequired

          <slug>#<anchor> in the repository's wiki

        • filesarray of string

          Repository files the section names

        • runIdstringrequired

          The Nexus Wiki run that wrote the page

      • errorobject
        • codestring
        • messagestring
        • statusinteger
        • notifiedboolean

          A budget refusal told the organization's owners and admins (licensed build). Absent otherwise.

        • remainingUsdDecimalstring

          A budget refusal's remainingUsdDecimal: what was left of that level's budget, as an exact decimal. Absent when the 402 had none.

        • requestedUsdstring

          A usage-limit refusal's (usage_limit_reached) requestedUsd: the most the call may cost with Nexus's rate, as an exact decimal. Absent for any other refusal, or when the 402 had none.

        • remainingUsdstring

          A usage-limit refusal's (usage_limit_reached) remainingUsd: what this month's usage limit had left, as an exact decimal. Absent for any other refusal, or when the 402 had none.

        • detailsobject

          A 402's details, as the live error's error.nexus had them, cut to an allow-list: short codes, ways forward, notified and decimal dollar amounts. Absent for any other status, when none was kept, and on an answer stored before it.

          • reasonstring

            Why the refusal happened, such as authentication_required or disputed for payment_failed.

          • levelstring

            A budget refusal's level.

          • freeStartstring

            cheaper_models_only when the free start pays for cheaper models only.

          • nextarray of string

            The ways forward, such as billing and own_key; at most 4.

          • notifiedboolean

            The organization's owners and admins were told.

          • owedUsdstring
          • unpaidUsdstring
          • remainingUsdstring
          • remainingUsdDecimalstring
          • requestedUsdstring
          • limitUsdstring
          • chargeUsdstring
          • capUsdstring
      • createdAtstring (date-time)required
      • attachmentsarray of ChatAttachmentRef

        The images attached to a question

        • idstringrequired
        • type"image" | "file"required
        • mediaType"image/png" | "image/jpeg" | "image/gif" | "image/webp" | "text/csv" | "text/tab-separated-values" | "application/json" | "text/plain" | "text/markdown" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"required

          An image's from the bytes, not as it was named; a data file's from its extension, checked against the bytes

        • bytesintegerrequired
        • widthinteger
        • heightinteger
        • namestring
      • pageChatPageBlock

        A page this answer created or revised through write_page

        • pageIdstringrequired
        • versionintegerrequired

          min 1

        • titlestringrequired
        • format"html" | "md" | "jsx" | "sheet" | "board"required
      • skillsarray of ChatSkillBlock

        The skills this answer loaded through load_skill, in the order it loaded them. The file stays in the skills store

        • skillIdstringrequired

          Skl_… For a library skill, the library skill's id, which getSkill and getSkillVersion also take

        • namestringrequired

          The name the version had when it was served

        • versionintegerrequired

          The version served: a personal skill's latest, or a library skill's latest approved version that nobody withdrew

          min 1

        • scope"personal" | "team" | "org"

          Where the skill came from: your own skills, a team's library, or the organization's. Left out on an answer stored before skills had a scope: read it as personal

        • teamIdstring

          The team (team_…), for scope team. Map it to the team's name with listTeams

      • connectorsarray of ChatConnectorBlock

        The connector reads this answer ran through read_connector, in order. What they returned is never kept. In a shared artifact, a reader sees only the reads of connectors they may use

        • connectorstringrequired
        • operationstringrequired
        • inputobjectrequired
        • accountobject

          The connection the read ran with: whose it is and the account's name. Absent while the read streams, and on reads kept before it was recorded

          • scope"org" | "team" | "user"required
          • namestringrequired
      • sourcesarray of ChatWebSource

        The web pages this answer's searches gave the model, one per URL, in the order they were found. Only the session's author reads them; a shared artifact keeps none

        • titlestringrequired
        • urlstringrequired
        • datestring

          The page's date as the engine gave it, cut as the model read it

        • querystringrequired

          The first query in the turn that found this page

      • rewoundboolean

        Retained for the author, but excluded from future model context after a conversation rewind.

    • messageChatSessionMessage
      • idstringrequired
      • sessionIdstringrequired
      • role"user" | "assistant"required
      • contentstringrequired

        Markdown (a question with images may have none)

      • status"complete" | "failed" | "refused"required

        Refused: the policy or budget refused the call (error says why); failed: it broke mid-way (content is what arrived)

      • mode"chat" | "ask"

        chat with any model you may use; ask (Ask your code) answers from your organization's Nexus Wiki, citing its pages

      • requestedModelstring
      • modelstring

        The model that ran

      • costUsdnumber
      • usageobject
        • promptTokensinteger
        • completionTokensinteger
      • citationsarray of ChatCitation
        • nintegerrequired

          The number the answer cites it by

        • repostringrequired

          Owner/name

        • pagestringrequired
        • slugstringrequired
        • sectionstring
        • pathstringrequired

          <slug>#<anchor> in the repository's wiki

        • filesarray of string

          Repository files the section names

        • runIdstringrequired

          The Nexus Wiki run that wrote the page

      • errorobject
        • codestring
        • messagestring
        • statusinteger
        • notifiedboolean

          A budget refusal told the organization's owners and admins (licensed build). Absent otherwise.

        • remainingUsdDecimalstring

          A budget refusal's remainingUsdDecimal: what was left of that level's budget, as an exact decimal. Absent when the 402 had none.

        • requestedUsdstring

          A usage-limit refusal's (usage_limit_reached) requestedUsd: the most the call may cost with Nexus's rate, as an exact decimal. Absent for any other refusal, or when the 402 had none.

        • remainingUsdstring

          A usage-limit refusal's (usage_limit_reached) remainingUsd: what this month's usage limit had left, as an exact decimal. Absent for any other refusal, or when the 402 had none.

        • detailsobject

          A 402's details, as the live error's error.nexus had them, cut to an allow-list: short codes, ways forward, notified and decimal dollar amounts. Absent for any other status, when none was kept, and on an answer stored before it.

          • reasonstring

            Why the refusal happened, such as authentication_required or disputed for payment_failed.

          • levelstring

            A budget refusal's level.

          • freeStartstring

            cheaper_models_only when the free start pays for cheaper models only.

          • nextarray of string

            The ways forward, such as billing and own_key; at most 4.

          • notifiedboolean

            The organization's owners and admins were told.

          • owedUsdstring
          • unpaidUsdstring
          • remainingUsdstring
          • remainingUsdDecimalstring
          • requestedUsdstring
          • limitUsdstring
          • chargeUsdstring
          • capUsdstring
      • createdAtstring (date-time)required
      • attachmentsarray of ChatAttachmentRef

        The images attached to a question

        • idstringrequired
        • type"image" | "file"required
        • mediaType"image/png" | "image/jpeg" | "image/gif" | "image/webp" | "text/csv" | "text/tab-separated-values" | "application/json" | "text/plain" | "text/markdown" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"required

          An image's from the bytes, not as it was named; a data file's from its extension, checked against the bytes

        • bytesintegerrequired
        • widthinteger
        • heightinteger
        • namestring
      • pageChatPageBlock

        A page this answer created or revised through write_page

        • pageIdstringrequired
        • versionintegerrequired

          min 1

        • titlestringrequired
        • format"html" | "md" | "jsx" | "sheet" | "board"required
      • skillsarray of ChatSkillBlock

        The skills this answer loaded through load_skill, in the order it loaded them. The file stays in the skills store

        • skillIdstringrequired

          Skl_… For a library skill, the library skill's id, which getSkill and getSkillVersion also take

        • namestringrequired

          The name the version had when it was served

        • versionintegerrequired

          The version served: a personal skill's latest, or a library skill's latest approved version that nobody withdrew

          min 1

        • scope"personal" | "team" | "org"

          Where the skill came from: your own skills, a team's library, or the organization's. Left out on an answer stored before skills had a scope: read it as personal

        • teamIdstring

          The team (team_…), for scope team. Map it to the team's name with listTeams

      • connectorsarray of ChatConnectorBlock

        The connector reads this answer ran through read_connector, in order. What they returned is never kept. In a shared artifact, a reader sees only the reads of connectors they may use

        • connectorstringrequired
        • operationstringrequired
        • inputobjectrequired
        • accountobject

          The connection the read ran with: whose it is and the account's name. Absent while the read streams, and on reads kept before it was recorded

          • scope"org" | "team" | "user"required
          • namestringrequired
      • sourcesarray of ChatWebSource

        The web pages this answer's searches gave the model, one per URL, in the order they were found. Only the session's author reads them; a shared artifact keeps none

        • titlestringrequired
        • urlstringrequired
        • datestring

          The page's date as the engine gave it, cut as the model read it

        • querystringrequired

          The first query in the turn that found this page

      • rewoundboolean

        Retained for the author, but excluded from future model context after a conversation rewind.

    • mode"chat" | "ask"

      chat with any model you may use; ask (Ask your code) answers from your organization's Nexus Wiki, citing its pages

    • requestedstring
    • citationsarray of ChatCitation
      • nintegerrequired

        The number the answer cites it by

      • repostringrequired

        Owner/name

      • pagestringrequired
      • slugstringrequired
      • sectionstring
      • pathstringrequired

        <slug>#<anchor> in the repository's wiki

      • filesarray of string

        Repository files the section names

      • runIdstringrequired

        The Nexus Wiki run that wrote the page

    • no_wikiboolean
    • toolobject

      A chat tool currently executing

      • name"write_page" | "load_skill" | "describe_connector" | "read_connector" | "web_search"required
      • status"running"required
    • skillChatSkillBlock

      A skill load_skill has just read

      • skillIdstringrequired

        Skl_… For a library skill, the library skill's id, which getSkill and getSkillVersion also take

      • namestringrequired

        The name the version had when it was served

      • versionintegerrequired

        The version served: a personal skill's latest, or a library skill's latest approved version that nobody withdrew

        min 1

      • scope"personal" | "team" | "org"

        Where the skill came from: your own skills, a team's library, or the organization's. Left out on an answer stored before skills had a scope: read it as personal

      • teamIdstring

        The team (team_…), for scope team. Map it to the team's name with listTeams

    • connectorChatConnectorBlock

      A connector read read_connector is about to run

      • connectorstringrequired
      • operationstringrequired
      • inputobjectrequired
      • accountobject

        The connection the read ran with: whose it is and the account's name. Absent while the read streams, and on reads kept before it was recorded

        • scope"org" | "team" | "user"required
        • namestringrequired
    • cost_usdnumber

402The call's maximum cost is more than the budget left (`budget_exceeded`), or the organization has an unpaid Nexus invoice past its grace (`payment_past_due`). The refusal is stored in the session. A `budget_exceeded` refusal carries `notified: true` in its details once Gateway has told the refused person and the organization's owners and admins. The details are a BudgetRefusal: each money figure with its exact decimal twin.application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

  • errorobject
    • nexusBudgetRefusal

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

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

        The level whose limit refused the call (budget_exceeded)

      • periodstring

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

      • resetsAtstring (date-time)

        When the period ends (UTC)

      • source"override" | "default"

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

      • limitUsdnumber

        Person level only: their monthly limit. Deprecated: read limitUsdDecimal, the exact decimal string (root rule 9).

      • limitUsdDecimalstring

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

      • spentUsdnumber

        Person level only: what they spent this month. Deprecated: read spentUsdDecimal, the exact decimal string (root rule 9).

      • spentUsdDecimalstring

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

      • reservedUsdnumber

        Person level only: what their calls in flight hold. Deprecated: read reservedUsdDecimal, the exact decimal string (root rule 9).

      • reservedUsdDecimalstring

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

      • remainingUsdnumber

        Every level, and subsidy_exhausted: what is left, never below 0. Deprecated: read remainingUsdDecimal, the exact decimal string (root rule 9).

      • remainingUsdDecimalstring

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

      • requestedUsdnumber

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

      • requestedUsdDecimalstring

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

      • notifiedboolean

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

      • fundedBystring

        subsidy_exhausted: who funds the subsidy (nexus)

      • nextarray of string

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

404No such session among yours (`chat_session_not_found`): someone else's session answers the same.application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

      Details of the error, when it has any: the policy rule 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
401authentication_errorNo key, or a key Gateway does not accept
402budget_exceededThe call's maximum cost is more than the budget left (`budget_exceeded`), or the organization has an unpaid Nexus invoice past its grace (`payment_past_due`). The refusal is stored in the session. A `budget_exceeded` refusal carries `notified: true` in its details once Gateway has told the refused person and the organization's owners and admins. The details are a BudgetRefusal: each money figure with its exact decimal twin.
403role_requiredYour role does not have this permission
404not_foundNothing matches the path in your organization
404No such session among yours (`chat_session_not_found`): someone else's session answers the same.
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/chat/sessions/<id>/messages" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "<content>"
  }'

Ask code

post/v1/chat/ask

Ask your code alone: a question to your organization's Nexus Wiki, answered and cited as sendChatMessage answers in ask mode. Without session it starts an ask-mode session of yours; with one it continues it. It needs chat.ask, not chat.use, so an agent link that holds it reaches no other chat route. An agent link holds chat.ask only when its sign-in asked for it, and it asks as its person: it reads the Wiki pages the person reads and nothing more. An agent link continues only a session it started; any other session is a 404 chat_session_not_found, as someone else's is. Text only: no images, no team, no page or skill tools.

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

  • contentstringrequired

    The question

    min length 1 · max length 32000

  • sessionstring

    The ask-mode session to continue (chs_…). An agent link continues only a session it started. Omit it to start one.

    pattern ^[A-Za-z0-9_-]+$

  • modelstring

    For this question and the next ones in the session

  • streamboolean

    default true

Responses

200The answer: an event stream, or with stream false the stored question and answertext/event-stream

  • idstring
  • object"chat.completion.chunk"
  • createdinteger
  • modelstring | null

    The model that runs

  • choicesarray of object
    • indexinteger
    • deltaobject
      • rolestring
      • contentstring
    • finish_reasonstring | null
  • usageobject
    • prompt_tokensinteger
    • completion_tokensinteger
    • total_tokensinteger
  • nexusobject
    • sessionChatSession

      A chat session, private to its author unless shared as an artifact.

      • idstringrequired
      • titlestringrequired

        The first question until you rename it

      • mode"chat" | "ask"required

        chat with any model you may use; ask (Ask your code) answers from your organization's Nexus Wiki, citing its pages

      • modelstringrequired

        The model asked for: nexus/auto by default

      • lastModelstring

        The model that ran last

      • teamstring

        The team its spend is attributed to

      • archivedbooleanrequired
      • webSearchboolean

        Whether the model may search the web in this session (default false)

      • messageCountintegerrequired
      • costUsdnumberrequired

        The sum of its model calls and of the web searches that returned results, settled in the ledger; a search that fails after the provider billed it is in the ledger, not in this sum

      • createdAtstring (date-time)required
      • updatedAtstring (date-time)required
      • visibility"private" | "shared"

        Private (the default) or shared: at least one active artifact

      • sharingChatSessionSharing

        How a shared session is shared: its newest active artifact

        • artifactIdstringrequired
        • versionintegerrequired
        • audienceArtifactAudiencerequired

          Who may read an artifact, besides its author: inside the organization, the whole organization, chosen teams (their members and the members of the teams under them) or chosen people; outside it, named people by email (external) or anyone with the link (public). Readers outside the organization see the kind only.

          • kind"org" | "teams" | "people" | "external" | "public"required
          • teamsarray of stringrequired

            Team slugs (kind teams)

          • peoplearray of stringrequired

            Members' emails (kind people); the outsiders with access (kind external). Empty for readers outside the organization.

        • allowContinuebooleanrequired
        • urlstringrequired

          The link to hand out: a public link (kind public), the fast viewer (kind external), else the artifact in Nexus UI; absolute when the Gateway knows Nexus UI's URL (NEXUS_UI_URL), else a path

        • pathstringrequired

          /app/<org>/artifacts/<id>

        • viewerUrlstring

          The fast viewer: <origin>/a/<id>

        • publicUrlstring

          Kind public: <origin>/a/<token>

        • expiresAtstring (date-time)

          Kind public: when the link stops opening

      • artifactsarray of ArtifactLink

        Every version shared from this session, newest first (revoked ones included)

        • idstringrequired
        • versionintegerrequired

          min 1

        • status"active" | "revoked"required
        • audience"org" | "teams" | "people" | "external" | "public"required
        • createdAtstring (date-time)required
        • revokedAtstring (date-time)
      • authorArtifactAuthor

        You (listed and read sessions)

        • emailstring
        • namestring
      • forkedFromobject

        The artifact this session continues (POST /v1/artifacts/{id}/continue)

        • artifactIdstringrequired
        • versionintegerrequired
        • titlestring
    • questionChatSessionMessage
      • idstringrequired
      • sessionIdstringrequired
      • role"user" | "assistant"required
      • contentstringrequired

        Markdown (a question with images may have none)

      • status"complete" | "failed" | "refused"required

        Refused: the policy or budget refused the call (error says why); failed: it broke mid-way (content is what arrived)

      • mode"chat" | "ask"

        chat with any model you may use; ask (Ask your code) answers from your organization's Nexus Wiki, citing its pages

      • requestedModelstring
      • modelstring

        The model that ran

      • costUsdnumber
      • usageobject
        • promptTokensinteger
        • completionTokensinteger
      • citationsarray of ChatCitation
        • nintegerrequired

          The number the answer cites it by

        • repostringrequired

          Owner/name

        • pagestringrequired
        • slugstringrequired
        • sectionstring
        • pathstringrequired

          <slug>#<anchor> in the repository's wiki

        • filesarray of string

          Repository files the section names

        • runIdstringrequired

          The Nexus Wiki run that wrote the page

      • errorobject
        • codestring
        • messagestring
        • statusinteger
        • notifiedboolean

          A budget refusal told the organization's owners and admins (licensed build). Absent otherwise.

        • remainingUsdDecimalstring

          A budget refusal's remainingUsdDecimal: what was left of that level's budget, as an exact decimal. Absent when the 402 had none.

        • requestedUsdstring

          A usage-limit refusal's (usage_limit_reached) requestedUsd: the most the call may cost with Nexus's rate, as an exact decimal. Absent for any other refusal, or when the 402 had none.

        • remainingUsdstring

          A usage-limit refusal's (usage_limit_reached) remainingUsd: what this month's usage limit had left, as an exact decimal. Absent for any other refusal, or when the 402 had none.

        • detailsobject

          A 402's details, as the live error's error.nexus had them, cut to an allow-list: short codes, ways forward, notified and decimal dollar amounts. Absent for any other status, when none was kept, and on an answer stored before it.

          • reasonstring

            Why the refusal happened, such as authentication_required or disputed for payment_failed.

          • levelstring

            A budget refusal's level.

          • freeStartstring

            cheaper_models_only when the free start pays for cheaper models only.

          • nextarray of string

            The ways forward, such as billing and own_key; at most 4.

          • notifiedboolean

            The organization's owners and admins were told.

          • owedUsdstring
          • unpaidUsdstring
          • remainingUsdstring
          • remainingUsdDecimalstring
          • requestedUsdstring
          • limitUsdstring
          • chargeUsdstring
          • capUsdstring
      • createdAtstring (date-time)required
      • attachmentsarray of ChatAttachmentRef

        The images attached to a question

        • idstringrequired
        • type"image" | "file"required
        • mediaType"image/png" | "image/jpeg" | "image/gif" | "image/webp" | "text/csv" | "text/tab-separated-values" | "application/json" | "text/plain" | "text/markdown" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"required

          An image's from the bytes, not as it was named; a data file's from its extension, checked against the bytes

        • bytesintegerrequired
        • widthinteger
        • heightinteger
        • namestring
      • pageChatPageBlock

        A page this answer created or revised through write_page

        • pageIdstringrequired
        • versionintegerrequired

          min 1

        • titlestringrequired
        • format"html" | "md" | "jsx" | "sheet" | "board"required
      • skillsarray of ChatSkillBlock

        The skills this answer loaded through load_skill, in the order it loaded them. The file stays in the skills store

        • skillIdstringrequired

          Skl_… For a library skill, the library skill's id, which getSkill and getSkillVersion also take

        • namestringrequired

          The name the version had when it was served

        • versionintegerrequired

          The version served: a personal skill's latest, or a library skill's latest approved version that nobody withdrew

          min 1

        • scope"personal" | "team" | "org"

          Where the skill came from: your own skills, a team's library, or the organization's. Left out on an answer stored before skills had a scope: read it as personal

        • teamIdstring

          The team (team_…), for scope team. Map it to the team's name with listTeams

      • connectorsarray of ChatConnectorBlock

        The connector reads this answer ran through read_connector, in order. What they returned is never kept. In a shared artifact, a reader sees only the reads of connectors they may use

        • connectorstringrequired
        • operationstringrequired
        • inputobjectrequired
        • accountobject

          The connection the read ran with: whose it is and the account's name. Absent while the read streams, and on reads kept before it was recorded

          • scope"org" | "team" | "user"required
          • namestringrequired
      • sourcesarray of ChatWebSource

        The web pages this answer's searches gave the model, one per URL, in the order they were found. Only the session's author reads them; a shared artifact keeps none

        • titlestringrequired
        • urlstringrequired
        • datestring

          The page's date as the engine gave it, cut as the model read it

        • querystringrequired

          The first query in the turn that found this page

      • rewoundboolean

        Retained for the author, but excluded from future model context after a conversation rewind.

    • messageChatSessionMessage
      • idstringrequired
      • sessionIdstringrequired
      • role"user" | "assistant"required
      • contentstringrequired

        Markdown (a question with images may have none)

      • status"complete" | "failed" | "refused"required

        Refused: the policy or budget refused the call (error says why); failed: it broke mid-way (content is what arrived)

      • mode"chat" | "ask"

        chat with any model you may use; ask (Ask your code) answers from your organization's Nexus Wiki, citing its pages

      • requestedModelstring
      • modelstring

        The model that ran

      • costUsdnumber
      • usageobject
        • promptTokensinteger
        • completionTokensinteger
      • citationsarray of ChatCitation
        • nintegerrequired

          The number the answer cites it by

        • repostringrequired

          Owner/name

        • pagestringrequired
        • slugstringrequired
        • sectionstring
        • pathstringrequired

          <slug>#<anchor> in the repository's wiki

        • filesarray of string

          Repository files the section names

        • runIdstringrequired

          The Nexus Wiki run that wrote the page

      • errorobject
        • codestring
        • messagestring
        • statusinteger
        • notifiedboolean

          A budget refusal told the organization's owners and admins (licensed build). Absent otherwise.

        • remainingUsdDecimalstring

          A budget refusal's remainingUsdDecimal: what was left of that level's budget, as an exact decimal. Absent when the 402 had none.

        • requestedUsdstring

          A usage-limit refusal's (usage_limit_reached) requestedUsd: the most the call may cost with Nexus's rate, as an exact decimal. Absent for any other refusal, or when the 402 had none.

        • remainingUsdstring

          A usage-limit refusal's (usage_limit_reached) remainingUsd: what this month's usage limit had left, as an exact decimal. Absent for any other refusal, or when the 402 had none.

        • detailsobject

          A 402's details, as the live error's error.nexus had them, cut to an allow-list: short codes, ways forward, notified and decimal dollar amounts. Absent for any other status, when none was kept, and on an answer stored before it.

          • reasonstring

            Why the refusal happened, such as authentication_required or disputed for payment_failed.

          • levelstring

            A budget refusal's level.

          • freeStartstring

            cheaper_models_only when the free start pays for cheaper models only.

          • nextarray of string

            The ways forward, such as billing and own_key; at most 4.

          • notifiedboolean

            The organization's owners and admins were told.

          • owedUsdstring
          • unpaidUsdstring
          • remainingUsdstring
          • remainingUsdDecimalstring
          • requestedUsdstring
          • limitUsdstring
          • chargeUsdstring
          • capUsdstring
      • createdAtstring (date-time)required
      • attachmentsarray of ChatAttachmentRef

        The images attached to a question

        • idstringrequired
        • type"image" | "file"required
        • mediaType"image/png" | "image/jpeg" | "image/gif" | "image/webp" | "text/csv" | "text/tab-separated-values" | "application/json" | "text/plain" | "text/markdown" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"required

          An image's from the bytes, not as it was named; a data file's from its extension, checked against the bytes

        • bytesintegerrequired
        • widthinteger
        • heightinteger
        • namestring
      • pageChatPageBlock

        A page this answer created or revised through write_page

        • pageIdstringrequired
        • versionintegerrequired

          min 1

        • titlestringrequired
        • format"html" | "md" | "jsx" | "sheet" | "board"required
      • skillsarray of ChatSkillBlock

        The skills this answer loaded through load_skill, in the order it loaded them. The file stays in the skills store

        • skillIdstringrequired

          Skl_… For a library skill, the library skill's id, which getSkill and getSkillVersion also take

        • namestringrequired

          The name the version had when it was served

        • versionintegerrequired

          The version served: a personal skill's latest, or a library skill's latest approved version that nobody withdrew

          min 1

        • scope"personal" | "team" | "org"

          Where the skill came from: your own skills, a team's library, or the organization's. Left out on an answer stored before skills had a scope: read it as personal

        • teamIdstring

          The team (team_…), for scope team. Map it to the team's name with listTeams

      • connectorsarray of ChatConnectorBlock

        The connector reads this answer ran through read_connector, in order. What they returned is never kept. In a shared artifact, a reader sees only the reads of connectors they may use

        • connectorstringrequired
        • operationstringrequired
        • inputobjectrequired
        • accountobject

          The connection the read ran with: whose it is and the account's name. Absent while the read streams, and on reads kept before it was recorded

          • scope"org" | "team" | "user"required
          • namestringrequired
      • sourcesarray of ChatWebSource

        The web pages this answer's searches gave the model, one per URL, in the order they were found. Only the session's author reads them; a shared artifact keeps none

        • titlestringrequired
        • urlstringrequired
        • datestring

          The page's date as the engine gave it, cut as the model read it

        • querystringrequired

          The first query in the turn that found this page

      • rewoundboolean

        Retained for the author, but excluded from future model context after a conversation rewind.

    • mode"chat" | "ask"

      chat with any model you may use; ask (Ask your code) answers from your organization's Nexus Wiki, citing its pages

    • requestedstring
    • citationsarray of ChatCitation
      • nintegerrequired

        The number the answer cites it by

      • repostringrequired

        Owner/name

      • pagestringrequired
      • slugstringrequired
      • sectionstring
      • pathstringrequired

        <slug>#<anchor> in the repository's wiki

      • filesarray of string

        Repository files the section names

      • runIdstringrequired

        The Nexus Wiki run that wrote the page

    • no_wikiboolean
    • toolobject

      A chat tool currently executing

      • name"write_page" | "load_skill" | "describe_connector" | "read_connector" | "web_search"required
      • status"running"required
    • skillChatSkillBlock

      A skill load_skill has just read

      • skillIdstringrequired

        Skl_… For a library skill, the library skill's id, which getSkill and getSkillVersion also take

      • namestringrequired

        The name the version had when it was served

      • versionintegerrequired

        The version served: a personal skill's latest, or a library skill's latest approved version that nobody withdrew

        min 1

      • scope"personal" | "team" | "org"

        Where the skill came from: your own skills, a team's library, or the organization's. Left out on an answer stored before skills had a scope: read it as personal

      • teamIdstring

        The team (team_…), for scope team. Map it to the team's name with listTeams

    • connectorChatConnectorBlock

      A connector read read_connector is about to run

      • connectorstringrequired
      • operationstringrequired
      • inputobjectrequired
      • accountobject

        The connection the read ran with: whose it is and the account's name. Absent while the read streams, and on reads kept before it was recorded

        • scope"org" | "team" | "user"required
        • namestringrequired
    • cost_usdnumber

402The call's maximum cost is more than the budget left (`budget_exceeded`), or the organization has an unpaid Nexus invoice past its grace (`payment_past_due`). The refusal is stored in the session. A `budget_exceeded` refusal carries `notified: true` in its details once Gateway has told the refused person and the organization's owners and admins. The details are a BudgetRefusal: each money figure with its exact decimal twin.application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

  • errorobject
    • nexusBudgetRefusal

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

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

        The level whose limit refused the call (budget_exceeded)

      • periodstring

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

      • resetsAtstring (date-time)

        When the period ends (UTC)

      • source"override" | "default"

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

      • limitUsdnumber

        Person level only: their monthly limit. Deprecated: read limitUsdDecimal, the exact decimal string (root rule 9).

      • limitUsdDecimalstring

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

      • spentUsdnumber

        Person level only: what they spent this month. Deprecated: read spentUsdDecimal, the exact decimal string (root rule 9).

      • spentUsdDecimalstring

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

      • reservedUsdnumber

        Person level only: what their calls in flight hold. Deprecated: read reservedUsdDecimal, the exact decimal string (root rule 9).

      • reservedUsdDecimalstring

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

      • remainingUsdnumber

        Every level, and subsidy_exhausted: what is left, never below 0. Deprecated: read remainingUsdDecimal, the exact decimal string (root rule 9).

      • remainingUsdDecimalstring

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

      • requestedUsdnumber

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

      • requestedUsdDecimalstring

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

      • notifiedboolean

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

      • fundedBystring

        subsidy_exhausted: who funds the subsidy (nexus)

      • nextarray of string

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

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

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

Errors

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
401authentication_errorNo key, or a key Gateway does not accept
402budget_exceededThe call's maximum cost is more than the budget left (`budget_exceeded`), or the organization has an unpaid Nexus invoice past its grace (`payment_past_due`). The refusal is stored in the session. A `budget_exceeded` refusal carries `notified: true` in its details once Gateway has told the refused person and the organization's owners and admins. The details are a BudgetRefusal: each money figure with its exact decimal twin.
403role_requiredYour role does not have this permission
409idempotency_in_progressA request with the same Idempotency-Key is still running
409idempotency_interruptedThe first request with this Idempotency-Key was cut off and may have run in part
422idempotency_key_reusedThe Idempotency-Key was used with a different request
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429rate_limit_errorToo many requests from this key in a minute

Example

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

Ask web

post/v1/chat/web

Web search alone: a text question answered with your organization's web search, as sendChatMessage answers in a chat with webSearch on. Without session it starts a chat session of yours with webSearch on; with one it continues it. The turn offers the web_search tool and no other: no page, skill or connector tool. The organization's webSearch.* settings apply, maxPerTurn included. While search is off it is a 403 web_search_off, and while webSearch.requireZdr or a domain rule is set a 403 web_search_unenforced; both name the setting in error.nexus.setting, and no session is made. It needs chat.web, not chat.use, so an agent link that holds it reaches no other chat route. An agent link holds chat.web only when its sign-in asked for it, and it searches as its person, on its person's budget. An agent link continues only a session it started; any other session is a 404 chat_session_not_found, as someone else's is. Text only: no images and no team. When no model the policy allows can search, the answer comes without a search and sources is absent.

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

  • contentstringrequired

    The question

    min length 1 · max length 32000

  • sessionstring

    The web session to continue (chs_…): a chat session with webSearch on. An agent link continues only a session it started. Omit it to start one.

    pattern ^[A-Za-z0-9_-]+$

  • modelstring

    For this question and the next ones in the session

  • streamboolean

    default true

Responses

200The answer: an event stream, or with stream false the stored question and answer, with the answer's sourcestext/event-stream

  • idstring
  • object"chat.completion.chunk"
  • createdinteger
  • modelstring | null

    The model that runs

  • choicesarray of object
    • indexinteger
    • deltaobject
      • rolestring
      • contentstring
    • finish_reasonstring | null
  • usageobject
    • prompt_tokensinteger
    • completion_tokensinteger
    • total_tokensinteger
  • nexusobject
    • sessionChatSession

      A chat session, private to its author unless shared as an artifact.

      • idstringrequired
      • titlestringrequired

        The first question until you rename it

      • mode"chat" | "ask"required

        chat with any model you may use; ask (Ask your code) answers from your organization's Nexus Wiki, citing its pages

      • modelstringrequired

        The model asked for: nexus/auto by default

      • lastModelstring

        The model that ran last

      • teamstring

        The team its spend is attributed to

      • archivedbooleanrequired
      • webSearchboolean

        Whether the model may search the web in this session (default false)

      • messageCountintegerrequired
      • costUsdnumberrequired

        The sum of its model calls and of the web searches that returned results, settled in the ledger; a search that fails after the provider billed it is in the ledger, not in this sum

      • createdAtstring (date-time)required
      • updatedAtstring (date-time)required
      • visibility"private" | "shared"

        Private (the default) or shared: at least one active artifact

      • sharingChatSessionSharing

        How a shared session is shared: its newest active artifact

        • artifactIdstringrequired
        • versionintegerrequired
        • audienceArtifactAudiencerequired

          Who may read an artifact, besides its author: inside the organization, the whole organization, chosen teams (their members and the members of the teams under them) or chosen people; outside it, named people by email (external) or anyone with the link (public). Readers outside the organization see the kind only.

          • kind"org" | "teams" | "people" | "external" | "public"required
          • teamsarray of stringrequired

            Team slugs (kind teams)

          • peoplearray of stringrequired

            Members' emails (kind people); the outsiders with access (kind external). Empty for readers outside the organization.

        • allowContinuebooleanrequired
        • urlstringrequired

          The link to hand out: a public link (kind public), the fast viewer (kind external), else the artifact in Nexus UI; absolute when the Gateway knows Nexus UI's URL (NEXUS_UI_URL), else a path

        • pathstringrequired

          /app/<org>/artifacts/<id>

        • viewerUrlstring

          The fast viewer: <origin>/a/<id>

        • publicUrlstring

          Kind public: <origin>/a/<token>

        • expiresAtstring (date-time)

          Kind public: when the link stops opening

      • artifactsarray of ArtifactLink

        Every version shared from this session, newest first (revoked ones included)

        • idstringrequired
        • versionintegerrequired

          min 1

        • status"active" | "revoked"required
        • audience"org" | "teams" | "people" | "external" | "public"required
        • createdAtstring (date-time)required
        • revokedAtstring (date-time)
      • authorArtifactAuthor

        You (listed and read sessions)

        • emailstring
        • namestring
      • forkedFromobject

        The artifact this session continues (POST /v1/artifacts/{id}/continue)

        • artifactIdstringrequired
        • versionintegerrequired
        • titlestring
    • questionChatSessionMessage
      • idstringrequired
      • sessionIdstringrequired
      • role"user" | "assistant"required
      • contentstringrequired

        Markdown (a question with images may have none)

      • status"complete" | "failed" | "refused"required

        Refused: the policy or budget refused the call (error says why); failed: it broke mid-way (content is what arrived)

      • mode"chat" | "ask"

        chat with any model you may use; ask (Ask your code) answers from your organization's Nexus Wiki, citing its pages

      • requestedModelstring
      • modelstring

        The model that ran

      • costUsdnumber
      • usageobject
        • promptTokensinteger
        • completionTokensinteger
      • citationsarray of ChatCitation
        • nintegerrequired

          The number the answer cites it by

        • repostringrequired

          Owner/name

        • pagestringrequired
        • slugstringrequired
        • sectionstring
        • pathstringrequired

          <slug>#<anchor> in the repository's wiki

        • filesarray of string

          Repository files the section names

        • runIdstringrequired

          The Nexus Wiki run that wrote the page

      • errorobject
        • codestring
        • messagestring
        • statusinteger
        • notifiedboolean

          A budget refusal told the organization's owners and admins (licensed build). Absent otherwise.

        • remainingUsdDecimalstring

          A budget refusal's remainingUsdDecimal: what was left of that level's budget, as an exact decimal. Absent when the 402 had none.

        • requestedUsdstring

          A usage-limit refusal's (usage_limit_reached) requestedUsd: the most the call may cost with Nexus's rate, as an exact decimal. Absent for any other refusal, or when the 402 had none.

        • remainingUsdstring

          A usage-limit refusal's (usage_limit_reached) remainingUsd: what this month's usage limit had left, as an exact decimal. Absent for any other refusal, or when the 402 had none.

        • detailsobject

          A 402's details, as the live error's error.nexus had them, cut to an allow-list: short codes, ways forward, notified and decimal dollar amounts. Absent for any other status, when none was kept, and on an answer stored before it.

          • reasonstring

            Why the refusal happened, such as authentication_required or disputed for payment_failed.

          • levelstring

            A budget refusal's level.

          • freeStartstring

            cheaper_models_only when the free start pays for cheaper models only.

          • nextarray of string

            The ways forward, such as billing and own_key; at most 4.

          • notifiedboolean

            The organization's owners and admins were told.

          • owedUsdstring
          • unpaidUsdstring
          • remainingUsdstring
          • remainingUsdDecimalstring
          • requestedUsdstring
          • limitUsdstring
          • chargeUsdstring
          • capUsdstring
      • createdAtstring (date-time)required
      • attachmentsarray of ChatAttachmentRef

        The images attached to a question

        • idstringrequired
        • type"image" | "file"required
        • mediaType"image/png" | "image/jpeg" | "image/gif" | "image/webp" | "text/csv" | "text/tab-separated-values" | "application/json" | "text/plain" | "text/markdown" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"required

          An image's from the bytes, not as it was named; a data file's from its extension, checked against the bytes

        • bytesintegerrequired
        • widthinteger
        • heightinteger
        • namestring
      • pageChatPageBlock

        A page this answer created or revised through write_page

        • pageIdstringrequired
        • versionintegerrequired

          min 1

        • titlestringrequired
        • format"html" | "md" | "jsx" | "sheet" | "board"required
      • skillsarray of ChatSkillBlock

        The skills this answer loaded through load_skill, in the order it loaded them. The file stays in the skills store

        • skillIdstringrequired

          Skl_… For a library skill, the library skill's id, which getSkill and getSkillVersion also take

        • namestringrequired

          The name the version had when it was served

        • versionintegerrequired

          The version served: a personal skill's latest, or a library skill's latest approved version that nobody withdrew

          min 1

        • scope"personal" | "team" | "org"

          Where the skill came from: your own skills, a team's library, or the organization's. Left out on an answer stored before skills had a scope: read it as personal

        • teamIdstring

          The team (team_…), for scope team. Map it to the team's name with listTeams

      • connectorsarray of ChatConnectorBlock

        The connector reads this answer ran through read_connector, in order. What they returned is never kept. In a shared artifact, a reader sees only the reads of connectors they may use

        • connectorstringrequired
        • operationstringrequired
        • inputobjectrequired
        • accountobject

          The connection the read ran with: whose it is and the account's name. Absent while the read streams, and on reads kept before it was recorded

          • scope"org" | "team" | "user"required
          • namestringrequired
      • sourcesarray of ChatWebSource

        The web pages this answer's searches gave the model, one per URL, in the order they were found. Only the session's author reads them; a shared artifact keeps none

        • titlestringrequired
        • urlstringrequired
        • datestring

          The page's date as the engine gave it, cut as the model read it

        • querystringrequired

          The first query in the turn that found this page

      • rewoundboolean

        Retained for the author, but excluded from future model context after a conversation rewind.

    • messageChatSessionMessage
      • idstringrequired
      • sessionIdstringrequired
      • role"user" | "assistant"required
      • contentstringrequired

        Markdown (a question with images may have none)

      • status"complete" | "failed" | "refused"required

        Refused: the policy or budget refused the call (error says why); failed: it broke mid-way (content is what arrived)

      • mode"chat" | "ask"

        chat with any model you may use; ask (Ask your code) answers from your organization's Nexus Wiki, citing its pages

      • requestedModelstring
      • modelstring

        The model that ran

      • costUsdnumber
      • usageobject
        • promptTokensinteger
        • completionTokensinteger
      • citationsarray of ChatCitation
        • nintegerrequired

          The number the answer cites it by

        • repostringrequired

          Owner/name

        • pagestringrequired
        • slugstringrequired
        • sectionstring
        • pathstringrequired

          <slug>#<anchor> in the repository's wiki

        • filesarray of string

          Repository files the section names

        • runIdstringrequired

          The Nexus Wiki run that wrote the page

      • errorobject
        • codestring
        • messagestring
        • statusinteger
        • notifiedboolean

          A budget refusal told the organization's owners and admins (licensed build). Absent otherwise.

        • remainingUsdDecimalstring

          A budget refusal's remainingUsdDecimal: what was left of that level's budget, as an exact decimal. Absent when the 402 had none.

        • requestedUsdstring

          A usage-limit refusal's (usage_limit_reached) requestedUsd: the most the call may cost with Nexus's rate, as an exact decimal. Absent for any other refusal, or when the 402 had none.

        • remainingUsdstring

          A usage-limit refusal's (usage_limit_reached) remainingUsd: what this month's usage limit had left, as an exact decimal. Absent for any other refusal, or when the 402 had none.

        • detailsobject

          A 402's details, as the live error's error.nexus had them, cut to an allow-list: short codes, ways forward, notified and decimal dollar amounts. Absent for any other status, when none was kept, and on an answer stored before it.

          • reasonstring

            Why the refusal happened, such as authentication_required or disputed for payment_failed.

          • levelstring

            A budget refusal's level.

          • freeStartstring

            cheaper_models_only when the free start pays for cheaper models only.

          • nextarray of string

            The ways forward, such as billing and own_key; at most 4.

          • notifiedboolean

            The organization's owners and admins were told.

          • owedUsdstring
          • unpaidUsdstring
          • remainingUsdstring
          • remainingUsdDecimalstring
          • requestedUsdstring
          • limitUsdstring
          • chargeUsdstring
          • capUsdstring
      • createdAtstring (date-time)required
      • attachmentsarray of ChatAttachmentRef

        The images attached to a question

        • idstringrequired
        • type"image" | "file"required
        • mediaType"image/png" | "image/jpeg" | "image/gif" | "image/webp" | "text/csv" | "text/tab-separated-values" | "application/json" | "text/plain" | "text/markdown" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"required

          An image's from the bytes, not as it was named; a data file's from its extension, checked against the bytes

        • bytesintegerrequired
        • widthinteger
        • heightinteger
        • namestring
      • pageChatPageBlock

        A page this answer created or revised through write_page

        • pageIdstringrequired
        • versionintegerrequired

          min 1

        • titlestringrequired
        • format"html" | "md" | "jsx" | "sheet" | "board"required
      • skillsarray of ChatSkillBlock

        The skills this answer loaded through load_skill, in the order it loaded them. The file stays in the skills store

        • skillIdstringrequired

          Skl_… For a library skill, the library skill's id, which getSkill and getSkillVersion also take

        • namestringrequired

          The name the version had when it was served

        • versionintegerrequired

          The version served: a personal skill's latest, or a library skill's latest approved version that nobody withdrew

          min 1

        • scope"personal" | "team" | "org"

          Where the skill came from: your own skills, a team's library, or the organization's. Left out on an answer stored before skills had a scope: read it as personal

        • teamIdstring

          The team (team_…), for scope team. Map it to the team's name with listTeams

      • connectorsarray of ChatConnectorBlock

        The connector reads this answer ran through read_connector, in order. What they returned is never kept. In a shared artifact, a reader sees only the reads of connectors they may use

        • connectorstringrequired
        • operationstringrequired
        • inputobjectrequired
        • accountobject

          The connection the read ran with: whose it is and the account's name. Absent while the read streams, and on reads kept before it was recorded

          • scope"org" | "team" | "user"required
          • namestringrequired
      • sourcesarray of ChatWebSource

        The web pages this answer's searches gave the model, one per URL, in the order they were found. Only the session's author reads them; a shared artifact keeps none

        • titlestringrequired
        • urlstringrequired
        • datestring

          The page's date as the engine gave it, cut as the model read it

        • querystringrequired

          The first query in the turn that found this page

      • rewoundboolean

        Retained for the author, but excluded from future model context after a conversation rewind.

    • mode"chat" | "ask"

      chat with any model you may use; ask (Ask your code) answers from your organization's Nexus Wiki, citing its pages

    • requestedstring
    • citationsarray of ChatCitation
      • nintegerrequired

        The number the answer cites it by

      • repostringrequired

        Owner/name

      • pagestringrequired
      • slugstringrequired
      • sectionstring
      • pathstringrequired

        <slug>#<anchor> in the repository's wiki

      • filesarray of string

        Repository files the section names

      • runIdstringrequired

        The Nexus Wiki run that wrote the page

    • no_wikiboolean
    • toolobject

      A chat tool currently executing

      • name"write_page" | "load_skill" | "describe_connector" | "read_connector" | "web_search"required
      • status"running"required
    • skillChatSkillBlock

      A skill load_skill has just read

      • skillIdstringrequired

        Skl_… For a library skill, the library skill's id, which getSkill and getSkillVersion also take

      • namestringrequired

        The name the version had when it was served

      • versionintegerrequired

        The version served: a personal skill's latest, or a library skill's latest approved version that nobody withdrew

        min 1

      • scope"personal" | "team" | "org"

        Where the skill came from: your own skills, a team's library, or the organization's. Left out on an answer stored before skills had a scope: read it as personal

      • teamIdstring

        The team (team_…), for scope team. Map it to the team's name with listTeams

    • connectorChatConnectorBlock

      A connector read read_connector is about to run

      • connectorstringrequired
      • operationstringrequired
      • inputobjectrequired
      • accountobject

        The connection the read ran with: whose it is and the account's name. Absent while the read streams, and on reads kept before it was recorded

        • scope"org" | "team" | "user"required
        • namestringrequired
    • cost_usdnumber

402The call's maximum cost is more than the budget left (`budget_exceeded`), or the organization has an unpaid Nexus invoice past its grace (`payment_past_due`). The refusal is stored in the session. A `budget_exceeded` refusal carries `notified: true` in its details once Gateway has told the refused person and the organization's owners and admins.application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

      Details of the error, when it has any: the policy rule 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
401authentication_errorNo key, or a key Gateway does not accept
402budget_exceededThe call's maximum cost is more than the budget left (`budget_exceeded`), or the organization has an unpaid Nexus invoice past its grace (`payment_past_due`). The refusal is stored in the session. A `budget_exceeded` refusal carries `notified: true` in its details once Gateway has told the refused person and the organization's owners and admins.
403role_requiredYour role does not have this permission
409idempotency_in_progressA request with the same Idempotency-Key is still running
409idempotency_interruptedThe first request with this Idempotency-Key was cut off and may have run in part
422idempotency_key_reusedThe Idempotency-Key was used with a different request
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429rate_limit_errorToo many requests from this key in a minute

Example

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

Get chat attachment

get/v1/chat/sessions/{id}/attachments/{attachmentId}

An image attached to a question in one of your sessions, with its bytes as base64 (data:<mediaType>;base64,<data> shows it). Someone else's session, or an image not in it, is a 404 (chat_session_not_found, chat_attachment_not_found).

chat.useEvery memberTry it in the API Explorer

Parameters

  • idpath · stringrequired

    The session's id (chs_…)

  • attachmentIdpath · stringrequired

    The image's id (cha_…), from the message's attachments

Responses

200The imageapplication/json

  • idstringrequired
  • sessionIdstringrequired
  • messageIdstringrequired
  • mediaType"image/png" | "image/jpeg" | "image/gif" | "image/webp" | "text/csv" | "text/tab-separated-values" | "application/json" | "text/plain" | "text/markdown" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"required
  • bytesintegerrequired
  • widthinteger
  • heightinteger
  • namestring
  • datastringrequired

    Standard base64

  • createdAtstring (date-time)required

404No such session among yours (`chat_session_not_found`), or no such image in it (`chat_attachment_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
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 session among yours (`chat_session_not_found`), or no such image in it (`chat_attachment_not_found`).
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/chat/sessions/<id>/attachments/<attachmentId>" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Rewind chat session

post/v1/chat/sessions/{id}/rewind

Rewind before one active user message. Original messages remain saved. Running replies return 409.

chat.useEvery memberTry it in the API Explorer

Parameters

  • idpath · stringrequired

    The session's id (chs_…)

Request body · application/json

  • messageIdstringrequired

    min length 1

Responses

200OKapplication/json

  • idstringrequired
  • titlestringrequired

    The first question until you rename it

  • mode"chat" | "ask"required

    chat with any model you may use; ask (Ask your code) answers from your organization's Nexus Wiki, citing its pages

  • modelstringrequired

    The model asked for: nexus/auto by default

  • lastModelstring

    The model that ran last

  • teamstring

    The team its spend is attributed to

  • archivedbooleanrequired
  • webSearchboolean

    Whether the model may search the web in this session (default false)

  • messageCountintegerrequired
  • costUsdnumberrequired

    The sum of its model calls and of the web searches that returned results, settled in the ledger; a search that fails after the provider billed it is in the ledger, not in this sum

  • createdAtstring (date-time)required
  • updatedAtstring (date-time)required
  • visibility"private" | "shared"

    Private (the default) or shared: at least one active artifact

  • sharingChatSessionSharing

    How a shared session is shared: its newest active artifact

    • artifactIdstringrequired
    • versionintegerrequired
    • audienceArtifactAudiencerequired

      Who may read an artifact, besides its author: inside the organization, the whole organization, chosen teams (their members and the members of the teams under them) or chosen people; outside it, named people by email (external) or anyone with the link (public). Readers outside the organization see the kind only.

      • kind"org" | "teams" | "people" | "external" | "public"required
      • teamsarray of stringrequired

        Team slugs (kind teams)

      • peoplearray of stringrequired

        Members' emails (kind people); the outsiders with access (kind external). Empty for readers outside the organization.

    • allowContinuebooleanrequired
    • urlstringrequired

      The link to hand out: a public link (kind public), the fast viewer (kind external), else the artifact in Nexus UI; absolute when the Gateway knows Nexus UI's URL (NEXUS_UI_URL), else a path

    • pathstringrequired

      /app/<org>/artifacts/<id>

    • viewerUrlstring

      The fast viewer: <origin>/a/<id>

    • publicUrlstring

      Kind public: <origin>/a/<token>

    • expiresAtstring (date-time)

      Kind public: when the link stops opening

  • artifactsarray of ArtifactLink

    Every version shared from this session, newest first (revoked ones included)

    • idstringrequired
    • versionintegerrequired

      min 1

    • status"active" | "revoked"required
    • audience"org" | "teams" | "people" | "external" | "public"required
    • createdAtstring (date-time)required
    • revokedAtstring (date-time)
  • authorArtifactAuthor

    You (listed and read sessions)

    • emailstring
    • namestring
  • forkedFromobject

    The artifact this session continues (POST /v1/artifacts/{id}/continue)

    • artifactIdstringrequired
    • versionintegerrequired
    • titlestring
  • messagesarray of ChatSessionMessagerequired
    • idstringrequired
    • sessionIdstringrequired
    • role"user" | "assistant"required
    • contentstringrequired

      Markdown (a question with images may have none)

    • status"complete" | "failed" | "refused"required

      Refused: the policy or budget refused the call (error says why); failed: it broke mid-way (content is what arrived)

    • mode"chat" | "ask"

      chat with any model you may use; ask (Ask your code) answers from your organization's Nexus Wiki, citing its pages

    • requestedModelstring
    • modelstring

      The model that ran

    • costUsdnumber
    • usageobject
      • promptTokensinteger
      • completionTokensinteger
    • citationsarray of ChatCitation
      • nintegerrequired

        The number the answer cites it by

      • repostringrequired

        Owner/name

      • pagestringrequired
      • slugstringrequired
      • sectionstring
      • pathstringrequired

        <slug>#<anchor> in the repository's wiki

      • filesarray of string

        Repository files the section names

      • runIdstringrequired

        The Nexus Wiki run that wrote the page

    • errorobject
      • codestring
      • messagestring
      • statusinteger
      • notifiedboolean

        A budget refusal told the organization's owners and admins (licensed build). Absent otherwise.

      • remainingUsdDecimalstring

        A budget refusal's remainingUsdDecimal: what was left of that level's budget, as an exact decimal. Absent when the 402 had none.

      • requestedUsdstring

        A usage-limit refusal's (usage_limit_reached) requestedUsd: the most the call may cost with Nexus's rate, as an exact decimal. Absent for any other refusal, or when the 402 had none.

      • remainingUsdstring

        A usage-limit refusal's (usage_limit_reached) remainingUsd: what this month's usage limit had left, as an exact decimal. Absent for any other refusal, or when the 402 had none.

      • detailsobject

        A 402's details, as the live error's error.nexus had them, cut to an allow-list: short codes, ways forward, notified and decimal dollar amounts. Absent for any other status, when none was kept, and on an answer stored before it.

        • reasonstring

          Why the refusal happened, such as authentication_required or disputed for payment_failed.

        • levelstring

          A budget refusal's level.

        • freeStartstring

          cheaper_models_only when the free start pays for cheaper models only.

        • nextarray of string

          The ways forward, such as billing and own_key; at most 4.

        • notifiedboolean

          The organization's owners and admins were told.

        • owedUsdstring
        • unpaidUsdstring
        • remainingUsdstring
        • remainingUsdDecimalstring
        • requestedUsdstring
        • limitUsdstring
        • chargeUsdstring
        • capUsdstring
    • createdAtstring (date-time)required
    • attachmentsarray of ChatAttachmentRef

      The images attached to a question

      • idstringrequired
      • type"image" | "file"required
      • mediaType"image/png" | "image/jpeg" | "image/gif" | "image/webp" | "text/csv" | "text/tab-separated-values" | "application/json" | "text/plain" | "text/markdown" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"required

        An image's from the bytes, not as it was named; a data file's from its extension, checked against the bytes

      • bytesintegerrequired
      • widthinteger
      • heightinteger
      • namestring
    • pageChatPageBlock

      A page this answer created or revised through write_page

      • pageIdstringrequired
      • versionintegerrequired

        min 1

      • titlestringrequired
      • format"html" | "md" | "jsx" | "sheet" | "board"required
    • skillsarray of ChatSkillBlock

      The skills this answer loaded through load_skill, in the order it loaded them. The file stays in the skills store

      • skillIdstringrequired

        Skl_… For a library skill, the library skill's id, which getSkill and getSkillVersion also take

      • namestringrequired

        The name the version had when it was served

      • versionintegerrequired

        The version served: a personal skill's latest, or a library skill's latest approved version that nobody withdrew

        min 1

      • scope"personal" | "team" | "org"

        Where the skill came from: your own skills, a team's library, or the organization's. Left out on an answer stored before skills had a scope: read it as personal

      • teamIdstring

        The team (team_…), for scope team. Map it to the team's name with listTeams

    • connectorsarray of ChatConnectorBlock

      The connector reads this answer ran through read_connector, in order. What they returned is never kept. In a shared artifact, a reader sees only the reads of connectors they may use

      • connectorstringrequired
      • operationstringrequired
      • inputobjectrequired
      • accountobject

        The connection the read ran with: whose it is and the account's name. Absent while the read streams, and on reads kept before it was recorded

        • scope"org" | "team" | "user"required
        • namestringrequired
    • sourcesarray of ChatWebSource

      The web pages this answer's searches gave the model, one per URL, in the order they were found. Only the session's author reads them; a shared artifact keeps none

      • titlestringrequired
      • urlstringrequired
      • datestring

        The page's date as the engine gave it, cut as the model read it

      • querystringrequired

        The first query in the turn that found this page

    • rewoundboolean

      Retained for the author, but excluded from future model context after a conversation rewind.

404No such session among yours (`chat_session_not_found`): someone else's session answers the same.application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

409An answer is still running (`chat_session_busy`), or the message is no longer part of the conversation (`chat_message_inactive`).application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

      Details of the error, when it has any: the policy rule 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
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 session among yours (`chat_session_not_found`): someone else's session answers the same.
409An answer is still running (`chat_session_busy`), or the message is no longer part of the conversation (`chat_message_inactive`).
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/chat/sessions/<id>/rewind" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "messageId": "<messageId>"
  }'

Suggest chat message

post/v1/chat/sessions/{id}/suggest

Suggest the message the person is most likely to send next. The call reads the session's cached prompt; nothing is stored.

chat.useEvery memberTry it in the API Explorer

Parameters

  • idpath · stringrequired

    The session's id (chs_…)

Responses

200OK. `suggestion` is null when the model offers none. It is also null, and no model is called, when the session's last message is not a complete answer or the organization turned `chatSuggestions` off.application/json

  • suggestionstring | nullrequired

    The suggested message, one line of at most 120 characters.

  • modelstring | nullrequired

    The model that wrote it; null when no model was called.

  • costUsdnumberrequired

    What the call cost. The session's costUsd does not count it; the ledger does.

404No such session among yours (`chat_session_not_found`): someone else's session answers the same.application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

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

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

Errors

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
404not_foundNothing matches the path in your organization
404No such session among yours (`chat_session_not_found`): someone else's session answers the same.
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/chat/sessions/<id>/suggest" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Get guest chat

get/v1/guest/chat

Guest chat for a signed-out visitor: whether this guest may send a round now, its rounds, and the model that answers.

publicAnyone, signed in or notTry it in the API Explorer

Parameters

  • X-Nexus-Guestheader · string (uuid)required

    The browser's guest id: a random UUID it keeps (in localStorage). Its rounds count under it.

Responses

200OKapplication/json

  • enabledbooleanrequired

    Whether a round from this guest id and address is within the rounds, the output tokens and the address's rounds now

  • rounds_usedintegerrequired

    The rounds this guest id has used

    min 0

  • rounds_limitintegerrequired

    The rounds a guest id gets

    min 0

  • modelstringrequired

    The display name of the model that answers every guest round, such as DeepSeek V4 Flash 0731

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

Example

curl
curl "$NEXUS_URL/v1/guest/chat"

Send guest chat message

post/v1/guest/chat/messages

One guest chat round: the answer streams as server-sent events, as sendChatMessage streams it, on the guest model, billed to the guest organization. Nothing of the chat is stored.

publicAnyone, signed in or notTry it in the API Explorer

Parameters

  • X-Nexus-Guestheader · string (uuid)required

    The browser's guest id: a random UUID it keeps (in localStorage). Its rounds count under it.

Request body · application/json

  • messagesarray of GuestChatMessagerequired

    The conversation, oldest first; the last one the guest's (user). 32,000 characters in all at most.

    at most 20 items

    • role"user" | "assistant"required
    • contentstringrequired

      min length 1

  • turnstilestringrequired

    The Cloudflare Turnstile widget's token

    min length 1 · max length 2048

Responses

200The answer, as an event streamtext/event-stream

  • idstring
  • object"chat.completion.chunk"
  • createdinteger
  • modelstring | null

    The model that runs

  • choicesarray of object
    • indexinteger
    • deltaobject
      • rolestring
      • contentstring
    • finish_reasonstring | null
  • usageobject
    • prompt_tokensinteger
    • completion_tokensinteger
    • total_tokensinteger
  • nexusobject
    • sessionChatSession

      A chat session, private to its author unless shared as an artifact.

      • idstringrequired
      • titlestringrequired

        The first question until you rename it

      • mode"chat" | "ask"required

        chat with any model you may use; ask (Ask your code) answers from your organization's Nexus Wiki, citing its pages

      • modelstringrequired

        The model asked for: nexus/auto by default

      • lastModelstring

        The model that ran last

      • teamstring

        The team its spend is attributed to

      • archivedbooleanrequired
      • webSearchboolean

        Whether the model may search the web in this session (default false)

      • messageCountintegerrequired
      • costUsdnumberrequired

        The sum of its model calls and of the web searches that returned results, settled in the ledger; a search that fails after the provider billed it is in the ledger, not in this sum

      • createdAtstring (date-time)required
      • updatedAtstring (date-time)required
      • visibility"private" | "shared"

        Private (the default) or shared: at least one active artifact

      • sharingChatSessionSharing

        How a shared session is shared: its newest active artifact

        • artifactIdstringrequired
        • versionintegerrequired
        • audienceArtifactAudiencerequired

          Who may read an artifact, besides its author: inside the organization, the whole organization, chosen teams (their members and the members of the teams under them) or chosen people; outside it, named people by email (external) or anyone with the link (public). Readers outside the organization see the kind only.

          • kind"org" | "teams" | "people" | "external" | "public"required
          • teamsarray of stringrequired

            Team slugs (kind teams)

          • peoplearray of stringrequired

            Members' emails (kind people); the outsiders with access (kind external). Empty for readers outside the organization.

        • allowContinuebooleanrequired
        • urlstringrequired

          The link to hand out: a public link (kind public), the fast viewer (kind external), else the artifact in Nexus UI; absolute when the Gateway knows Nexus UI's URL (NEXUS_UI_URL), else a path

        • pathstringrequired

          /app/<org>/artifacts/<id>

        • viewerUrlstring

          The fast viewer: <origin>/a/<id>

        • publicUrlstring

          Kind public: <origin>/a/<token>

        • expiresAtstring (date-time)

          Kind public: when the link stops opening

      • artifactsarray of ArtifactLink

        Every version shared from this session, newest first (revoked ones included)

        • idstringrequired
        • versionintegerrequired

          min 1

        • status"active" | "revoked"required
        • audience"org" | "teams" | "people" | "external" | "public"required
        • createdAtstring (date-time)required
        • revokedAtstring (date-time)
      • authorArtifactAuthor

        You (listed and read sessions)

        • emailstring
        • namestring
      • forkedFromobject

        The artifact this session continues (POST /v1/artifacts/{id}/continue)

        • artifactIdstringrequired
        • versionintegerrequired
        • titlestring
    • questionChatSessionMessage
      • idstringrequired
      • sessionIdstringrequired
      • role"user" | "assistant"required
      • contentstringrequired

        Markdown (a question with images may have none)

      • status"complete" | "failed" | "refused"required

        Refused: the policy or budget refused the call (error says why); failed: it broke mid-way (content is what arrived)

      • mode"chat" | "ask"

        chat with any model you may use; ask (Ask your code) answers from your organization's Nexus Wiki, citing its pages

      • requestedModelstring
      • modelstring

        The model that ran

      • costUsdnumber
      • usageobject
        • promptTokensinteger
        • completionTokensinteger
      • citationsarray of ChatCitation
        • nintegerrequired

          The number the answer cites it by

        • repostringrequired

          Owner/name

        • pagestringrequired
        • slugstringrequired
        • sectionstring
        • pathstringrequired

          <slug>#<anchor> in the repository's wiki

        • filesarray of string

          Repository files the section names

        • runIdstringrequired

          The Nexus Wiki run that wrote the page

      • errorobject
        • codestring
        • messagestring
        • statusinteger
        • notifiedboolean

          A budget refusal told the organization's owners and admins (licensed build). Absent otherwise.

        • remainingUsdDecimalstring

          A budget refusal's remainingUsdDecimal: what was left of that level's budget, as an exact decimal. Absent when the 402 had none.

        • requestedUsdstring

          A usage-limit refusal's (usage_limit_reached) requestedUsd: the most the call may cost with Nexus's rate, as an exact decimal. Absent for any other refusal, or when the 402 had none.

        • remainingUsdstring

          A usage-limit refusal's (usage_limit_reached) remainingUsd: what this month's usage limit had left, as an exact decimal. Absent for any other refusal, or when the 402 had none.

        • detailsobject

          A 402's details, as the live error's error.nexus had them, cut to an allow-list: short codes, ways forward, notified and decimal dollar amounts. Absent for any other status, when none was kept, and on an answer stored before it.

          • reasonstring

            Why the refusal happened, such as authentication_required or disputed for payment_failed.

          • levelstring

            A budget refusal's level.

          • freeStartstring

            cheaper_models_only when the free start pays for cheaper models only.

          • nextarray of string

            The ways forward, such as billing and own_key; at most 4.

          • notifiedboolean

            The organization's owners and admins were told.

          • owedUsdstring
          • unpaidUsdstring
          • remainingUsdstring
          • remainingUsdDecimalstring
          • requestedUsdstring
          • limitUsdstring
          • chargeUsdstring
          • capUsdstring
      • createdAtstring (date-time)required
      • attachmentsarray of ChatAttachmentRef

        The images attached to a question

        • idstringrequired
        • type"image" | "file"required
        • mediaType"image/png" | "image/jpeg" | "image/gif" | "image/webp" | "text/csv" | "text/tab-separated-values" | "application/json" | "text/plain" | "text/markdown" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"required

          An image's from the bytes, not as it was named; a data file's from its extension, checked against the bytes

        • bytesintegerrequired
        • widthinteger
        • heightinteger
        • namestring
      • pageChatPageBlock

        A page this answer created or revised through write_page

        • pageIdstringrequired
        • versionintegerrequired

          min 1

        • titlestringrequired
        • format"html" | "md" | "jsx" | "sheet" | "board"required
      • skillsarray of ChatSkillBlock

        The skills this answer loaded through load_skill, in the order it loaded them. The file stays in the skills store

        • skillIdstringrequired

          Skl_… For a library skill, the library skill's id, which getSkill and getSkillVersion also take

        • namestringrequired

          The name the version had when it was served

        • versionintegerrequired

          The version served: a personal skill's latest, or a library skill's latest approved version that nobody withdrew

          min 1

        • scope"personal" | "team" | "org"

          Where the skill came from: your own skills, a team's library, or the organization's. Left out on an answer stored before skills had a scope: read it as personal

        • teamIdstring

          The team (team_…), for scope team. Map it to the team's name with listTeams

      • connectorsarray of ChatConnectorBlock

        The connector reads this answer ran through read_connector, in order. What they returned is never kept. In a shared artifact, a reader sees only the reads of connectors they may use

        • connectorstringrequired
        • operationstringrequired
        • inputobjectrequired
        • accountobject

          The connection the read ran with: whose it is and the account's name. Absent while the read streams, and on reads kept before it was recorded

          • scope"org" | "team" | "user"required
          • namestringrequired
      • sourcesarray of ChatWebSource

        The web pages this answer's searches gave the model, one per URL, in the order they were found. Only the session's author reads them; a shared artifact keeps none

        • titlestringrequired
        • urlstringrequired
        • datestring

          The page's date as the engine gave it, cut as the model read it

        • querystringrequired

          The first query in the turn that found this page

      • rewoundboolean

        Retained for the author, but excluded from future model context after a conversation rewind.

    • messageChatSessionMessage
      • idstringrequired
      • sessionIdstringrequired
      • role"user" | "assistant"required
      • contentstringrequired

        Markdown (a question with images may have none)

      • status"complete" | "failed" | "refused"required

        Refused: the policy or budget refused the call (error says why); failed: it broke mid-way (content is what arrived)

      • mode"chat" | "ask"

        chat with any model you may use; ask (Ask your code) answers from your organization's Nexus Wiki, citing its pages

      • requestedModelstring
      • modelstring

        The model that ran

      • costUsdnumber
      • usageobject
        • promptTokensinteger
        • completionTokensinteger
      • citationsarray of ChatCitation
        • nintegerrequired

          The number the answer cites it by

        • repostringrequired

          Owner/name

        • pagestringrequired
        • slugstringrequired
        • sectionstring
        • pathstringrequired

          <slug>#<anchor> in the repository's wiki

        • filesarray of string

          Repository files the section names

        • runIdstringrequired

          The Nexus Wiki run that wrote the page

      • errorobject
        • codestring
        • messagestring
        • statusinteger
        • notifiedboolean

          A budget refusal told the organization's owners and admins (licensed build). Absent otherwise.

        • remainingUsdDecimalstring

          A budget refusal's remainingUsdDecimal: what was left of that level's budget, as an exact decimal. Absent when the 402 had none.

        • requestedUsdstring

          A usage-limit refusal's (usage_limit_reached) requestedUsd: the most the call may cost with Nexus's rate, as an exact decimal. Absent for any other refusal, or when the 402 had none.

        • remainingUsdstring

          A usage-limit refusal's (usage_limit_reached) remainingUsd: what this month's usage limit had left, as an exact decimal. Absent for any other refusal, or when the 402 had none.

        • detailsobject

          A 402's details, as the live error's error.nexus had them, cut to an allow-list: short codes, ways forward, notified and decimal dollar amounts. Absent for any other status, when none was kept, and on an answer stored before it.

          • reasonstring

            Why the refusal happened, such as authentication_required or disputed for payment_failed.

          • levelstring

            A budget refusal's level.

          • freeStartstring

            cheaper_models_only when the free start pays for cheaper models only.

          • nextarray of string

            The ways forward, such as billing and own_key; at most 4.

          • notifiedboolean

            The organization's owners and admins were told.

          • owedUsdstring
          • unpaidUsdstring
          • remainingUsdstring
          • remainingUsdDecimalstring
          • requestedUsdstring
          • limitUsdstring
          • chargeUsdstring
          • capUsdstring
      • createdAtstring (date-time)required
      • attachmentsarray of ChatAttachmentRef

        The images attached to a question

        • idstringrequired
        • type"image" | "file"required
        • mediaType"image/png" | "image/jpeg" | "image/gif" | "image/webp" | "text/csv" | "text/tab-separated-values" | "application/json" | "text/plain" | "text/markdown" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"required

          An image's from the bytes, not as it was named; a data file's from its extension, checked against the bytes

        • bytesintegerrequired
        • widthinteger
        • heightinteger
        • namestring
      • pageChatPageBlock

        A page this answer created or revised through write_page

        • pageIdstringrequired
        • versionintegerrequired

          min 1

        • titlestringrequired
        • format"html" | "md" | "jsx" | "sheet" | "board"required
      • skillsarray of ChatSkillBlock

        The skills this answer loaded through load_skill, in the order it loaded them. The file stays in the skills store

        • skillIdstringrequired

          Skl_… For a library skill, the library skill's id, which getSkill and getSkillVersion also take

        • namestringrequired

          The name the version had when it was served

        • versionintegerrequired

          The version served: a personal skill's latest, or a library skill's latest approved version that nobody withdrew

          min 1

        • scope"personal" | "team" | "org"

          Where the skill came from: your own skills, a team's library, or the organization's. Left out on an answer stored before skills had a scope: read it as personal

        • teamIdstring

          The team (team_…), for scope team. Map it to the team's name with listTeams

      • connectorsarray of ChatConnectorBlock

        The connector reads this answer ran through read_connector, in order. What they returned is never kept. In a shared artifact, a reader sees only the reads of connectors they may use

        • connectorstringrequired
        • operationstringrequired
        • inputobjectrequired
        • accountobject

          The connection the read ran with: whose it is and the account's name. Absent while the read streams, and on reads kept before it was recorded

          • scope"org" | "team" | "user"required
          • namestringrequired
      • sourcesarray of ChatWebSource

        The web pages this answer's searches gave the model, one per URL, in the order they were found. Only the session's author reads them; a shared artifact keeps none

        • titlestringrequired
        • urlstringrequired
        • datestring

          The page's date as the engine gave it, cut as the model read it

        • querystringrequired

          The first query in the turn that found this page

      • rewoundboolean

        Retained for the author, but excluded from future model context after a conversation rewind.

    • mode"chat" | "ask"

      chat with any model you may use; ask (Ask your code) answers from your organization's Nexus Wiki, citing its pages

    • requestedstring
    • citationsarray of ChatCitation
      • nintegerrequired

        The number the answer cites it by

      • repostringrequired

        Owner/name

      • pagestringrequired
      • slugstringrequired
      • sectionstring
      • pathstringrequired

        <slug>#<anchor> in the repository's wiki

      • filesarray of string

        Repository files the section names

      • runIdstringrequired

        The Nexus Wiki run that wrote the page

    • no_wikiboolean
    • toolobject

      A chat tool currently executing

      • name"write_page" | "load_skill" | "describe_connector" | "read_connector" | "web_search"required
      • status"running"required
    • skillChatSkillBlock

      A skill load_skill has just read

      • skillIdstringrequired

        Skl_… For a library skill, the library skill's id, which getSkill and getSkillVersion also take

      • namestringrequired

        The name the version had when it was served

      • versionintegerrequired

        The version served: a personal skill's latest, or a library skill's latest approved version that nobody withdrew

        min 1

      • scope"personal" | "team" | "org"

        Where the skill came from: your own skills, a team's library, or the organization's. Left out on an answer stored before skills had a scope: read it as personal

      • teamIdstring

        The team (team_…), for scope team. Map it to the team's name with listTeams

    • connectorChatConnectorBlock

      A connector read read_connector is about to run

      • connectorstringrequired
      • operationstringrequired
      • inputobjectrequired
      • accountobject

        The connection the read ran with: whose it is and the account's name. Absent while the read streams, and on reads kept before it was recorded

        • scope"org" | "team" | "user"required
        • namestringrequired
    • cost_usdnumber

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

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

Errors

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).

Example

curl
curl -X POST "$NEXUS_URL/v1/guest/chat/messages" \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [
      {
        "role": "user",
        "content": "<content>"
      }
    ],
    "turnstile": "<turnstile>"
  }'