Back to Blog
Tutorials
7 min read
March 1, 2026

MyOpenClaw Developer API: Automate Your AI Infrastructure

Manage your OpenClaw instances programmatically. Create, start, stop, and monitor instances with our REST API. Available for Pro and Business plans.

MyOpenClaw Team

MyOpenClaw Developer API: Automate Your AI Infrastructure

Stop clicking buttons. Start automating.

The MyOpenClaw Developer API lets you manage your AI assistant instances programmatically — perfect for DevOps teams, platform builders, and power users who want full control.

What Can You Do With the API?

Instance Management

Create, start, stop, and restart instances without touching the dashboard:

List all your instances

curl -H "Authorization: Bearer moc_abc123_xyz789..." \

https://www.myopenclaw.cloud/api/v1/instances

Create a new instance with a custom subdomain

curl -X POST \

-H "Authorization: Bearer moc_abc123_xyz789..." \

-H "Content-Type: application/json" \

-d '{"subdomain": "my-project-bot", "label": "Project Bot"}' \

https://www.myopenclaw.cloud/api/v1/instances

API Key Management

Create and manage API keys with fine-grained scope control:

Create a read-only key for monitoring

curl -X POST \

-H "Authorization: Bearer moc_abc123_xyz789..." \

-H "Content-Type: application/json" \

-d '{"name": "monitoring-key", "scopes": ["instance:read", "operations:read"]}' \

https://www.myopenclaw.cloud/api/v1/keys

Async Operations

Long-running operations (start, restart) return immediately with an operation ID you can poll:

// Start an instance (returns 202 Accepted)

const res = await fetch(/api/v1/instances/${id}/start, {

method: 'POST',

headers: { 'Authorization': Bearer ${apiKey} },

});

const { operationId } = await res.json();

// Poll until complete

let status = 'pending';

while (status === 'pending' || status === 'in_progress') {

const op = await fetch(/api/v1/operations/${operationId}, {

headers: { 'Authorization': Bearer ${apiKey} },

}).then(r => r.json());

status = op.status;

}

Security Built In

  • API keys use HMAC-SHA256 with server-side pepper — tokens are never stored in plaintext
  • 11 granular scopes let you create least-privilege keys (e.g., read-only for monitoring)
  • Rate limiting prevents abuse with per-key and per-user global ceilings
  • Cookie rejection prevents confused-deputy attacks — API keys only, no session cookies
  • Idempotency keys prevent duplicate operations from retries
  • Use Cases

    CI/CD Integration

    Automatically restart instances after deploying new configurations:

    GitHub Actions example

  • name: Restart OpenClaw instance
  • run: |

    curl -X POST \

    -H "Authorization: Bearer ${{ secrets.MYOPENCLAW_API_KEY }}" \

    -H "Idempotency-Key: deploy-${{ github.sha }}" \

    https://www.myopenclaw.cloud/api/v1/instances/${{ vars.INSTANCE_ID }}/restart

    Multi-Instance Management

    Pro users get up to 6 instances, Business users up to 21. Manage them all from a single script:

    import requests
    
    

    API_KEY = "moc_abc123_xyz789..."

    BASE = "https://www.myopenclaw.cloud/api/v1"

    Get all instances

    instances = requests.get(

    f"{BASE}/instances",

    headers={"Authorization": f"Bearer {API_KEY}"}

    ).json()

    Restart all running instances

    for inst in instances:

    if inst["status"] == "running":

    requests.post(

    f"{BASE}/instances/{inst['id']}/restart",

    headers={"Authorization": f"Bearer {API_KEY}"}

    )

    print(f"Restarting {inst['subdomain']}.myopenclaw.cloud")

    Monitoring & Alerting

    Build custom monitoring dashboards by polling instance status:

    Check instance health (great for uptime monitoring tools)

    curl -s -H "Authorization: Bearer $API_KEY" \

    https://www.myopenclaw.cloud/api/v1/instances | \

    jq '.[] | {subdomain, status, fly_region}'

    Getting Started

  • Upgrade to Pro or Business — API access requires Pro ($49/mo) or Business ($99/mo)
  • Generate an API key — Go to Dashboard → API Keys → Create Key
  • Read the full docsAPI Reference has complete endpoint documentation
  • Start building — Use curl, Python, JavaScript, or any HTTP client
  • API Highlights

    FeatureDetails AuthenticationBearer token (API key) Key formatmoc_shortToken_longToken Scopes11 granular scopes + shortcuts (read, write, all) Rate limitsPer-key + per-user global ceiling Async ops202 + operation polling for long tasks IdempotencyVia Idempotency-Key header

    Ready to automate? Get started with Pro →

    Full API reference: Developer API Docs →

    apideveloperautomationdevopsmulti-instance

    Ready to Try OpenClaw?

    Get your AI assistant running in 60 seconds.

    Get Started