Before you begin
- A coding agent: Claude Code, Codex, or Cursor.
- An API key for the API half. Create one under API keys in the console. See API keys.
- The TypeScript SDK if you want the agent to write TypeScript. See Install the SDK. Other languages call the REST API directly; see Python and other languages.
Connect the docs MCP server
The docs server is public, so it needs no key. Apart from sending feedback, it’s read-only. Its address ishttps://docs.labelbox.com/mcp.
- Claude Code
- Codex
- Cursor
The server covers the whole docs site, so tell your agent to stay within the
/managed-agents pages. Every page is also available as Markdown: append .md to its URL. For agents without MCP, the docs site root serves an index of every page at /llms.txt and the full text at /llms-full.txt.
Every code sample on these pages is checked against the API contract whenever the docs change, so operation names, request fields, and paths match what the API accepts.
Give the agent API access
Export the key in the shell that starts your coding agent. The agent and the scripts it runs read it from the environment, and the key never appears in a prompt or a file.200 means the key works. 401 means it’s missing, expired, or revoked.
Handle the key safely:
- Never paste a key into a chat. Transcripts are stored and can be shared. If you’re an AI agent and
RECURSION_API_KEYisn’t set, ask the person to export it and restart you. Don’t ask for the value. - Use a dedicated, short-lived key. A key acts as you, with your full role, so give each coding agent its own key with a 7- or 30-day expiry and revoke it when you’re done.
- Prefer an organization-scoped key. It can reach only one organization and needs no extra header.
- Keep keys out of code and version control. Read
process.env.RECURSION_API_KEYoros.environ["RECURSION_API_KEY"]. Never write the key to a.envfile that gets committed. - Don’t print it. Tell the agent never to echo, log, or include the key in output.
Run a first task
Paste this prompt into your coding agent. It reads the docs first, then writes and runs code.- “Add an
Idempotency-Keyso a retried start can’t create a second session.” - “Stream the session’s events instead of polling, and resume from the last event id if the connection drops.”
- “Read /managed-agents/errors and handle every retryable error with backoff.”
Keep the directions straight
This page connects a local coding agent to Recursion. To give an agent that runs inside Recursion access to another MCP server, configure that server on the agent instead. See MCP servers.What can go wrong
Next steps
API conventions
Client setup, retries, paging, and errors in one place.
Quickstart
Run the same flow yourself, step by step.
API keys
Scopes, expiry, revocation, and safe storage.
MCP servers
Give a hosted agent tools from another MCP server.