Skip to main content

Add an agent

Give an unattended agent its own key, run one command on its host, verify in the Agents card.

A service key (ark_svc_…) has its own identity, team, and optional budget, and is never a billed seat.

1
Add the agent

Console Users page > Agents card > Add agent. Name and team each take 1 to 64 characters from A-Z a-z 0-9 . : - _.

2
Copy the key

Store ark_svc_… in the host's secret store.

3
Run one command on the agent's host

The dialog prints it prefilled:

export ANYRAY_CLIENT_KEY=ark_svc_… # from the host's secret store
curl -fsSL https://app.anyray.ai/connect.sh | sh -s -- --gateway https://<your-anyray-gateway> --yes

Every tool on the host gets the gateway, the retrieval (MCP) server, and the Anyray skill. Claude Code also gets the source hook.

Every model route needs the MCP server

A route without the anyray MCP server (e.g. Codex beside Claude Code) still works, but cannot read back trimmed content.

4
Verify the connection

Within a minute of the first request the Agents card reads Active. Otherwise:

Card showsFix
Codex ✓ · Claude Code: MCP missingThe named runtime cannot call anyray_retrieve. Open the row, finish step 2 of its Setup tab for that runtime.
MCP disconnectedNo runtime can call anyray_retrieve. Same fix, for all of them.
Source hook missingUpgrade Connect. Source hook not reported means no recent host report.
Needs gateway upgradeUpgrade the gateway. The host is fine.

An MCP state lasting over a day also shows in sidebar Errors and emails the billing contact or owners once. All states: status vocabulary. On the host, anyray-connect doctor --json reports builtinSkill.kind as "ok", or a remedy.

The agent is connected

Its spend lands under its own name.

Let a coding agent set the host up

Every Add agent tab leads with a prompt for a coding agent. The Host and OpenClaw tabs give it this runbook:

https://app.anyray.ai/agent-host.md

Put the key in the host environment yourself; never paste an ark_svc_ key into the chat.

HostRunbook does
Can run the installerStep 3
Cannot (hardened container, own model loop)Per route: base URL and key from env, anyray MCP at <gateway>/mcp, org skills from GET /connect/policy
Both, afterPolls GET /connect/self-check until every runtime is wired; records runbookVersion and skillVersion, re-reads when newer

Code built on an SDK or a framework gets the runbook for its tab:

TabRunbook
OpenAIhttps://app.anyray.ai/agents/openai.md
Anthropichttps://app.anyray.ai/agents/anthropic.md
LangChainhttps://app.anyray.ai/agents/langchain.md
LangGraphhttps://app.anyray.ai/agents/langgraph.md
You no longer have the key

Row > Setup > Show key (security_admin and up; audit-logged). Older agents, or a deployment with no admin token, offer Generate a new key: same name, team, budget, and routing; the old key stops working within a second.

Wire an SDK or a script instead of a host

Use the dialog's step 2, or set two env vars. They are enough for most code:

OpenAI dialect
export OPENAI_BASE_URL=https://<your-anyray-gateway>/v1
export OPENAI_API_KEY=ark_svc_…
CodeNeeds
Only sends requestsNothing more.
Runs its own tool loopRetrieval-dependent trims stay off without a read path. Other transforms can still run (SDKs).
LangChain or LangGraphThe base URL, the key, and one header: LangChain and LangGraph.
Claude Agent SDK appThe Anthropic runbook: settingSources: [], and the anyray skill in the app's own plugin.
Sandboxed OpenClaw containerA config file: OpenClaw.