Run your AI agents from your own code
Call an Agentis agent over HTTP and get a reply with its full brain — system prompt, knowledge base, and tools — or manage the agent itself programmatically. Billed against the same credits as WhatsApp.
Get an API key →Two surfaces
Run
POST /v1/chat/completionsTalk to an agent, get a reply + usage. Needs a key with the chat scope.
Manage
/v1/agents/*List your agents and configure their webhook tools. Needs a key with the manage scope.
Authentication
Every request authenticates with a bearer API key created in your dashboard. The raw key is shown once at creation — store it securely. Keys carry scopes: chat (run agents, safe to embed client-side) and/or manage (configure agents, keep server-side only).
Authorization: Bearer dz_live_a1b2c3d4...
Quick start — run an agent
curl https://app.dailzero.com/api/v1/chat/completions \
-H "Authorization: Bearer dz_live_..." \
-H "Content-Type: application/json" \
-d '{
"agentId": "<your-agent-id>",
"messages": [
{ "role": "user", "content": "do you sell ferrari caps?" }
]
}'Response
{
"message": { "role": "assistant", "content": "Yes — Ferrari F1 White Cap (₦23,000)..." },
"usage": { "input_tokens": 1240, "output_tokens": 142, "credits": 2 },
"remaining_credits": 11218
}Manage an agent's tools
Define the webhook tools your agent can call — the same tools it uses on WhatsApp.
curl -X PUT https://app.dailzero.com/api/v1/agents/<id>/tools \
-H "Authorization: Bearer dz_live_..." \
-H "Content-Type: application/json" \
-d '{ "tools": [
{ "name": "check_stock", "description": "Check stock for a product",
"url": "https://your-api.com/stock", "method": "GET",
"parameters": [
{ "name": "sku", "type": "string", "description": "Product SKU", "required": true }
] }
] }'Limits & safety
- Per-key rate limit (default 60 requests/minute) →
429withRetry-After. - Optional per-key daily spending cap, set when you create the key.
- Hard per-request output cap so a single call can't run up a huge bill.
- Send an
Idempotency-Keyheader to safely retry without double-charging. - A pre-flight credit check blocks calls your balance can't cover.
Errors
Every error returns { "error": { "code", "message", "request_id" } }. Branch on code.
| Code | HTTP | Meaning |
|---|---|---|
BAD_REQUEST | 400 | Malformed request (bad JSON, missing or oversized fields). |
UNAUTHORIZED | 401 | Missing, malformed, unknown, or revoked key. |
INSUFFICIENT_CREDITS | 402 | Account balance can't cover the call. |
DAILY_CAP_HIT | 402 | The key's daily spending cap is exhausted. |
FORBIDDEN_SCOPE | 403 | The key lacks the scope this endpoint requires. |
AGENT_NOT_FOUND | 404 | The agent doesn't exist or isn't yours. |
RATE_LIMITED | 429 | Too many requests — retry after the Retry-After header. |
INTERNAL | 500 | Something went wrong on our side. |