AI Tools
Pay-per-call AI tools — image & video generation, 600+ language TTS, translation, OCR and more. Quoted in sats upfront, confirmed by you.
AI Tools are pay-per-call capabilities beyond chat: generate images and video, synthesize speech in 600+ languages, translate, extract text with OCR, and more. Every call is quoted in sats upfront, confirmed by you, and itemized in your usage history — billed from the same AI credit balance as chat.
How it works
list tools → quote (valid ~5 min) → execute → result
↑ you see the exact sats BEFORE you pay- Browse the catalog —
/ai/toolsin the dashboard, or the API below. - Quote — a live price in sats for your exact parameters (upstream cost
- margin + FX buffer). Quotes are valid for ~5 minutes.
- Execute — the balance is debited and the tool runs. Instant tools return the result inline; async tools return a job id to poll.
- Audit — every call lands in your tool history with its cost breakdown.
Destructive tools that act on the outside world (SMS, calls, email, fax)
require an explicit confirmed: true — nothing fires by accident.
Tool categories
| Category | What you can do | Priced per |
|---|---|---|
| Image | Text-to-image, editing, upscaling, background removal | image |
| Video & 3D | Text-to-video, image-to-video, 3D assets | second / render |
| Audio & Voice | TTS in 600+ languages, voice cloning, music | 1M units / track |
| Text | Summaries, structured extraction, transformations | 1M tokens |
| Translate | Full-document and snippet translation | 1M chars |
| OCR & Extract | Text from images, PDFs, screenshots | page |
| Comms | SMS, calls, fax, email — confirmation required | message |
| Business | Enrichment, lookups, verification | request |
The live catalog with indicative sats pricing is public:
GET /ai/tools/catalog (no auth).
API
List tools
curl "https://api.zapapi.com/api/v1/ai/tools?category=image" \
-H "Authorization: Bearer zap_live_your_key"Each tool carries its id, name, category, pricingMode, whether it's
destructiveHint (needs confirmation) and isAsync (runs as a job), an
optional inputSchema, and an indicative price in sats.
Quote a call
curl -X POST https://api.zapapi.com/api/v1/ai/tools/flux-image/quote \
-H "Authorization: Bearer zap_live_your_key" \
-H "Content-Type: application/json" \
-d '{ "params": { "prompt": "A lightning bolt over a skyline", "resolution": "1K" } }'{
"toolId": "flux-image",
"costSats": 41,
"listedSats": 52,
"markupPct": 20,
"flatFeeSats": 2,
"fxBufferPct": 3,
"destructiveHint": false,
"isAsync": false,
"expiresAt": "2026-10-28T12:05:00.000Z"
}Execute
curl -X POST https://api.zapapi.com/api/v1/ai/tools/flux-image/execute \
-H "Authorization: Bearer zap_live_your_key" \
-H "Content-Type: application/json" \
-d '{
"params": { "prompt": "A lightning bolt over a skyline", "resolution": "1K" },
"maxSats": 52
}'| Field | Purpose |
|---|---|
params | Tool input (schema on the tool entry) |
maxSats | Optional spend cap — aborts if the live quote drifted above it |
confirmed | Required true for destructive tools (comms) |
Instant tools return the completed call with result. Async tools return
status: "executing" and a call id — poll:
curl https://api.zapapi.com/api/v1/ai/tools/jobs/CALL_ID \
-H "Authorization: Bearer zap_live_your_key"History
curl "https://api.zapapi.com/api/v1/ai/tools/history?page=1&pageCount=20" \
-H "Authorization: Bearer zap_live_your_key"From the SDK
import { ZapAPI } from '@zapapi/sdk';
const zap = new ZapAPI(process.env.ZAPAPI_KEY);
// Browse tools and quote a call
const tools = await zap.aiTools.list('image');
const quote = await zap.aiTools.quote('flux-image', {
prompt: 'A lightning bolt over a skyline',
resolution: '1K',
});
// Execute capped at the quoted price
const call = await zap.aiTools.execute('flux-image', {
params: { prompt: 'A lightning bolt over a skyline', resolution: '1K' },
maxSats: quote.listedSats,
});
// Async tools — wait for the result
const job = await zap.aiTools.waitForCompletion(call.id, { timeoutMs: 300_000 });
console.log(job.result);
// History
const { calls, total } = await zap.aiTools.history({ page: 1 });Errors
| HTTP | Meaning |
|---|---|
| 400 | Invalid params, or destructive tool without confirmed: true |
| 402 | Insufficient AI credit — top up with Lightning |
| 404 | Unknown tool id |
| 429 | Upstream rate limit — retry shortly |
| 502 | Upstream error — failed calls are refunded automatically |
Failed calls refund automatically
When an upstream call fails before producing a result, the charge is
reversed and the call shows status refunded in your history. You only
ever pay for completed work.