Get started
Connect a coding agent
Connect Codex, Claude Code, OpenCode, Pi or Gemini CLI with your own account.
A connection is your own account with a coding agent's provider. Statefold holds it on the Worker side: the workspace only ever receives a placeholder, which is swapped for the real credential on approved provider requests. Revoking or reconnecting changes future requests; no credential file is ever copied into a workspace.
Add connections in Settings → Agent connections. Connections belong to your account. Never paste tokens or API keys into a thread, a repository or a bug report.
| Agent | Ways to connect | Where |
|---|---|---|
| Codex | ChatGPT Plus/Pro subscription | Browser or CLI |
| Claude Code | Claude subscription | CLI only |
| Claude Code | Anthropic API key | Browser |
| OpenCode | OpenCode Zen or OpenCode Go | Browser |
| Pi | OpenAI, Anthropic or Gemini API key | Browser |
| Gemini CLI | Google AI Studio API key | Browser |
Codex
Choose ChatGPT Plus/Pro and select Connect with ChatGPT, then enter the code on the ChatGPT device page. This uses your Codex subscription, not an OpenAI API key. If ChatGPT asks, enable device-code login in ChatGPT Settings → Security.
From a terminal, the same sign-in runs as:
statefold connect codexClaude Code
Anthropic API key. Paste the key in Settings. Usage is billed by Anthropic's API, separately from Claude plans.
Claude subscription. Subscription authorization starts on your computer with the Claude Code CLI installed. This command runs claude setup-token and registers the connection; run it again to renew:
statefold connect claude-codeThe connection uses your Claude subscription, subject to your plan's access and limits. Technical support does not establish permission for third-party commercial subscription use; Anthropic's terms still apply.
OpenCode
Choose OpenCode Zen for pay-as-you-go models billed to your Zen balance, or free models without a key. Choose OpenCode Go for Go subscription models; Go requires an API key for the workspace with your Go subscription, as console sign-in alone does not connect Go. OpenCode's optional Use balance setting can charge your Zen balance after Go limits.
Pi
Choose the OpenAI, Anthropic or Google provider and enter that provider's API key. The models offered follow the provider and key.
Gemini CLI
Enter a Google AI Studio Gemini API key. This connection uses that key, not a Google sign-in or a Gemini consumer subscription.
Connecting from the CLI
statefold connect opencode, pi and gemini (and claude-code --auth-mode api-key) open the browser form for you and wait until you save it. The CLI and the browser must be signed in to the same Statefold target; check with statefold config.
Connection health
Each connection shows its state: Connected, Needs reconnect, Rate limited, Near limit and others. When a provider limit stops a thread, the thread shows the reset time and can resume then. Reconnect an expired connection in Settings.