---
name: agent37
description: Use when creating and managing persistent sandboxes for code,
  services, and agents; running commands on instances; hosting agent templates
  like Hermes or custom Docker images; managing instance lifecycle, billing, and
  integrations; or building applications that need persistent compute
  infrastructure.
metadata:
  mintlify-proj: agent37
  version: "1.0"
---

# Agent37 Skill

## Product summary

Agent37 is a platform for persistent sandboxes and full Linux VMs. Create instances from templates (Hermes, OpenClaw, Claude Code, or your own Docker image), run commands via the Sandbox API, and reach services over authenticated HTTPS. Every instance is metered per minute and bills from a workspace wallet. The Sandbox API at `https://api.agent37.com/v1` manages instances; instance URLs at `https://{instanceId}.agent37.app` serve the agent or your service; `https://sandbox.agent37.app` runs commands. Authenticate with `Authorization: Bearer sk_live_...` on the Sandbox API and `X-Agent37-Key: sk_live_...` on instance URLs. See [Agent37 docs](https://www.agent37.com/docs).

## When to use

Reach for this skill when:
- Creating or managing persistent sandboxes for code, services, or agent harnesses
- Running shell commands on instances via exec
- Hosting agent templates (Hermes, OpenClaw, Claude Code, Codex, Grok, OpenCode, Pi) or custom Docker images
- Managing instance lifecycle: start, stop, restart, update, resize, delete
- Setting up billing, budgets, and monitoring spend
- Connecting integrations (Composio for 250+ apps, messaging channels, custom domains)
- Building multi-tenant applications with per-user instances
- Automating workflows with cron jobs or webhooks
- Debugging instance health, logs, and metrics

## Quick reference

### Core API endpoints

| Task | Endpoint | Method |
|------|----------|--------|
| Create instance | `/v1/instances` | POST |
| List instances | `/v1/instances` | GET |
| Get instance | `/v1/instances/{id}` | GET |
| Delete instance | `/v1/instances/{id}` | DELETE |
| Run command | `/v1/instances/{id}/exec` | POST |
| Start instance | `/v1/instances/{id}/start` | POST |
| Stop instance | `/v1/instances/{id}/stop` | POST |
| Restart instance | `/v1/instances/{id}/restart` | POST |
| Send message (agent) | `https://{instanceId}.agent37.app/v1/responses` | POST |
| Check health | `https://{instanceId}.agent37.app/v1/health` | GET |

### Instance templates

| Template | Use for | Needs account |
|----------|---------|---------------|
| `agent37-base` | Plain Linux sandbox (default) | No |
| `agent37-hermes` | General agent: chat, browsing, code | Managed model |
| `agent37-openclaw` | General agent: chat, browsing, code | Managed model |
| `agent37-claude-code` | Claude's coding agent | Your Anthropic account |
| `agent37-codex` | OpenAI's coding agent | Your OpenAI account |
| `agent37-grok` | xAI's coding agent | Your xAI API key |
| `agent37-opencode` | Open-source coding agent | Managed model |
| `agent37-pi` | Minimal harness | Managed model |
| `agent37-ubuntu` | Docker, Compose, desktop (VM only) | No |
| `agent37-android` | Android 14 emulator (VM only) | No |

### Instance types and pricing

| Type | Use for | Compute rate | Requires |
|------|---------|--------------|----------|
| `default` | Light use, chatting, idle agents | 1x | Funded wallet |
| `vm` | Steady CPU, Docker, databases | 2.5x | Funded wallet |
| `performance` | Builds, sustained heavy CPU | 4x | Funded wallet |

Default shape: 2 vCPU / 4 GB RAM / 4 GB disk at $4.76/month. Disk bills at $0.09/GB/month; stopped/sleeping instances bill disk only.

### Instance status values

| Status | Meaning | Billing |
|--------|---------|---------|
| `running` | Up and ready | Full rate |
| `stopped` | Halted, data intact | Disk only |
| `sleeping` | Auto-sleep checkpoint | Disk only |
| `provisioning` | Being created | Full rate |
| `starting`, `stopping`, `restarting`, `updating` | In transition | Full rate |
| `failed` | Create or lifecycle action failed | Full rate |
| `deleted` | Permanently removed | None |

### Common exec patterns

```bash
# Run a command and wait for output
curl -X POST https://sandbox.agent37.app/v1/instances/{id}/exec \
  -H "X-Agent37-Key: sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"command": "node --version"}'

# Run in background (returns immediately with PID)
curl -X POST https://sandbox.agent37.app/v1/instances/{id}/exec \
  -H "X-Agent37-Key: sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"command": "npm run dev > dev.log 2>&1", "background": true}'

# Run as root
curl -X POST https://sandbox.agent37.app/v1/instances/{id}/exec \
  -H "X-Agent37-Key: sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"command": "apt-get update", "user": "root"}'
```

### Authentication headers

| Plane | Base URL | Header |
|-------|----------|--------|
| Sandbox API | `https://api.agent37.com/v1` | `Authorization: Bearer sk_live_...` |
| Instance URLs | `https://{instanceId}.agent37.app` | `X-Agent37-Key: sk_live_...` |
| Exec endpoint | `https://sandbox.agent37.app` | `X-Agent37-Key: sk_live_...` |

## Decision guidance

### When to use default vs VM vs performance instance

| Scenario | Choose |
|----------|--------|
| Chat agent, small scripts, mostly idle | `default` (cheapest) |
| Browser automation, desktop control, steady CPU | `vm` (2.5x cost) |
| Builds, compiles, sustained heavy CPU | `performance` (4x cost) |
| Docker, Compose, Kubernetes, databases | `vm` with `agent37-ubuntu` |
| Android automation | `vm` with `agent37-android` |

### When to use auto-sleep vs stop

| Scenario | Choose |
|----------|--------|
| Agent that idles most of the day, needs instant wake | `auto_sleep: true` (bills disk only while idle) |
| Service you control manually, want to pause | `stop` (bills disk only, explicit start needed) |
| Always-on service or high-traffic agent | Omit auto-sleep, keep running |

### When to use managed model vs bring-your-own

| Scenario | Choose |
|----------|--------|
| Quick start, no account needed | Hermes, OpenCode, Pi on managed model |
| Use your own Anthropic account | `agent37-claude-code` |
| Use your own OpenAI account | `agent37-codex` |
| Use your own xAI key | `agent37-grok` |
| Custom model provider | Bring your own image with model key in env |

## Workflow

### Create and run a basic instance

1. **Get an API key**: Visit dashboard or call `POST /v1/signup` if you have no workspace.
2. **Fund the wallet**: Add at least $5 at dashboard/cloud/billing or call `POST /v1/billing/top-up`.
3. **Create the instance**: `POST /v1/instances` with template name (or omit for default `agent37-base`).
4. **Wait for running**: Poll `GET /v1/instances/{id}` until `status: "running"`.
5. **Run a command**: `POST /v1/instances/{id}/exec` with your shell command.
6. **Read output**: Check `exit_code`, `stdout`, `stderr` in the response.
7. **Clean up**: `DELETE /v1/instances/{id}` to end billing.

### Send a message to an agent template

1. **Create a Hermes instance**: `POST /v1/instances` with `template: "agent37-hermes"` and a `budget` (e.g., `credit_micros: 1000000` for $1).
2. **Wait for health**: Poll `GET https://{instanceId}.agent37.app/v1/health` until `healthy: true`.
3. **Send a message**: `POST https://{instanceId}.agent37.app/v1/responses` with `input: "your prompt"`.
4. **Reuse session**: Include `session_id` from the response to continue the conversation.
5. **Stream live**: Add `stream: true` to get token-by-token output.

### Manage instance lifecycle

1. **Stop**: `POST /v1/instances/{id}/stop` to halt compute, keep disk and data.
2. **Start**: `POST /v1/instances/{id}/start` to resume from stopped state.
3. **Restart**: `POST /v1/instances/{id}/restart` to reboot while running.
4. **Update**: `POST /v1/instances/{id}/update` with new `template` to change the image.
5. **Resize**: `POST /v1/instances/{id}/resize` with new `resources` to change CPU/RAM/disk.
6. **Delete**: `DELETE /v1/instances/{id}` to permanently remove and end billing.

### Set up auto-sleep

1. **Create with auto-sleep**: `POST /v1/instances` with `auto_sleep: true` and `idle_timeout_seconds: 900` (15 min default).
2. **Instance sleeps**: After 15 minutes of no requests, instance checkpoints to `sleeping` status.
3. **Wake on request**: Any request to instance URL, exec, or start wakes it transparently.
4. **Billing**: Sleeping instances bill disk only (~$0.36/month at 4 GB default).

### Connect integrations (Composio)

1. **Every instance has managed Composio**: No setup needed; credentials are built-in.
2. **In conversation**: Ask agent to "connect Gmail" or "connect Slack"; it returns an auth link.
3. **Via API**: `GET /v1/instances/{id}/integrations/catalog` to browse apps, `POST /v1/instances/{id}/integrations/connections` to start OAuth.
4. **Billing**: Discovery is free; tool calls bill per execution at cost.

## Common gotchas

- **Wallet must be funded before create**: Create checks for one day of compute cost; below that, it returns `402 insufficient_balance`. Top up first.
- **Agent templates need a budget**: Default budget is $0, so managed LLM calls are refused. Set `budget.credit_micros` or `budget.monthly_cap_micros` on create.
- **Exec timeout is 120 seconds by default**: Long-running commands need `background: true` or a timeout parameter. Background commands return immediately with a PID.
- **Files persist, processes don't**: Restart or wake from sleep loses in-memory state and running processes. Use boot hooks (`~/.agent37/hooks/post-restart.sh`) to reinstall after every boot.
- **Instance URL requires auth on every request**: No unauthenticated access; use signed URLs for browser links or public ports for webhooks.
- **Stopped instances still bill disk**: To truly pause billing, delete the instance. Stopped instances bill disk alone (~$0.36/month at 4 GB).
- **Update resets the OS layer**: `update` keeps your home folder but resets system packages. Use boot hooks to reinstall after update.
- **Sleeping instances in cold storage can't be stopped**: If an instance is parked in cold storage (after long sleep), `stop` returns `400 invalid_request`. Wake it with `start` or delete it.
- **Memory limit gates concurrent instances**: Workspace memory limit (40 GB at once after first top-up) counts only awake instances. Sleeping and stopped instances don't count.
- **Exec on `api.agent37.com` is slower**: Use `https://sandbox.agent37.app` for exec; it's on the instance's host and answers in ~200ms instead of ~2s.
- **Error codes are stable, messages are not**: Branch on `error.code`, not `error.message`. Transport errors on instance URLs return flat strings (`{"error": "not_found"}`), not objects.

## Verification checklist

Before submitting work with Agent37:

- [ ] API key is set in environment or passed securely (never hardcoded in code).
- [ ] Workspace wallet has a balance (check `GET /v1/billing`).
- [ ] Instance has a budget set if using managed LLM (check `budget` on create or `PATCH /v1/instances/{id}/budget`).
- [ ] Instance status is `running` before sending messages or running commands (poll `GET /v1/instances/{id}`).
- [ ] Agent health is `healthy: true` before sending first message (poll `GET https://{instanceId}.agent37.app/v1/health`).
- [ ] Exec commands have correct `exit_code` (0 for success, nonzero for failure).
- [ ] Long-running commands use `background: true` or a timeout to avoid HTTP timeouts.
- [ ] Boot hooks are in place if instance needs to reinstall packages after update or restart.
- [ ] Integrations are connected before agent tries to use them (or agent can connect them in conversation).
- [ ] Billing is monitored: check `GET /v1/usage` for spend breakdown by instance and model.
- [ ] Instances are deleted when no longer needed to stop billing (stopped instances still bill disk).

## Resources

- **Full documentation**: [Agent37 docs llms.txt](https://www.agent37.com/docs/llms.txt) — comprehensive page-by-page navigation.
- **Quickstart**: [Create a sandbox, run a command, reach a service](https://www.agent37.com/docs/quickstart).
- **Core concepts**: [Instances, templates, two planes, one key](https://www.agent37.com/docs/agents-api/concepts).
- **REST API reference**: [All endpoints with examples](https://www.agent37.com/docs/agents-api/overview).

---

> For additional documentation and navigation, see: https://www.agent37.com/docs/llms.txt