agent37-claude-code template runs Claude Code, Anthropic’s coding agent, on an Agent37 instance: an always-on computer with the same chat API, sessions, files, and URLs as every other template. The image is lean, with no browser and no desktop. Claude Code runs on your own Anthropic account: Agent37 never supplies or bills Claude model usage, and there is no managed-model option on this template, so connect your account before the first chat turn.
Create the instance
One call to the hosting API athttps://api.agent37.com:
curl
201 response carries the instance id and its URL, https://{instanceId}.agent37.app, which routes to the gateway on port 3737. The terminal is on port 7681 and the file browser on 8080, each at https://{instanceId}-{port}.agent37.app; see Instance and preview URLs.
Connect your Claude account
Three ways to connect. Until one of them is done, a chat turn fails withauth_error, and GET /v1/health?agent=claude-code on the instance URL reports "healthy": false.
Log in from the instance terminal. Mint a signed URL for the terminal port:
curl
url in a browser and run claude auth login in the shell. The login persists on the instance volume, so it survives restarts and updates.
Set CLAUDE_CODE_OAUTH_TOKEN. The way to go when your app provisions instances headlessly. Generate the token on your own machine with claude setup-token, then pass it as instance env on the create call:
curl
ANTHROPIC_API_KEY. Same shape: pass an Anthropic API key as env on create instead.
Send the first message
Chat is the instance URL plus a path, with the samesk_live_ key sent as the X-Agent37-Key header. claude-code is the template’s default agent, so there is no agent field to pass:
curl
"stream": true to receive the turn as Server-Sent Events instead of one JSON body, and reuse the returned session_id to continue the thread. See Send a message and Streaming.
Models
GET /v1/models on the instance lists five aliases: default, fable, opus, sonnet, and haiku, all with provider anthropic. Pass one as model on a turn. Usage bills to your Anthropic account, not your Agent37 wallet. See Models.
Bring your own model
Claude Code can run on a different model provider entirely: point it at any Anthropic-compatible Messages endpoint with two moreenv entries on the create call. With OpenRouter:
curl
ANTHROPIC_AUTH_TOKEN, and health reports healthy once the instance is up. To pin what each model alias runs, add role variables as provider slugs: ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL, and ANTHROPIC_DEFAULT_FABLE_MODEL (for example "ANTHROPIC_DEFAULT_OPUS_MODEL": "anthropic/claude-opus-5", so a turn with "model": "opus" runs that slug). Claude Code is built for Anthropic models; pointing a role at another family can mishandle the tool calls it edits files with.
Runnable version: claude-code-byo-model in the examples repo.
Connect apps
App integrations work here like on every system template: drive the/v1/integrations endpoints to connect your users’ Gmail, Slack, Notion, and hundreds of other apps, and the platform registers its Composio MCP server with Claude Code automatically.
Custom image
To add your own tools, build on the clean base image, which ships Claude Code and the gateway with no managed integrations, the same pattern ashermes-base: