This document covers HTTP API errors, CLI exit conditions, and runtime error events. Each entry includes the cause and an explicit action for the agent to take.
Endpoints: POST /prompt, POST /config
Causes:
- Request body is not valid JSON
- Missing required field (e.g.
contentfor /prompt,changesfor /config) changesarray contains invalid path or value type
Actionable Response:
- Verify Content-Type header is
application/json - Ensure body is valid JSON (no trailing commas, quoted keys)
- For
/prompt: confirm body has{"content": "<string>"} - For
/config: confirm body has{"changes": [{"path": "<string>", "value": <any>}]} - Do NOT retry with the same malformed request
Example error:
{"error": "Bad Request", "message": "Missing required field: content"}Endpoints: All endpoints
Causes:
- Agent process has crashed or is in a bad state
- World state not yet loaded (first tick pending)
- Underlying Starknet/Torii connection failure
Actionable Response:
- Wait 5 seconds before retrying
- Retry up to 3 times
- If persistent: check agent stdout for NDJSON error events
- Run
axis doctorto validate configuration - Restart axis if necessary:
axis run --headless --world=<world> --api-port=<port>
Type: Network error (not HTTP response)
Causes:
- Axis is not running
--api-portwas not specified when starting axis- Wrong port number in request URL
- Axis started but HTTP API not yet initialized
Actionable Response:
- Verify axis is running: check process list or PID file
- Confirm
--api-port=<PORT>was passed toaxis run --headless - Wait 2 seconds after launch for HTTP server to initialize
- Check the port number matches
--api-portvalue
Cause: Axis cannot reach the Cartridge world discovery API.
Actionable Response:
- Check network connectivity
- Verify
CARTRIDGE_API_BASEenv var is not overriding to an invalid URL - Try specifying world manually: set
RPC_URL,TORII_URL,WORLD_ADDRESSenv vars - Run
axis doctorfor diagnostics
Cause: axis run --headless was invoked without --world=<name>.
Actionable Response:
- Determine the world name: run
axis worldsto list discovered worlds - Re-run with
axis run --headless --world=<discovered-world-name> - Alternatively, set
SLOT_NAME=<world-name>in.envto auto-select
Cause: Browser-based auth was initiated but user has not approved.
Actionable Response:
- For headless setups, avoid browser auth entirely: use
--method=password - If browser auth is required: capture the redirect URL from the browser after approval and complete with:
axis auth <world> --redirect-url="<captured-url>" - Or supply base64 session data directly:
axis auth <world> --session-data=<base64> - Check status:
axis auth <world> --status
Cause: Invalid credentials or account lacks password credential on Cartridge.
Actionable Response:
- Verify
--usernameand--passwordvalues are correct - Confirm the account has a password credential set in Cartridge Controller
- If account only has social login, use browser auth method instead
- Do not retry with same credentials; verify via Cartridge dashboard first
Cause: The stored Cartridge session has expired.
Actionable Response:
- Re-authenticate:
axis auth <world> - For headless:
axis auth <world> --method=password --username=<user> --password=<pass> - Start the axis agent after successful re-auth
- Consider increasing session TTL if configurable in Cartridge
Headless mode emits {"type":"error", ...} events to stdout when errors occur.
{
"type": "error",
"timestamp": "<ISO-8601>",
"code": "<ERROR_CODE>",
"message": "<human-readable message>",
"world": "<world-name>"
}| Code | Meaning | Action |
|---|---|---|
AUTH_EXPIRED |
Session expired | Re-run axis auth <world> and restart |
WORLD_DISCONNECTED |
Lost connection to world RPC/Torii | Check network; agent will retry automatically |
LLM_ERROR |
LLM API call failed | Check API key validity and quota; MODEL_PROVIDER and API key may need update |
TX_FAILED |
On-chain transaction rejected | Check game state; the action may be invalid given current world state |
TICK_TIMEOUT |
Tick took too long | Increase tickIntervalMs via POST /config or shell env |
RATE_LIMITED |
LLM provider rate limited | Wait for retry; agent should back off automatically |
CONFIG_ERROR |
Invalid configuration value | Run axis doctor; check .env file |
Symptom: Agent fails to start or LLM calls fail immediately
Cause: ANTHROPIC_API_KEY (or equivalent for other providers) is not set
Actionable Response:
echo "ANTHROPIC_API_KEY=sk-ant-..." >> ~/.eternum-agent/.env
# Or for OpenAI:
echo "MODEL_PROVIDER=openai" >> ~/.eternum-agent/.env
echo "OPENAI_API_KEY=sk-..." >> ~/.eternum-agent/.envSymptom: LLM requests fail with model-not-found error
Cause: MODEL_ID set to an invalid or deprecated model identifier
Actionable Response:
- Remove or update
MODEL_IDin.envto use the default or a valid model - Default for Anthropic:
claude-sonnet-4-5-20250929
Run axis doctor to validate configuration and check for common issues:
axis doctoraxis doctor checks:
- API key presence and format
- World discovery reachability
- Session validity for all known worlds
- Runtime directory permissions
- Binary version
Agent receives error or no response
│
├── HTTP 400
│ └── Fix request body format; do not retry
│
├── HTTP 500
│ ├── Wait 5s, retry up to 3 times
│ └── If still failing: restart axis
│
├── ECONNREFUSED
│ ├── Check axis is running with --api-port
│ └── Wait 2s after launch for HTTP init
│
├── NDJSON error event (type=error)
│ ├── AUTH_EXPIRED → Re-authenticate
│ ├── LLM_ERROR → Check API key + quota
│ ├── TX_FAILED → Verify action is valid in current game state
│ └── WORLD_DISCONNECTED → Wait; agent retries automatically
│
└── CLI error message
├── "No worlds discovered" → Check network + CARTRIDGE_API_BASE
├── "--world is required" → Add --world=<name> flag
├── "Auth pending" → Use --method=password or complete browser flow
└── "Session expired" → Re-run axis auth <world>