Agent Quickstart
This guide is the fastest deterministic path for agents to run Auto end-to-end.
Use this with:
1) Pick Access Mode
| Mode | Route Prefix | Primary Auth |
|---|---|---|
| API key | /v2/auto/* | x-elfa-api-key (+ HMAC on mutation routes) |
| x402 | /x402/v2/auto/* | x402 payment header (+ x-elfa-agent-secret on query lifecycle routes) |
2) Load Endpoint Metadata (Machine-Readable)
Manifest URL:
/agent/endpoints.manifest.json
Each entry provides:
- method/path
- docs route
- required headers
- HMAC requirement and mounted signature path template
- payment requirement
- request and response examples
3) Call Sequence (Recommended)
API key mode (/v2/auto/*)
POST /chatPOST /queries/validatePOST /queriesGET /queries/{queryId}/stream(orGET /queries/{queryId}polling)GET /queries/{queryId}/sessionsandGET /queries/{queryId}/sessions/{sessionId}when usingllmaction
x402 mode (/x402/v2/auto/*)
POST /chatPOST /queries/validatePOST /queriesGET /queries/{queryId}/stream(orPOST /queries/{queryId}polling)POST /queries/{queryId}/sessionsandPOST /queries/{queryId}/sessions/{sessionId}when usingllmaction
4) Auth Rules You Must Enforce
API key mode
- Always send
x-elfa-api-key. - On mutation routes, also send
x-elfa-timestampandx-elfa-signature. - Sign payload as:
timestamp + method + mounted_path + body
Mounted path example:
- request URL:
/v2/auto/queries - signed path:
/queries
x402 mode
- Send payment header (
PAYMENT-SIGNATUREpreferred;X-PAYMENTlegacy). - Persist one stable
x-elfa-agent-secretper agent identity. - Do not rotate agent secret per request/session.
5) Runtime Pattern (Production)
- Validate before create.
- Prefer webhook/SSE for real-time delivery.
- Deduplicate by event ID.
- Hand off to a background runner for policy and execution.
For implementation details:
6) Failure Handling Order
- Retry transient network errors with backoff.
- On validation failure (
400/422), repair query and re-validate. - On auth failures (
401/403), refresh credentials or enablement state. - On x402 payment failure (
402), re-price and retry with valid payment payload.