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

API reference

Agents

nexus claude and nexus codex: model policy and sessions. The agents' model calls go through the agent gateway, where each is reserved, metered, checked against the organization's policy and attributed to the person and their session.

View as Markdown

Agent policy

get/v1/agents/policyDeprecated

Deprecated: an alias of GET /v1/policies/agents/{agent}. Allowed and default models for each coding agent (provider/model ids), as the model policy resolves them. An agent without a Gateway route (antigravity, cursor) allows none, and its defaultModel is empty.

org.readEvery memberTry it in the API Explorer

Responses

200OKapplication/json

  • agentsobject
    • claudeobject
      • allowedModelsarray of string
      • defaultModelstring
    • codexobject
      • allowedModelsarray of string
      • defaultModelstring
    • antigravityobject
      • allowedModelsarray of string
      • defaultModelstring
    • cursorobject
      • allowedModelsarray of string
      • defaultModelstring
    • opencodeobject
      • allowedModelsarray of string
      • defaultModelstring

403The credential does not hold `org.read`: a service account or sandbox key (`role_required`), or a scoped module key (`module_key`). Also `not_in_team` when `x-nexus-team` names a team the caller is not in.application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

404`x-nexus-team` names a team that 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.

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
404`x-nexus-team` names a team that does not exist in this organization (`unknown_team`).
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429rate_limit_errorToo many requests from this key in a minute

Example

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

Set agent policy alias

post/v1/agents/policyDeprecated

Deprecated: an alias that writes the agent's model policy: allowedModels becomes its allow list and defaultModel its default (a deny list already set stays).

policy.manageOwner, AdminTry it in the API Explorer

Parameters

  • Idempotency-Keyheader · string

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

Request body · application/json

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

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

  • allowedModelsarray of stringrequired
  • defaultModelstringrequired

Responses

200OKapplication/json

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

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

  • allowedModelsarray of string
  • defaultModelstring

400`agent` is not `claude`, `codex`, `antigravity` or `cursor`, or `allowedModels` (a non-empty list) or `defaultModel` is missing (`invalid_request`); `agent` runs only on the person's own plan (`route_unsupported`); or the rule it makes is not valid (`invalid_policy`).application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

403The caller does not hold `policy.manage`: only owners and admins set the agent policy (`role_required`). A scoped module key gets `module_key`.application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

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
400`agent` is not `claude`, `codex`, `antigravity` or `cursor`, or `allowedModels` (a non-empty list) or `defaultModel` is missing (`invalid_request`); `agent` runs only on the person's own plan (`route_unsupported`); or the rule it makes is not valid (`invalid_policy`).
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
403model_not_allowedThe caller does not hold `policy.manage`: only owners and admins set the agent policy (`role_required`). A scoped module key gets `module_key`.
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/agents/policy" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "agent": "claude",
    "allowedModels": [
      "anthropic/claude-fable-5.1"
    ],
    "defaultModel": "anthropic/claude-fable-5.1"
  }'

Check agent

post/v1/agents/check

May the agent launch on this model (no model: what nexus/default resolves to)? The model policy's decision, the same the gateway makes on every call. An agent without a Gateway route (antigravity, cursor) is a 400 route_unsupported.

products.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 · application/json

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

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

  • modelstring

    Model id (provider/model, the provider's own id, or nexus/auto); omit for the default

Responses

200OKapplication/json

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

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

  • modelstring | null
  • reasonstring
  • allowedModelsarray of string
  • defaultModelstring

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
400route_unsupportedAn agent without a Gateway route (`antigravity`, `cursor`) is a 400 `route_unsupported`
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
409idempotency_in_progressA request with the same Idempotency-Key is still running
409idempotency_interruptedThe first request with this Idempotency-Key was cut off and may have run in part
422idempotency_key_reusedThe Idempotency-Key was used with a different request
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/agents/check" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "agent": "claude"
  }'
TypeScript · @nexus/kit
import { createCoreClient } from "@nexus/kit";

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

Route agent

post/v1/agents/route

Auto for a coding agent's session before it starts: the model, who pays and why. A signed-in plan with room comes first; a paid model is only returned as ask_for_paid_fallback, for the client to confirm. A dry run: it opens no session and holds no money. A model the policy refuses is never returned.

products.useEvery memberTry it in the API Explorer

Request body · application/json

  • agent"claude" | "codex" | "antigravity" | "cursor" | "opencode" | "auto"required

    The agent to start, or auto for Auto to pick among agents

  • agentsarray of "claude" | "codex" | "antigravity" | "cursor" | "opencode"

    With agent auto: the person's agents Auto may pick from. Ignored otherwise

    at most 8 items

  • teamstring

    Team slug or id; omit for the caller's default

  • modelstring

    A pinned model: Auto then picks only who pays

  • plansarray of object

    The plan accounts the agent is signed in to on this machine

    at most 8 items

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

      The agent the account is signed in to; required with agent auto

    • accountintegerrequired

      The client's handle for the account, never an email

      min 0

    • modelsarray of objectrequired

      at most 64 items

      • idstringrequired

        The agent's own id or the catalog id

      • room"left" | "usedUp" | "unknown"required

        Every limit window that applies to the model, folded: usedUp when any is used up, unknown when a reading is missing or old

  • countsobject

    The first prompt as counts, never its text; omit before the first prompt

    • inputTokensinteger

      min 0

    • codeBlocksinteger

      min 0

    • imagesboolean

Responses

200OKapplication/json

  • result"use_plan" | "ask_for_paid_fallback" | "stop"required
  • agent"claude" | "codex" | "antigravity" | "cursor" | "opencode" | "auto"required

    The agent to start; auto on a stop of an agent auto request

  • versionstringrequired

    The auto router version that chose

  • reasonstringrequired

    Plan_at_floor, plan_below_floor, paid_at_floor, paid_below_floor or pinned; for stop: no_classifier, no_offer or pinned_unavailable

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

    Canonical model id

  • providerModelstring | null

    The id to start the agent with

  • effortstring | null
  • payer"plan" | "local_key" | "gateway"
  • accountinteger | null

    The plan account handle the request named

  • access"byok" | "nexus" | null

    Who pays on Gateway

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

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

Errors

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X POST "$NEXUS_URL/v1/agents/route" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent": "claude"
  }'

List agent sessions

get/v1/agents/sessions

This tenant's coding-agent sessions, newest first.

spend.read_ownEvery memberTry it in the API Explorer

Responses

200OKapplication/json

  • sessionsarray of AgentSession
    • idstring
    • agent"claude" | "codex" | "antigravity" | "cursor" | "opencode"

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

    • modelstring
    • via"nexus" | "subscription" | "ori"

      Nexus: every model call through Gateway's agent gateway; subscription: the person's own plan (Claude Code on their Claude login, Codex on their ChatGPT login), calls straight to the vendor, usage as the agent reported it; ori: sessions from before the agent gateway

    • access"subscription" | "byok" | "nexus"

      Who pays its model calls, as Gateway classified the session when it opened: subscription (the person's own plan), byok (the organization's own provider key, through Gateway) or nexus (Nexus's own key, for Nexus's own organizations; Nexus credit no longer pays an agent). Absent for ori, for sessions from before, and when no key would pay (Gateway refuses those calls).

    • personstring
    • cwdstring
    • startedAtstring (date-time)
    • endedAtstring (date-time)
    • durationMsnumber
    • exitCodeinteger
    • signalstring
    • agentSessionIdstring

      The agent's own conversation id: nexus claude --resume <id> or nexus codex resume <id> picks it up again.

      pattern ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$

    • status"running" | "succeeded" | "failed" | "interrupted" | "lost"
    • usageobject

      Subscription sessions, once the agent has reported: its calls summed. estimatedCostUsd is the list-price estimate of the priced calls (Claude Code's own, the catalog's for Codex), never charged; unpricedCalls counts the calls with no estimate

      • callsinteger
      • inputTokensinteger
      • outputTokensinteger
      • cacheReadTokensinteger
      • cacheCreationTokensinteger
      • estimatedCostUsdnumber
      • unpricedCallsinteger

        Calls with no estimate, because the agent stated no cost or the call names no model the catalog lists

      • modelsarray of string

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 `spend.read_own` (`role_required`: a service account, a sandbox, or an agent not granted it).application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

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

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

Errors

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429rate_limit_errorToo many requests from this key in a minute

Example

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

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

Open agent session

post/v1/agents/sessions

Open a session before launching an agent. Through the gateway (via nexus, the default) the model is checked on every call; via ori (sessions from before the agent gateway) it is checked here (403 if not allowed).

products.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 · application/json

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

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

  • via"nexus" | "subscription" | "ori"

    Nexus (default): the agent runs through the agent gateway; subscription: on the person's own Claude login, usage reported by Claude Code; ori: sessions from before the agent gateway

  • modelstring

    The model the agent was started on, as the agent names it; omit for the agent's default

  • personstring

    Who runs it, e.g. the OS user

    max length 80

  • cwdstring

    Working directory; only its basename is kept

  • teamstring

    A team slug you are in; default: your default team

  • planstring

    The plan tier of the person's own account, as the app read it on the device. claude: free, pro, max, team, enterprise or unknown; codex (ChatGPT): free, plus, pro, team, enterprise or unknown. Any other string is kept as unknown: a plan never refuses a session. Kept only where plan collection is on, and never shown on GET /v1/agents/sessions. Never send the raw string, an account id or an email.

Responses

201Createdapplication/json

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

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

  • modelstring
  • via"nexus" | "subscription" | "ori"

    Nexus: every model call through Gateway's agent gateway; subscription: the person's own plan (Claude Code on their Claude login, Codex on their ChatGPT login), calls straight to the vendor, usage as the agent reported it; ori: sessions from before the agent gateway

  • access"subscription" | "byok" | "nexus"

    Who pays its model calls, as Gateway classified the session when it opened: subscription (the person's own plan), byok (the organization's own provider key, through Gateway) or nexus (Nexus's own key, for Nexus's own organizations; Nexus credit no longer pays an agent). Absent for ori, for sessions from before, and when no key would pay (Gateway refuses those calls).

  • personstring
  • cwdstring
  • startedAtstring (date-time)
  • endedAtstring (date-time)
  • durationMsnumber
  • exitCodeinteger
  • signalstring
  • agentSessionIdstring

    The agent's own conversation id: nexus claude --resume <id> or nexus codex resume <id> picks it up again.

    pattern ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$

  • status"running" | "succeeded" | "failed" | "interrupted" | "lost"
  • usageobject

    Subscription sessions, once the agent has reported: its calls summed. estimatedCostUsd is the list-price estimate of the priced calls (Claude Code's own, the catalog's for Codex), never charged; unpricedCalls counts the calls with no estimate

    • callsinteger
    • inputTokensinteger
    • outputTokensinteger
    • cacheReadTokensinteger
    • cacheCreationTokensinteger
    • estimatedCostUsdnumber
    • unpricedCallsinteger

      Calls with no estimate, because the agent stated no cost or the call names no model the catalog lists

    • modelsarray of string

400The body is not valid: `agent` not claude, codex, antigravity or cursor, `via` not nexus, subscription or ori, `model`, `person` or `cwd` not a string, `team` not a slug, or a bad `Idempotency-Key`; or `via` nexus or ori for an agent that runs only on the person's own plan (`route_unsupported`).application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

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 `products.use` (`role_required`: a service account, a sandbox, or an agent not granted it), the team named is not the caller's (`not_in_team`), or the organization turned subscription sessions off (`subscriptions_disabled`).application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

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: `agent` not claude, codex, antigravity or cursor, `via` not nexus, subscription or ori, `model`, `person` or `cwd` not a string, `team` not a slug, or a bad `Idempotency-Key`; or `via` nexus or ori for an agent that runs only on the person's own plan (`route_unsupported`).
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/agents/sessions" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "agent": "claude"
  }'
TypeScript · @nexus/kit
import { createCoreClient } from "@nexus/kit";

const core = createCoreClient({ baseUrl: process.env.NEXUS_URL!, apiKey: process.env.NEXUS_API_KEY });
const result = await core.openAgentSession({ agent: "claude", via: "nexus", team: "platform" });

Get agent session

get/v1/agents/sessions/{id}

One coding-agent session with what its metered calls cost: yours, or any of the organization's for an owner or admin. Anyone else gets 404, as for an unknown id.

spend.read_ownEvery memberTry it in the API Explorer

Parameters

  • idpath · stringrequired

    The session's id

Responses

200OKapplication/json

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

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

  • modelstring
  • via"nexus" | "subscription" | "ori"

    Nexus: every model call through Gateway's agent gateway; subscription: the person's own plan (Claude Code on their Claude login, Codex on their ChatGPT login), calls straight to the vendor, usage as the agent reported it; ori: sessions from before the agent gateway

  • access"subscription" | "byok" | "nexus"

    Who pays its model calls, as Gateway classified the session when it opened: subscription (the person's own plan), byok (the organization's own provider key, through Gateway) or nexus (Nexus's own key, for Nexus's own organizations; Nexus credit no longer pays an agent). Absent for ori, for sessions from before, and when no key would pay (Gateway refuses those calls).

  • personstring
  • cwdstring
  • startedAtstring (date-time)
  • endedAtstring (date-time)
  • durationMsnumber
  • exitCodeinteger
  • signalstring
  • agentSessionIdstring

    The agent's own conversation id: nexus claude --resume <id> or nexus codex resume <id> picks it up again.

    pattern ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$

  • status"running" | "succeeded" | "failed" | "interrupted" | "lost"
  • usageobject

    Subscription sessions, once the agent has reported: its calls summed. estimatedCostUsd is the list-price estimate of the priced calls (Claude Code's own, the catalog's for Codex), never charged; unpricedCalls counts the calls with no estimate

    • callsinteger
    • inputTokensinteger
    • outputTokensinteger
    • cacheReadTokensinteger
    • cacheCreationTokensinteger
    • estimatedCostUsdnumber
    • unpricedCallsinteger

      Calls with no estimate, because the agent stated no cost or the call names no model the catalog lists

    • modelsarray of string
  • spendobjectrequired

    What the calls metered to this session cost (refused calls left out); zero without calls.

    • usdnumberrequired

      min 0

    • callsintegerrequired

      min 0

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

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

Errors

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

Example

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

Export agent sessions CSV

get/v1/agents/sessions/export.csv

Every coding-agent session of the organization that matches the filters, as CSV (owners and admins). Nexus Gateway keeps an organization's newest 500 sessions, so an older one is in no file. At most 100,000 rows a file: past that the file stops, and its manifest says complete: false and gives nextCursor. Each export is an audit event (observability.exported) with the file's manifest, never its rows. An organization runs at most 60 exports an hour: the 61st is a 429 export_rate_limited, whose Retry-After is the seconds until the hour frees one (the RateLimit-* headers stay the per-minute limit's). A bad filter is a 400 before any row.

spend.exportOwner, AdminTry it in the API Explorer

Parameters

  • fromquery · string (date)

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

  • toquery · string (date)

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

  • teamquery · string

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

  • personquery · string

    A person's user id

  • agentquery · "claude" | "codex" | "antigravity" | "cursor" | "opencode"

    claude, codex, antigravity or cursor

  • viaquery · "nexus" | "subscription" | "ori"

    nexus, subscription or ori

  • statusquery · string

    A comma-separated set of running, succeeded, failed and interrupted; default all four

  • cursorquery · string

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

Responses

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

string

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

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

Errors

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429export_rate_limitedThe 61st is a 429 `export_rate_limited`, whose `Retry-After` is the seconds until the hour frees one (the `RateLimit-*` headers stay the per-minute limit's)
429rate_limit_errorToo many requests from this key in a minute

Example

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

const core = createCoreClient({ baseUrl: process.env.NEXUS_URL!, apiKey: process.env.NEXUS_API_KEY });
const result = await core.agentSessionsExport("csv", { agent: "claude" });

Export agent sessions JSON Lines

get/v1/agents/sessions/export.jsonl

Every coding-agent session of the organization that matches the filters, as JSON Lines (owners and admins). Nexus Gateway keeps an organization's newest 500 sessions, so an older one is in no file. At most 100,000 rows a file: past that the file stops, and its manifest says complete: false and gives nextCursor. Each export is an audit event (observability.exported) with the file's manifest, never its rows. An organization runs at most 60 exports an hour: the 61st is a 429 export_rate_limited, whose Retry-After is the seconds until the hour frees one (the RateLimit-* headers stay the per-minute limit's). A bad filter is a 400 before any row.

spend.exportOwner, AdminTry it in the API Explorer

Parameters

  • fromquery · string (date)

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

  • toquery · string (date)

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

  • teamquery · string

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

  • personquery · string

    A person's user id

  • agentquery · "claude" | "codex" | "antigravity" | "cursor" | "opencode"

    claude, codex, antigravity or cursor

  • viaquery · "nexus" | "subscription" | "ori"

    nexus, subscription or ori

  • statusquery · string

    A comma-separated set of running, succeeded, failed and interrupted; default all four

  • cursorquery · string

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

Responses

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

string

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

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

Errors

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429export_rate_limitedThe 61st is a 429 `export_rate_limited`, whose `Retry-After` is the seconds until the hour frees one (the `RateLimit-*` headers stay the per-minute limit's)
429rate_limit_errorToo many requests from this key in a minute

Example

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

const core = createCoreClient({ baseUrl: process.env.NEXUS_URL!, apiKey: process.env.NEXUS_API_KEY });
const result = await core.agentSessionsExport("jsonl", { agent: "claude" });

End agent session

post/v1/agents/sessions/{id}/end

Close a session with the agent's exit code and duration.

products.useEvery memberTry it in the API Explorer

Parameters

  • idpath · stringrequired
  • Idempotency-Keyheader · string

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

Request body · application/json

  • exitCodeintegerrequired

    min 0 · max 255

  • durationMsnumber

    min 0

  • signalstring
  • agentSessionIdstring

    The agent's own conversation id (Claude Code's session id, Codex's rollout id), so the session can be resumed.

    pattern ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$

Responses

200OKapplication/json

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

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

  • modelstring
  • via"nexus" | "subscription" | "ori"

    Nexus: every model call through Gateway's agent gateway; subscription: the person's own plan (Claude Code on their Claude login, Codex on their ChatGPT login), calls straight to the vendor, usage as the agent reported it; ori: sessions from before the agent gateway

  • access"subscription" | "byok" | "nexus"

    Who pays its model calls, as Gateway classified the session when it opened: subscription (the person's own plan), byok (the organization's own provider key, through Gateway) or nexus (Nexus's own key, for Nexus's own organizations; Nexus credit no longer pays an agent). Absent for ori, for sessions from before, and when no key would pay (Gateway refuses those calls).

  • personstring
  • cwdstring
  • startedAtstring (date-time)
  • endedAtstring (date-time)
  • durationMsnumber
  • exitCodeinteger
  • signalstring
  • agentSessionIdstring

    The agent's own conversation id: nexus claude --resume <id> or nexus codex resume <id> picks it up again.

    pattern ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$

  • status"running" | "succeeded" | "failed" | "interrupted" | "lost"
  • usageobject

    Subscription sessions, once the agent has reported: its calls summed. estimatedCostUsd is the list-price estimate of the priced calls (Claude Code's own, the catalog's for Codex), never charged; unpricedCalls counts the calls with no estimate

    • callsinteger
    • inputTokensinteger
    • outputTokensinteger
    • cacheReadTokensinteger
    • cacheCreationTokensinteger
    • estimatedCostUsdnumber
    • unpricedCallsinteger

      Calls with no estimate, because the agent stated no cost or the call names no model the catalog lists

    • modelsarray of string

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

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

Errors

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
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/agents/sessions/<id>/end" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "exitCode": 0,
    "signal": "SIGINT"
  }'
TypeScript · @nexus/kit
import { createCoreClient } from "@nexus/kit";

const core = createCoreClient({ baseUrl: process.env.NEXUS_URL!, apiKey: process.env.NEXUS_API_KEY });
const result = await core.endAgentSession("<session id>", { exitCode: 0, durationMs: 42_000 });

Heartbeat agent session

post/v1/agents/sessions/{id}/heartbeat

Say the agent still runs. The CLI sends one every 5 minutes; a running session with none for 15 minutes reads as lost until the next one or its end.

products.useEvery memberTry it in the API Explorer

Parameters

  • idpath · stringrequired
  • Idempotency-Keyheader · string

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

Responses

200OKapplication/json

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

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

  • modelstring
  • via"nexus" | "subscription" | "ori"

    Nexus: every model call through Gateway's agent gateway; subscription: the person's own plan (Claude Code on their Claude login, Codex on their ChatGPT login), calls straight to the vendor, usage as the agent reported it; ori: sessions from before the agent gateway

  • access"subscription" | "byok" | "nexus"

    Who pays its model calls, as Gateway classified the session when it opened: subscription (the person's own plan), byok (the organization's own provider key, through Gateway) or nexus (Nexus's own key, for Nexus's own organizations; Nexus credit no longer pays an agent). Absent for ori, for sessions from before, and when no key would pay (Gateway refuses those calls).

  • personstring
  • cwdstring
  • startedAtstring (date-time)
  • endedAtstring (date-time)
  • durationMsnumber
  • exitCodeinteger
  • signalstring
  • agentSessionIdstring

    The agent's own conversation id: nexus claude --resume <id> or nexus codex resume <id> picks it up again.

    pattern ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$

  • status"running" | "succeeded" | "failed" | "interrupted" | "lost"
  • usageobject

    Subscription sessions, once the agent has reported: its calls summed. estimatedCostUsd is the list-price estimate of the priced calls (Claude Code's own, the catalog's for Codex), never charged; unpricedCalls counts the calls with no estimate

    • callsinteger
    • inputTokensinteger
    • outputTokensinteger
    • cacheReadTokensinteger
    • cacheCreationTokensinteger
    • estimatedCostUsdnumber
    • unpricedCallsinteger

      Calls with no estimate, because the agent stated no cost or the call names no model the catalog lists

    • modelsarray of string

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

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

Errors

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
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/agents/sessions/<id>/heartbeat" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Report agent session usage

post/v1/agents/sessions/{id}/usage

Usage from a subscription session as an OpenTelemetry logs export (OTLP/HTTP JSON). Cursor sessions return 409 usage_unsupported. A record whose event.name (else its body) is api_request or claude_code.api_request counts as one model call. A request_id seen among the session's last 512 does not count again. Codex's codex.sse_event for response.completed counts too, once per conversation.id and event.timestamp. Other records are dropped unread. A body without resourceLogs is a 400.

products.useEvery memberTry it in the API Explorer

Parameters

  • idpath · stringrequired
  • Idempotency-Keyheader · string

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

Request body · application/json

  • resourceLogsarray of object

Responses

200OK: an OTLP ExportLogsServiceResponse, empty, or with partialSuccess counting the entries that were not log objectsapplication/json

  • partialSuccessobject
    • rejectedLogRecordsinteger
    • errorMessagestring

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
409usage_unsupportedCursor sessions return 409 `usage_unsupported`
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/agents/sessions/<id>/usage" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "resourceLogs": [
      {}
    ]
  }'

Get agent access

get/v1/agents/access

Routes for coding agents with a released Nexus launcher: for each agent, the route it takes when you name none (from: your preference, the default, or the organization when it turned subscriptions off), each route with who pays (the organization's own key, Nexus, or your plan), whether it can run, and the commands that install and sign in the agent.

products.useEvery memberTry it in the API Explorer

Responses

200OKapplication/json

  • agentSubscriptionsbooleanrequired

    Whether the organization allows subscription routes (GET/PUT /v1/orgs/settings)

  • agentsarray of AgentAccessEntryrequired
    • agent"claude" | "codex" | "antigravity" | "cursor" | "opencode"required

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

    • namestringrequired
    • installstringrequired

      How to install the agent (the vendor's own package; Nexus never installs it)

    • route"gateway" | "subscription"required

      The route it takes when the person names none

    • from"preference" | "default" | "organization"required

      Why: the person's preference, the default (gateway), or the organization (subscriptions turned off while the person prefers one)

    • preference"gateway" | "subscription"

      The person's saved route; absent when none

    • routesarray of AgentRouterequired
      • route"gateway" | "subscription"required
      • access"byok" | "nexus" | "subscription" | nullrequired

        Who pays on this route: byok (the organization's own key), nexus (a key Nexus pays for) or subscription (the person's plan); null on gateway when no key would pay

      • availablebooleanrequired

        Whether the route can run now; reason says why not

      • reasonstring

        Why it cannot, and the command that fixes it

      • providerstring

        Gateway: the provider Gateway calls

      • planstring

        Subscription: the plan it runs on

      • vendorstring
      • loginstring

        Subscription: how to sign the agent in to the plan, once, on the person's machine

      • loginStatusstring

        Subscription: how to check that sign-in

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

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

Errors

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429rate_limit_errorToo many requests from this key in a minute

Example

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

Set agent access

put/v1/agents/access

Choose the route each of your coding agents takes when you name none (nexus agents use), in every client: gateway or subscription; null forgets it (the default: subscription, or gateway when the organization turned subscription mode off). Yours in every organization, not audited (each session records its route). 403 subscriptions_disabled for a subscription the organization turned off; 400 route_unsupported for the gateway route of an agent that runs only on the person's own plan; 400 for a key-only organization key (a route belongs to a person).

products.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 · application/json

  • claude"gateway" | "subscription" | null
  • codex"gateway" | "subscription" | null
  • antigravity"subscription" | null

    Antigravity runs only on the person's Google AI plan: gateway is a 400 route_unsupported.

  • cursor"subscription" | null

    Cursor runs only on the person's Cursor plan: gateway is a 400 route_unsupported.

  • opencode"subscription" | null

    OpenCode uses its configured provider. Gateway refuses gateway with route_unsupported.

Responses

200OKapplication/json

  • agentSubscriptionsbooleanrequired

    Whether the organization allows subscription routes (GET/PUT /v1/orgs/settings)

  • agentsarray of AgentAccessEntryrequired
    • agent"claude" | "codex" | "antigravity" | "cursor" | "opencode"required

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

    • namestringrequired
    • installstringrequired

      How to install the agent (the vendor's own package; Nexus never installs it)

    • route"gateway" | "subscription"required

      The route it takes when the person names none

    • from"preference" | "default" | "organization"required

      Why: the person's preference, the default (gateway), or the organization (subscriptions turned off while the person prefers one)

    • preference"gateway" | "subscription"

      The person's saved route; absent when none

    • routesarray of AgentRouterequired
      • route"gateway" | "subscription"required
      • access"byok" | "nexus" | "subscription" | nullrequired

        Who pays on this route: byok (the organization's own key), nexus (a key Nexus pays for) or subscription (the person's plan); null on gateway when no key would pay

      • availablebooleanrequired

        Whether the route can run now; reason says why not

      • reasonstring

        Why it cannot, and the command that fixes it

      • providerstring

        Gateway: the provider Gateway calls

      • planstring

        Subscription: the plan it runs on

      • vendorstring
      • loginstring

        Subscription: how to sign the agent in to the plan, once, on the person's machine

      • loginStatusstring

        Subscription: how to check that sign-in

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
400route_unsupported403 `subscriptions_disabled` for a subscription the organization turned off; 400 `route_unsupported` for the gateway route of an agent that runs only on the person's own plan; 400 for a key-only organization key (a route belongs to a person)
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
403subscriptions_disabled403 `subscriptions_disabled` for a subscription the organization turned off; 400 `route_unsupported` for the gateway route of an agent that runs only on the person's own plan; 400 for a key-only organization key (a route belongs to a person)
409idempotency_in_progressA request with the same Idempotency-Key is still running
409idempotency_interruptedThe first request with this Idempotency-Key was cut off and may have run in part
422idempotency_key_reusedThe Idempotency-Key was used with a different request
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X PUT "$NEXUS_URL/v1/agents/access" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "claude": "subscription",
    "codex": null
  }'

List assistant conversations

get/v1/agents/conversations

The Nexus assistant's conversations of yours, newest change first, without their messages. limit is 1 to 100 (30 when absent); after is the last page's next; archived=true includes archived ones; externalKey answers only the live conversation under that key, if any. Your own conversations only: the organization and the person come from the credential, never from the request, and another person's is a 404. The person, or their own agent link that holds agents.memory (on the person's opt-in); any other caller answers 403, and no operator grant names it. Off, every call is a 404 assistant_conversations_off (NEXUS_ASSISTANT_CONVERSATIONS).

agents.memoryEvery memberTry it in the API Explorer

Parameters

  • afterquery · string

    The next of the page before

  • limitquery · integer
  • archivedquery · boolean
  • externalKeyquery · string

    Only the live conversation under this key, such as slack:T1:C1:1712.34

Responses

200OKapplication/json

  • conversationsarray of AssistantConversationrequired
    • idstringrequired
    • titlestringrequired
    • externalKeystring | nullrequired

      What the conversation continues, when its creator named it

    • messageCountintegerrequired
    • createdAtstringrequired
    • updatedAtstringrequired
    • archivedAtstring | nullrequired
  • nextstring | nullrequired

    The after of the next page; null on the last

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

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

Errors

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
404assistant_conversations_offOff, every call is a 404 `assistant_conversations_off` (NEXUS_ASSISTANT_CONVERSATIONS)
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/agents/conversations" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Create assistant conversation

post/v1/agents/conversations

Starts a conversation, or returns your live one under the same externalKey (200, created: false). 201 for a new one. A person holds at most 1000 live conversations (413 assistant_conversations_full). Your own conversations only: the organization and the person come from the credential, never from the request, and another person's is a 404. The person, or their own agent link that holds agents.memory (on the person's opt-in); any other caller answers 403, and no operator grant names it. Off, every call is a 404 assistant_conversations_off (NEXUS_ASSISTANT_CONVERSATIONS).

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

  • titlestring

    max length 200

  • externalKeystring

    min length 1 · max length 256

Responses

200The live conversation under the same externalKeyapplication/json

  • idstringrequired
  • titlestringrequired
  • externalKeystring | nullrequired

    What the conversation continues, when its creator named it

  • messageCountintegerrequired
  • createdAtstringrequired
  • updatedAtstringrequired
  • archivedAtstring | nullrequired
  • createdbooleanrequired

    False when the externalKey already named a live conversation

201Createdapplication/json

  • idstringrequired
  • titlestringrequired
  • externalKeystring | nullrequired

    What the conversation continues, when its creator named it

  • messageCountintegerrequired
  • createdAtstringrequired
  • updatedAtstringrequired
  • archivedAtstring | nullrequired
  • createdbooleanrequired

    False when the externalKey already named a live conversation

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
404assistant_conversations_offOff, every call is a 404 `assistant_conversations_off` (NEXUS_ASSISTANT_CONVERSATIONS)
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/agents/conversations" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "<title>",
    "externalKey": "<externalKey>"
  }'

Get assistant conversation

get/v1/agents/conversations/{id}

One conversation and a page of its messages, in order. after is the number of the last message you read (the first page when absent); limit is 1 to 500 (100 when absent); nextAfter is the after of the next page. Your own conversations only: the organization and the person come from the credential, never from the request, and another person's is a 404. The person, or their own agent link that holds agents.memory (on the person's opt-in); any other caller answers 403, and no operator grant names it. Off, every call is a 404 assistant_conversations_off (NEXUS_ASSISTANT_CONVERSATIONS).

agents.memoryEvery memberTry it in the API Explorer

Parameters

  • idpath · stringrequired

    A conversation's id, as the list or the create answered it (404 assistant_conversation_not_found)

  • afterquery · integer
  • limitquery · integer

Responses

200OKapplication/json

  • idstringrequired
  • titlestringrequired
  • externalKeystring | nullrequired

    What the conversation continues, when its creator named it

  • messageCountintegerrequired
  • createdAtstringrequired
  • updatedAtstringrequired
  • archivedAtstring | nullrequired
  • messagesarray of AssistantMessagerequired
    • seqintegerrequired

      min 0

    • role"user" | "assistant" | "tool"required
    • contentanyrequired

      Any JSON but null, as it was written

    • createdAtstringrequired
  • nextAfterinteger | nullrequired

    The after of the next page of messages; null on the last

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

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

Errors

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
404not_foundNothing matches the path in your organization
404assistant_conversations_offOff, every call is a 404 `assistant_conversations_off` (NEXUS_ASSISTANT_CONVERSATIONS)
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/agents/conversations/<id>" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Rename assistant conversation

patch/v1/agents/conversations/{id}

Renames a conversation: a title of at most 200 characters. Your own conversations only: the organization and the person come from the credential, never from the request, and another person's is a 404. The person, or their own agent link that holds agents.memory (on the person's opt-in); any other caller answers 403, and no operator grant names it. Off, every call is a 404 assistant_conversations_off (NEXUS_ASSISTANT_CONVERSATIONS).

agents.memoryEvery memberTry it in the API Explorer

Parameters

  • idpath · stringrequired

    A conversation's id, as the list or the create answered it (404 assistant_conversation_not_found)

  • Idempotency-Keyheader · string

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

Request body · application/json

  • titlestringrequired

    max length 200

Responses

200OKapplication/json

  • idstringrequired
  • titlestringrequired
  • externalKeystring | nullrequired

    What the conversation continues, when its creator named it

  • messageCountintegerrequired
  • createdAtstringrequired
  • updatedAtstringrequired
  • archivedAtstring | nullrequired

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
404assistant_conversations_offOff, every call is a 404 `assistant_conversations_off` (NEXUS_ASSISTANT_CONVERSATIONS)
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/agents/conversations/<id>" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "<title>"
  }'

Append assistant messages

post/v1/agents/conversations/{id}/messages

Appends messages, numbered from 0, each one after the one before. Idempotent by seq: a message the conversation already holds with the same role and content changes nothing, so a retried batch is safe; other content at a held seq is a 409 assistant_seq_conflict, a seq past the next one a 409 assistant_seq_gap (nextSeq in the error), and an archived conversation takes no new message (409 assistant_conversation_archived). 1 to 100 messages of at most 256 KiB each; a conversation holds at most 5000 (413). Content is stored readable, not sealed. Your own conversations only: the organization and the person come from the credential, never from the request, and another person's is a 404. The person, or their own agent link that holds agents.memory (on the person's opt-in); any other caller answers 403, and no operator grant names it. Off, every call is a 404 assistant_conversations_off (NEXUS_ASSISTANT_CONVERSATIONS).

agents.memoryEvery memberTry it in the API Explorer

Parameters

  • idpath · stringrequired

    A conversation's id, as the list or the create answered it (404 assistant_conversation_not_found)

  • Idempotency-Keyheader · string

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

Request body · application/json

  • messagesarray of NewAssistantMessagerequired

    at most 100 items

    • seqintegerrequired

      min 0

    • role"user" | "assistant" | "tool"required
    • contentanyrequired

      Any JSON but null; at most 256 KiB

Responses

200OKapplication/json

  • writtenintegerrequired

    How many messages the append wrote; the ones already held do not count

  • nextSeqintegerrequired

    The number the next message takes

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
404assistant_conversations_offOff, every call is a 404 `assistant_conversations_off` (NEXUS_ASSISTANT_CONVERSATIONS)
409seqA message the conversation already holds with the same role and content changes nothing, so a retried batch is safe; other content at a held `seq` is a 409 assistant_seq_conflict, a `seq` past the next one a 409 assistant_seq_gap (`nextSeq` in the error), and an archived conversation takes no new message (409 assistant_conversation_archived)
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/agents/conversations/<id>/messages" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [
      {
        "seq": 0,
        "role": "user"
      }
    ]
  }'

Archive assistant conversation

post/v1/agents/conversations/{id}/archive

Archives a conversation: it leaves the default list, keeps its messages, and takes no new ones. Archiving again changes nothing. Nothing is deleted; account deletion and a member's removal delete conversations. Your own conversations only: the organization and the person come from the credential, never from the request, and another person's is a 404. The person, or their own agent link that holds agents.memory (on the person's opt-in); any other caller answers 403, and no operator grant names it. Off, every call is a 404 assistant_conversations_off (NEXUS_ASSISTANT_CONVERSATIONS).

agents.memoryEvery memberTry it in the API Explorer

Parameters

  • idpath · stringrequired

    A conversation's id, as the list or the create answered it (404 assistant_conversation_not_found)

  • Idempotency-Keyheader · string

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

Responses

200OKapplication/json

  • idstringrequired
  • titlestringrequired
  • externalKeystring | nullrequired

    What the conversation continues, when its creator named it

  • messageCountintegerrequired
  • createdAtstringrequired
  • updatedAtstringrequired
  • archivedAtstring | nullrequired

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
404assistant_conversations_offOff, every call is a 404 `assistant_conversations_off` (NEXUS_ASSISTANT_CONVERSATIONS)
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/agents/conversations/<id>/archive" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Clear agent memory

DEL/v1/agents/memory

Delete every row of your agent memory in this organization: forget, unlink and uninstall. Audited as agent.memory_cleared when a row went. Your own rows only: the organization and the person come from the credential, never from the request. The person, or their own agent link that holds agents.memory (on the person's opt-in); any other caller answers 403, and no operator grant names it.

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

Responses

200OKapplication/json

  • deletedintegerrequired

    How many rows went

    min 0

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

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

Errors

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
409idempotency_in_progressA request with the same Idempotency-Key is still running
409idempotency_interruptedThe first request with this Idempotency-Key was cut off and may have run in part
422idempotency_key_reusedThe Idempotency-Key was used with a different request
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X DELETE "$NEXUS_URL/v1/agents/memory" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

List agent memory

get/v1/agents/memory/{collection}

One page of your agent memory's keys in a collection, in byte order, with their versions and no values. limit is 1 to 1000 (100 when absent; 400 agent_memory_limit_invalid); after is the last key of the page before (next). Your own rows only: the organization and the person come from the credential, never from the request. The person, or their own agent link that holds agents.memory (on the person's opt-in); any other caller answers 403, and no operator grant names it.

agents.memoryEvery memberTry it in the API Explorer

Parameters

  • collectionpath · stringrequired

    1 to 64 characters: a lowercase letter, then lowercase letters, digits, _ or - (400 agent_memory_collection_invalid)

  • afterquery · string

    The next of the page before

  • limitquery · integer

Responses

200OKapplication/json

  • collectionstringrequired
  • keysarray of AgentMemoryEntryrequired
    • keystringrequired
    • versionintegerrequired

      What a later write names in If-Match. It never repeats, also after a delete.

      min 1

    • updatedAtstring (date-time)required
  • nextstring | nullrequired

    The after of the next page; null on the last

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

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

Errors

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
404not_foundNothing matches the path in your organization
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl "$NEXUS_URL/v1/agents/memory/<collection>" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Get agent memory

get/v1/agents/memory/{collection}/{key}

One row of your agent memory: the value as the agent sealed it, and its version (also the ETag). 404 agent_memory_not_found when there is none. Your own rows only: the organization and the person come from the credential, never from the request. The person, or their own agent link that holds agents.memory (on the person's opt-in); any other caller answers 403, and no operator grant names it.

agents.memoryEvery memberTry it in the API Explorer

Parameters

  • collectionpath · stringrequired

    1 to 64 characters: a lowercase letter, then lowercase letters, digits, _ or - (400 agent_memory_collection_invalid)

  • keypath · stringrequired

    1 to 256 characters of A-Z, a-z, 0-9, ., _, ~ and -, and not . or .. (400 agent_memory_key_invalid). Encode any other key, as base64url.

Responses

200OKapplication/json

  • collectionstringrequired
  • keystringrequired
  • valuestringrequired

    The agent's sealed text, as it wrote it

  • versionintegerrequired

    What a later write names in If-Match. It never repeats, also after a delete.

    min 1

  • updatedAtstring (date-time)required

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

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

Errors

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

Example

curl
curl "$NEXUS_URL/v1/agents/memory/<collection>/<key>" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Set agent memory

put/v1/agents/memory/{collection}/{key}

Write one row of your agent memory, if it is as you read it: If-Match: <version> replaces the row at that version, and If-None-Match: * creates it. With neither, a 428 agent_memory_precondition_required. A write that loses a race, or creates a row that exists, is a 409 agent_memory_version_conflict, and nothing changes. The value is the agent's sealed text, 1 byte to 256 KiB (413 agent_memory_value_too_large); Gateway never opens it. You hold at most 1000 rows and 8 MiB in an organization (413 agent_memory_full). Versions never repeat, also after a delete. Audited as agent.memory_written, without the value. Your own rows only: the organization and the person come from the credential, never from the request. The person, or their own agent link that holds agents.memory (on the person's opt-in); any other caller answers 403, and no operator grant names it.

agents.memoryEvery memberTry it in the API Explorer

Parameters

  • collectionpath · stringrequired

    1 to 64 characters: a lowercase letter, then lowercase letters, digits, _ or - (400 agent_memory_collection_invalid)

  • keypath · stringrequired

    1 to 256 characters of A-Z, a-z, 0-9, ., _, ~ and -, and not . or .. (400 agent_memory_key_invalid). Encode any other key, as base64url.

  • If-Matchheader · string

    The version the write read ("12" or 12, the row's ETag). The write happens only while the row is at it.

  • If-None-Matchheader · "*"

    *: create the row, only when none exists.

  • Idempotency-Keyheader · string

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

Request body · application/json

  • valuestringrequired

    The agent's sealed text, at most 256 KiB

    min length 1

Responses

200Writtenapplication/json

  • collectionstringrequired
  • keystringrequired
  • versionintegerrequired

    What a later write names in If-Match. It never repeats, also after a delete.

    min 1

  • createdbooleanrequired

    True when the write made the row (If-None-Match: *)

  • updatedAtstring (date-time)required

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

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

Errors

StatusCodeWhen
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
409idempotency_in_progressA request with the same Idempotency-Key is still running
409idempotency_interruptedThe first request with this Idempotency-Key was cut off and may have run in part
422idempotency_key_reusedThe Idempotency-Key was used with a different request
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X PUT "$NEXUS_URL/v1/agents/memory/<collection>/<key>" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "value": "<value>"
  }'

Delete agent memory

DEL/v1/agents/memory/{collection}/{key}

Delete one row of your agent memory; with If-Match, only at that version (409 agent_memory_version_conflict otherwise). Without it, a missing row is a 404 agent_memory_not_found. Audited as agent.memory_deleted. Your own rows only: the organization and the person come from the credential, never from the request. The person, or their own agent link that holds agents.memory (on the person's opt-in); any other caller answers 403, and no operator grant names it.

agents.memoryEvery memberTry it in the API Explorer

Parameters

  • collectionpath · stringrequired

    1 to 64 characters: a lowercase letter, then lowercase letters, digits, _ or - (400 agent_memory_collection_invalid)

  • keypath · stringrequired

    1 to 256 characters of A-Z, a-z, 0-9, ., _, ~ and -, and not . or .. (400 agent_memory_key_invalid). Encode any other key, as base64url.

  • If-Matchheader · string

    The version the write read ("12" or 12, the row's ETag). The write happens only while the row is at it.

  • Idempotency-Keyheader · string

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

Responses

200OKapplication/json

  • collectionstringrequired
  • keystringrequired
  • versionintegerrequired

    The version the row had

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
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/agents/memory/<collection>/<key>" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

List agent state

get/v1/agents/state/{collection}

One page of the agents service's keys in a collection, in byte order, with their versions and no values. limit is 1 to 1000 (100 when absent; 400 agent_memory_limit_invalid); after is the last key of the page before (next). The agents service only, with its platform secret in x-nexus-agents-secret: no person, key, agent link or operator of an organization reaches these rows, and every other route refuses the secret with a 403. Gateway never opens a value, and writes no audit event: the rows belong to no organization.

Parameters

  • collectionpath · stringrequired

    1 to 64 characters: a lowercase letter, then lowercase letters, digits, _ or - (400 agent_memory_collection_invalid)

  • afterquery · string

    The next of the page before

  • limitquery · integer

Responses

200OKapplication/json

  • collectionstringrequired
  • keysarray of AgentMemoryEntryrequired
    • keystringrequired
    • versionintegerrequired

      What a later write names in If-Match. It never repeats, also after a delete.

      min 1

    • updatedAtstring (date-time)required
  • nextstring | nullrequired

    The after of the next page; null on the last

400The platform secret came with another credential, or twice (`credential_conflict`); or a bad collection, key, limit or preconditionapplication/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

      Details of the error, when it has any: the policy rule 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, or a wrong platform secret (`missing_credential`, `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.

403Any other credential: a person's token, an agent link, a service account key, a module key or Nexus UI's secret (`agents_secret_refused`, `role_required`)application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

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

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

503The Gateway holds no platform secret (`not_configured`)application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

Errors

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
400The platform secret came with another credential, or twice (`credential_conflict`); or a bad collection, key, limit or precondition
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
404not_foundNothing matches the path in your organization
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429rate_limit_errorToo many requests from this key in a minute
503The Gateway holds no platform secret (`not_configured`)

Example

curl
curl "$NEXUS_URL/v1/agents/state/<collection>" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Get agent state

get/v1/agents/state/{collection}/{key}

One row of the agents service's own state (its links, journal and approvals): the value as the agent sealed it, and its version (also the ETag). 404 agent_memory_not_found when there is none. The agents service only, with its platform secret in x-nexus-agents-secret: no person, key, agent link or operator of an organization reaches these rows, and every other route refuses the secret with a 403. Gateway never opens a value, and writes no audit event: the rows belong to no organization.

Parameters

  • collectionpath · stringrequired

    1 to 64 characters: a lowercase letter, then lowercase letters, digits, _ or - (400 agent_memory_collection_invalid)

  • keypath · stringrequired

    1 to 256 characters of A-Z, a-z, 0-9, ., _, ~ and -, and not . or .. (400 agent_memory_key_invalid). Encode any other key, as base64url.

Responses

200OKapplication/json

  • collectionstringrequired
  • keystringrequired
  • valuestringrequired

    The agent's sealed text, as it wrote it

  • versionintegerrequired

    What a later write names in If-Match. It never repeats, also after a delete.

    min 1

  • updatedAtstring (date-time)required

400The platform secret came with another credential, or twice (`credential_conflict`); or a bad collection, key, limit or preconditionapplication/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

      Details of the error, when it has any: the policy rule 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, or a wrong platform secret (`missing_credential`, `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.

403Any other credential: a person's token, an agent link, a service account key, a module key or Nexus UI's secret (`agents_secret_refused`, `role_required`)application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

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

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

503The Gateway holds no platform secret (`not_configured`)application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

Errors

StatusCodeWhen
400The platform secret came with another credential, or twice (`credential_conflict`); or a bad collection, key, limit or precondition
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
404not_foundNothing matches the path in your organization
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429rate_limit_errorToo many requests from this key in a minute
503The Gateway holds no platform secret (`not_configured`)

Example

curl
curl "$NEXUS_URL/v1/agents/state/<collection>/<key>" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Set agent state

put/v1/agents/state/{collection}/{key}

Write one row of the agents service's own state, if it is as the agent read it: If-Match: <version> replaces the row at that version, and If-None-Match: * creates it. With neither, a 428 agent_memory_precondition_required. A write that loses a race, or creates a row that exists, is a 409 agent_memory_version_conflict, and nothing changes. The value is the agent's sealed text, 1 byte to 256 KiB (413 agent_memory_value_too_large). A collection holds at most 100000 rows (413 agent_state_full). Versions never repeat, also after a delete. The agents service only, with its platform secret in x-nexus-agents-secret: no person, key, agent link or operator of an organization reaches these rows, and every other route refuses the secret with a 403. Gateway never opens a value, and writes no audit event: the rows belong to no organization.

Parameters

  • collectionpath · stringrequired

    1 to 64 characters: a lowercase letter, then lowercase letters, digits, _ or - (400 agent_memory_collection_invalid)

  • keypath · stringrequired

    1 to 256 characters of A-Z, a-z, 0-9, ., _, ~ and -, and not . or .. (400 agent_memory_key_invalid). Encode any other key, as base64url.

  • If-Matchheader · string

    The version the write read ("12" or 12, the row's ETag). The write happens only while the row is at it.

  • If-None-Matchheader · "*"

    *: create the row, only when none exists.

  • Idempotency-Keyheader · string

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

Request body · application/json

  • valuestringrequired

    The agent's sealed text, at most 256 KiB

    min length 1

Responses

200Writtenapplication/json

  • collectionstringrequired
  • keystringrequired
  • versionintegerrequired

    What a later write names in If-Match. It never repeats, also after a delete.

    min 1

  • createdbooleanrequired

    True when the write made the row (If-None-Match: *)

  • updatedAtstring (date-time)required

400The platform secret came with another credential, or twice (`credential_conflict`); or a bad collection, key, limit or preconditionapplication/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

      Details of the error, when it has any: the policy rule 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, or a wrong platform secret (`missing_credential`, `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.

403Any other credential: a person's token, an agent link, a service account key, a module key or Nexus UI's secret (`agents_secret_refused`, `role_required`)application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

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

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

503The Gateway holds no platform secret (`not_configured`)application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

Errors

StatusCodeWhen
400invalid_request_errorA field is missing or not valid; the message names it
400The platform secret came with another credential, or twice (`credential_conflict`); or a bad collection, key, limit or precondition
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
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
503The Gateway holds no platform secret (`not_configured`)

Example

curl
curl -X PUT "$NEXUS_URL/v1/agents/state/<collection>/<key>" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "value": "<value>"
  }'

Delete agent state

DEL/v1/agents/state/{collection}/{key}

Delete one row of the agents service's own state at the version If-Match: <version> names (409 agent_memory_version_conflict when the row is at another version, or gone). Without If-Match, a 428 agent_memory_precondition_required: several processes share these rows, so a delete names what it read. The agents service only, with its platform secret in x-nexus-agents-secret: no person, key, agent link or operator of an organization reaches these rows, and every other route refuses the secret with a 403. Gateway never opens a value, and writes no audit event: the rows belong to no organization.

Parameters

  • collectionpath · stringrequired

    1 to 64 characters: a lowercase letter, then lowercase letters, digits, _ or - (400 agent_memory_collection_invalid)

  • keypath · stringrequired

    1 to 256 characters of A-Z, a-z, 0-9, ., _, ~ and -, and not . or .. (400 agent_memory_key_invalid). Encode any other key, as base64url.

  • If-Matchheader · string

    The version the write read ("12" or 12, the row's ETag). The write happens only while the row is at it.

  • Idempotency-Keyheader · string

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

Responses

200OKapplication/json

  • collectionstringrequired
  • keystringrequired
  • versionintegerrequired

    The version the row had

400The platform secret came with another credential, or twice (`credential_conflict`); or a bad collection, key, limit or preconditionapplication/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

      Details of the error, when it has any: the policy rule 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, or a wrong platform secret (`missing_credential`, `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.

403Any other credential: a person's token, an agent link, a service account key, a module key or Nexus UI's secret (`agents_secret_refused`, `role_required`)application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

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

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

503The Gateway holds no platform secret (`not_configured`)application/json

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

Errors

StatusCodeWhen
400The platform secret came with another credential, or twice (`credential_conflict`); or a bad collection, key, limit or precondition
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
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
503The Gateway holds no platform secret (`not_configured`)

Example

curl
curl -X DELETE "$NEXUS_URL/v1/agents/state/<collection>/<key>" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Get agent profile

get/v1/agents/profiles/{id}

One agent profile you see. The person, or their own agent link that holds agents.profiles (on the person's opt-in); no operator grant names it. Another person's personal agent is a 404 agent_profile_not_found. 503 not_configured when Gateway has no database.

agents.profilesEvery memberTry it in the API Explorer

Parameters

  • idpath · stringrequired

    The profile's id (agp_…)

Responses

200OKapplication/json

  • namestring

    The display name: plain text without <, > or @. Not Nexus nor an admin's name (400 agent_profile_name_reserved), except that a personal agent may keep its own name, Nexus

    min length 1 · max length 40

  • avatarstring | null

    An emoji, a :shortcode: or an https image URL with no credentials (400 agent_profile_avatar_invalid)

    max length 512

  • tone"calm" | "warm" | "direct" | "lively" | "custom" | null

    A tone preset; custom leaves the tone to the instructions. null: the agent's own

  • greetingstring | null

    One short line the agent says first in a conversation; control characters stripped (400 agent_profile_greeting_invalid)

    max length 200

  • languagestring | null

    A BCP-47 tag the agent answers in by default, such as es or pt-BR (400 agent_profile_language_invalid)

    max length 35 · pattern ^[A-Za-z]{2,3}(-[A-Za-z0-9]{1,8})*$

  • labelsarray of string

    Short labels that sort, route and filter agents; repeats are dropped

    at most 8 items

  • instructionsstring

    The owner's guidance, added to the agent's system prompt below its own rules

    max length 4000

  • toolsarray of string | null

    Null: every tool the agent's link holds. A list: only these connectors or connector.operation ids; an empty list offers none

    at most 64 items

  • proactivity"always" | "ask_first" | "never"

    W4.3's levels: whether the agent may start something the person did not ask for

  • lengthinteger | null

    How much the agent says: 0 brief to 100 detailed. null: its tone's own (400 agent_profile_personality_invalid)

    min 0 · max 100

  • formalityinteger | null

    How formal the agent is: 0 casual to 100 formal. null: its tone's own (400 agent_profile_personality_invalid)

    min 0 · max 100

  • humourinteger | null

    How much humour the agent uses: 0 none to 100 some. null: its tone's own (400 agent_profile_personality_invalid)

    min 0 · max 100

  • emojiboolean | null

    Emoji in the agent's answers. null: off

  • shortTextsboolean | null

    Shorter answers by text and push than in the app. null: on

  • idstringrequired
  • owner"person" | "team"required

    Person: a personal agent. team: a company agent, on that team's budget and policy

  • ownerIdstringrequired

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

  • teamSlugstring

    A company agent's team slug, while the team exists

  • createdBystringrequired

    The user id of the person who created it

  • createdAtstring (date-time)required
  • updatedAtstring (date-time)required

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

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

Errors

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

Example

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

Set agent profile

put/v1/agents/profiles/{id}

Replace an agent profile's fields; its owner never changes. The name is 1 to 40 characters of plain text, never Nexus nor a name that passes for an admin, except that a personal agent may keep its own name, Nexus (agent_profile_name_invalid, agent_profile_name_reserved). At most 8 labels (agent_profile_label_invalid), instructions of at most 4000 characters (agent_profile_instructions_invalid), and at most 64 tools, each a connector Gateway has or one of its operations (agent_profile_tool_invalid, agent_profile_tool_unknown). The tools narrow what the agent offers and never widen it: Policy still decides each call. Audited as agent.profile_updated, with the labels and never the instructions. Only a person, never an agent link: your own personal agent, and as an owner or admin a company agent (403 agent_profile_admin_required otherwise). No operator grant names it. 503 not_configured when Gateway has no database.

agents.profiles_manageEvery memberTry it in the API Explorer

Parameters

  • idpath · stringrequired

    The profile's id (agp_…)

  • Idempotency-Keyheader · string

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

Request body · application/json

  • namestring

    The display name: plain text without <, > or @. Not Nexus nor an admin's name (400 agent_profile_name_reserved), except that a personal agent may keep its own name, Nexus

    min length 1 · max length 40

  • avatarstring | null

    An emoji, a :shortcode: or an https image URL with no credentials (400 agent_profile_avatar_invalid)

    max length 512

  • tone"calm" | "warm" | "direct" | "lively" | "custom" | null

    A tone preset; custom leaves the tone to the instructions. null: the agent's own

  • greetingstring | null

    One short line the agent says first in a conversation; control characters stripped (400 agent_profile_greeting_invalid)

    max length 200

  • languagestring | null

    A BCP-47 tag the agent answers in by default, such as es or pt-BR (400 agent_profile_language_invalid)

    max length 35 · pattern ^[A-Za-z]{2,3}(-[A-Za-z0-9]{1,8})*$

  • labelsarray of string

    Short labels that sort, route and filter agents; repeats are dropped

    at most 8 items

  • instructionsstring

    The owner's guidance, added to the agent's system prompt below its own rules

    max length 4000

  • toolsarray of string | null

    Null: every tool the agent's link holds. A list: only these connectors or connector.operation ids; an empty list offers none

    at most 64 items

  • proactivity"always" | "ask_first" | "never"

    W4.3's levels: whether the agent may start something the person did not ask for

  • lengthinteger | null

    How much the agent says: 0 brief to 100 detailed. null: its tone's own (400 agent_profile_personality_invalid)

    min 0 · max 100

  • formalityinteger | null

    How formal the agent is: 0 casual to 100 formal. null: its tone's own (400 agent_profile_personality_invalid)

    min 0 · max 100

  • humourinteger | null

    How much humour the agent uses: 0 none to 100 some. null: its tone's own (400 agent_profile_personality_invalid)

    min 0 · max 100

  • emojiboolean | null

    Emoji in the agent's answers. null: off

  • shortTextsboolean | null

    Shorter answers by text and push than in the app. null: on

Responses

200OKapplication/json

  • namestring

    The display name: plain text without <, > or @. Not Nexus nor an admin's name (400 agent_profile_name_reserved), except that a personal agent may keep its own name, Nexus

    min length 1 · max length 40

  • avatarstring | null

    An emoji, a :shortcode: or an https image URL with no credentials (400 agent_profile_avatar_invalid)

    max length 512

  • tone"calm" | "warm" | "direct" | "lively" | "custom" | null

    A tone preset; custom leaves the tone to the instructions. null: the agent's own

  • greetingstring | null

    One short line the agent says first in a conversation; control characters stripped (400 agent_profile_greeting_invalid)

    max length 200

  • languagestring | null

    A BCP-47 tag the agent answers in by default, such as es or pt-BR (400 agent_profile_language_invalid)

    max length 35 · pattern ^[A-Za-z]{2,3}(-[A-Za-z0-9]{1,8})*$

  • labelsarray of string

    Short labels that sort, route and filter agents; repeats are dropped

    at most 8 items

  • instructionsstring

    The owner's guidance, added to the agent's system prompt below its own rules

    max length 4000

  • toolsarray of string | null

    Null: every tool the agent's link holds. A list: only these connectors or connector.operation ids; an empty list offers none

    at most 64 items

  • proactivity"always" | "ask_first" | "never"

    W4.3's levels: whether the agent may start something the person did not ask for

  • lengthinteger | null

    How much the agent says: 0 brief to 100 detailed. null: its tone's own (400 agent_profile_personality_invalid)

    min 0 · max 100

  • formalityinteger | null

    How formal the agent is: 0 casual to 100 formal. null: its tone's own (400 agent_profile_personality_invalid)

    min 0 · max 100

  • humourinteger | null

    How much humour the agent uses: 0 none to 100 some. null: its tone's own (400 agent_profile_personality_invalid)

    min 0 · max 100

  • emojiboolean | null

    Emoji in the agent's answers. null: off

  • shortTextsboolean | null

    Shorter answers by text and push than in the app. null: on

  • idstringrequired
  • owner"person" | "team"required

    Person: a personal agent. team: a company agent, on that team's budget and policy

  • ownerIdstringrequired

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

  • teamSlugstring

    A company agent's team slug, while the team exists

  • createdBystringrequired

    The user id of the person who created it

  • createdAtstring (date-time)required
  • updatedAtstring (date-time)required

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

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

Errors

StatusCodeWhen
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
409idempotency_in_progressA request with the same Idempotency-Key is still running
409idempotency_interruptedThe first request with this Idempotency-Key was cut off and may have run in part
422idempotency_key_reusedThe Idempotency-Key was used with a different request
429Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap).
429rate_limit_errorToo many requests from this key in a minute

Example

curl
curl -X PUT "$NEXUS_URL/v1/agents/profiles/<id>" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Platform",
    "avatar": "<avatar>",
    "tone": "calm",
    "greeting": "<greeting>",
    "language": "<language>",
    "labels": [
      "CI"
    ],
    "instructions": "<instructions>",
    "tools": [
      "<tool>"
    ],
    "proactivity": "always",
    "length": 0,
    "formality": 0,
    "humour": 0,
    "emoji": false,
    "shortTexts": false
  }'

Delete agent profile

DEL/v1/agents/profiles/{id}

Delete an agent profile. Audited as agent.profile_deleted. Only a person, never an agent link: your own personal agent, and as an owner or admin a company agent (403 agent_profile_admin_required otherwise). No operator grant names it. 503 not_configured when Gateway has no database.

agents.profiles_manageEvery memberTry it in the API Explorer

Parameters

  • idpath · stringrequired

    The profile's id (agp_…)

  • Idempotency-Keyheader · string

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

Responses

204Deleted

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
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/agents/profiles/<id>" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

List agent profiles

get/v1/agents/profiles

Your agents' profiles, by name: your own personal agent and every company agent in the organization. The person, or their own agent link that holds agents.profiles (on the person's opt-in); no operator grant names it. Another person's personal agent is a 404 agent_profile_not_found. 503 not_configured when Gateway has no database.

agents.profilesEvery memberTry it in the API Explorer

Responses

200OKapplication/json

  • dataarray of AgentProfilerequired
    • namestring

      The display name: plain text without <, > or @. Not Nexus nor an admin's name (400 agent_profile_name_reserved), except that a personal agent may keep its own name, Nexus

      min length 1 · max length 40

    • avatarstring | null

      An emoji, a :shortcode: or an https image URL with no credentials (400 agent_profile_avatar_invalid)

      max length 512

    • tone"calm" | "warm" | "direct" | "lively" | "custom" | null

      A tone preset; custom leaves the tone to the instructions. null: the agent's own

    • greetingstring | null

      One short line the agent says first in a conversation; control characters stripped (400 agent_profile_greeting_invalid)

      max length 200

    • languagestring | null

      A BCP-47 tag the agent answers in by default, such as es or pt-BR (400 agent_profile_language_invalid)

      max length 35 · pattern ^[A-Za-z]{2,3}(-[A-Za-z0-9]{1,8})*$

    • labelsarray of string

      Short labels that sort, route and filter agents; repeats are dropped

      at most 8 items

    • instructionsstring

      The owner's guidance, added to the agent's system prompt below its own rules

      max length 4000

    • toolsarray of string | null

      Null: every tool the agent's link holds. A list: only these connectors or connector.operation ids; an empty list offers none

      at most 64 items

    • proactivity"always" | "ask_first" | "never"

      W4.3's levels: whether the agent may start something the person did not ask for

    • lengthinteger | null

      How much the agent says: 0 brief to 100 detailed. null: its tone's own (400 agent_profile_personality_invalid)

      min 0 · max 100

    • formalityinteger | null

      How formal the agent is: 0 casual to 100 formal. null: its tone's own (400 agent_profile_personality_invalid)

      min 0 · max 100

    • humourinteger | null

      How much humour the agent uses: 0 none to 100 some. null: its tone's own (400 agent_profile_personality_invalid)

      min 0 · max 100

    • emojiboolean | null

      Emoji in the agent's answers. null: off

    • shortTextsboolean | null

      Shorter answers by text and push than in the app. null: on

    • idstringrequired
    • owner"person" | "team"required

      Person: a personal agent. team: a company agent, on that team's budget and policy

    • ownerIdstringrequired

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

    • teamSlugstring

      A company agent's team slug, while the team exists

    • createdBystringrequired

      The user id of the person who created it

    • createdAtstring (date-time)required
    • updatedAtstring (date-time)required

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

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

Errors

StatusCodeWhen
401authentication_errorNo key, or a key Gateway does not accept
403role_requiredYour role does not have this permission
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/agents/profiles" \
  -H "Authorization: Bearer $NEXUS_API_KEY"

Create agent profile

post/v1/agents/profiles

Create an agent profile: without team, your personal agent; with team (a slug or id), a company agent that answers on that team's budget and policy (404 unknown_team). One profile per owner (409 agent_profile_exists). The name is 1 to 40 characters of plain text, never Nexus nor a name that passes for an admin, except that a personal agent may keep its own name, Nexus (agent_profile_name_invalid, agent_profile_name_reserved). At most 8 labels (agent_profile_label_invalid), instructions of at most 4000 characters (agent_profile_instructions_invalid), and at most 64 tools, each a connector Gateway has or one of its operations (agent_profile_tool_invalid, agent_profile_tool_unknown). The tools narrow what the agent offers and never widen it: Policy still decides each call. Audited as agent.profile_created, with the labels and never the instructions. Only a person, never an agent link: your own personal agent, and as an owner or admin a company agent (403 agent_profile_admin_required otherwise). No operator grant names it. 503 not_configured when Gateway has no database.

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

  • namestring

    The display name: plain text without <, > or @. Not Nexus nor an admin's name (400 agent_profile_name_reserved), except that a personal agent may keep its own name, Nexus

    min length 1 · max length 40

  • avatarstring | null

    An emoji, a :shortcode: or an https image URL with no credentials (400 agent_profile_avatar_invalid)

    max length 512

  • tone"calm" | "warm" | "direct" | "lively" | "custom" | null

    A tone preset; custom leaves the tone to the instructions. null: the agent's own

  • greetingstring | null

    One short line the agent says first in a conversation; control characters stripped (400 agent_profile_greeting_invalid)

    max length 200

  • languagestring | null

    A BCP-47 tag the agent answers in by default, such as es or pt-BR (400 agent_profile_language_invalid)

    max length 35 · pattern ^[A-Za-z]{2,3}(-[A-Za-z0-9]{1,8})*$

  • labelsarray of string

    Short labels that sort, route and filter agents; repeats are dropped

    at most 8 items

  • instructionsstring

    The owner's guidance, added to the agent's system prompt below its own rules

    max length 4000

  • toolsarray of string | null

    Null: every tool the agent's link holds. A list: only these connectors or connector.operation ids; an empty list offers none

    at most 64 items

  • proactivity"always" | "ask_first" | "never"

    W4.3's levels: whether the agent may start something the person did not ask for

  • lengthinteger | null

    How much the agent says: 0 brief to 100 detailed. null: its tone's own (400 agent_profile_personality_invalid)

    min 0 · max 100

  • formalityinteger | null

    How formal the agent is: 0 casual to 100 formal. null: its tone's own (400 agent_profile_personality_invalid)

    min 0 · max 100

  • humourinteger | null

    How much humour the agent uses: 0 none to 100 some. null: its tone's own (400 agent_profile_personality_invalid)

    min 0 · max 100

  • emojiboolean | null

    Emoji in the agent's answers. null: off

  • shortTextsboolean | null

    Shorter answers by text and push than in the app. null: on

  • teamstring

    A team's slug or id: a company agent for that team. Absent: your personal agent

Responses

201Createdapplication/json

  • namestring

    The display name: plain text without <, > or @. Not Nexus nor an admin's name (400 agent_profile_name_reserved), except that a personal agent may keep its own name, Nexus

    min length 1 · max length 40

  • avatarstring | null

    An emoji, a :shortcode: or an https image URL with no credentials (400 agent_profile_avatar_invalid)

    max length 512

  • tone"calm" | "warm" | "direct" | "lively" | "custom" | null

    A tone preset; custom leaves the tone to the instructions. null: the agent's own

  • greetingstring | null

    One short line the agent says first in a conversation; control characters stripped (400 agent_profile_greeting_invalid)

    max length 200

  • languagestring | null

    A BCP-47 tag the agent answers in by default, such as es or pt-BR (400 agent_profile_language_invalid)

    max length 35 · pattern ^[A-Za-z]{2,3}(-[A-Za-z0-9]{1,8})*$

  • labelsarray of string

    Short labels that sort, route and filter agents; repeats are dropped

    at most 8 items

  • instructionsstring

    The owner's guidance, added to the agent's system prompt below its own rules

    max length 4000

  • toolsarray of string | null

    Null: every tool the agent's link holds. A list: only these connectors or connector.operation ids; an empty list offers none

    at most 64 items

  • proactivity"always" | "ask_first" | "never"

    W4.3's levels: whether the agent may start something the person did not ask for

  • lengthinteger | null

    How much the agent says: 0 brief to 100 detailed. null: its tone's own (400 agent_profile_personality_invalid)

    min 0 · max 100

  • formalityinteger | null

    How formal the agent is: 0 casual to 100 formal. null: its tone's own (400 agent_profile_personality_invalid)

    min 0 · max 100

  • humourinteger | null

    How much humour the agent uses: 0 none to 100 some. null: its tone's own (400 agent_profile_personality_invalid)

    min 0 · max 100

  • emojiboolean | null

    Emoji in the agent's answers. null: off

  • shortTextsboolean | null

    Shorter answers by text and push than in the app. null: on

  • idstringrequired
  • owner"person" | "team"required

    Person: a personal agent. team: a company agent, on that team's budget and policy

  • ownerIdstringrequired

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

  • teamSlugstring

    A company agent's team slug, while the team exists

  • createdBystringrequired

    The user id of the person who created it

  • createdAtstring (date-time)required
  • updatedAtstring (date-time)required

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

  • errorobject
    • messagestringrequired
    • typestringrequired

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

    • codestring

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

    • paramstring

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

    • nexusobject

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

    • minimumstring

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

Errors

StatusCodeWhen
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
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/agents/profiles" \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Platform",
    "avatar": "<avatar>",
    "tone": "calm",
    "greeting": "<greeting>",
    "language": "<language>",
    "labels": [
      "CI"
    ],
    "instructions": "<instructions>",
    "tools": [
      "<tool>"
    ],
    "proactivity": "always",
    "length": 0,
    "formality": 0,
    "humour": 0,
    "emoji": false,
    "shortTexts": false,
    "team": "platform"
  }'