API Reference

Manage your AI agents programmatically. Create, configure, and monitor agents via REST API.

Authentication

Authenticate requests with an API key in the Authorization header:

curl https://alfredclaw.com/api/v1/agents \
  -H "Authorization: Bearer ak_live_your_key_here"

Create API keys in your Dashboard. Keys are shown only once at creation.

Rate Limits

Per minute

60 requests

Per hour

1,000 requests

Rate limited responses return 429 with a retryAfter field.

Errors

{
  "error": {
    "code": "unauthorized",
    "message": "Invalid or missing authentication"
  }
}
400 Bad request
401 Unauthorized — invalid or missing API key
403 Forbidden — insufficient scope
404 Not found
429 Rate limited
500 Internal error

Endpoints

POST/api-keysadmin

Create a new API key

Request body:
{ "name": "My Script", "scopes": ["read", "write"] }
Response:
{ "api_key": { "key": "ak_live_abc123...", "name": "My Script", "prefix": "ak_live_abc12345", "scopes": ["read", "write"] } }
GET/api-keysread

List your API keys

DELETE/api-keys/:idadmin

Revoke an API key

Quick Start

1. Create an API key

curl -X POST https://alfredclaw.com/api/v1/api-keys \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "My Script", "scopes": ["read", "write"]}'

2. List your agents

curl https://alfredclaw.com/api/v1/agents \
  -H "Authorization: Bearer ak_live_your_key"

3. Add a secret to an agent

curl -X POST https://alfredclaw.com/api/v1/agents/AGENT_ID/secrets \
  -H "Authorization: Bearer ak_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{"name": "GITHUB_TOKEN", "value": "ghp_xxx..."}'

Use this skill to let your AI agent (Claude Code, OpenAI Codex, or any OpenClaw instance) manage AlfredClaw agents programmatically. Drop it in your agent's skills directory.

Setup:

# Claude Code / OpenClaw
curl -o ~/.claude/skills/alfredclaw-api.md \
  https://alfredclaw.com/skills/alfredclaw-api.md

# Or for OpenClaw shared skills
curl -o /path/to/skills/alfredclaw-api/SKILL.md \
  https://alfredclaw.com/skills/alfredclaw-api.md

The skill includes all endpoints, auth setup, and a complete "spawn a new agent" flow.