Skip to main content
An agent you build and run yourself, such as a bot on your own server, uses Spiral like any program: through the spiral CLI, the MCP server or the REST API, with an API key.
1

Create a key

Create a key under API keys in the console and store it as a secret on the agent’s machine, as SPIRAL_API_KEY.
2

Install the CLI and the agent skill

init installs spiral, logs in and adds the agent skill, the short guide that teaches an agent Spiral’s commands. On a machine with a browser, init --browser signs in without pasting a key; on a server, pipe the key in: printf %s "$SPIRAL_API_KEY" | spiral init --json. It needs Node.js 22.12 or later. spiral update installs the newest release later.
3

Let it work

The agent runs commands such as these, with --json for one line of JSON per command:
spiral skills get core prints the full guide for the installed version.
4

Hear when runs finish

Give runs a webhook, so the agent hears when a run finishes instead of polling.

Other ways in

  • MCP: an agent framework that speaks MCP can connect to https://api.spiral.ai/mcp with the key as a bearer token. See MCP server.
  • REST: call the API directly with the key.
  • One line: an agent that can fetch a URL and keep a secret can set itself up from set up https://spiral.ai/SKILL.md.
If something does not work, see Troubleshooting.