/ai/* on https://api.kazzle.app and accept a kzl_ API key in the Authorization header. See API keys for how to create one.
Generated Kazzle apps should use this API too — see AI in apps for wiring the key into a component. Do not ask users for provider keys unless they explicitly want to use their own provider account.
Capabilities
GET /ai/models is the source of truth for which model ids work on which endpoint. Read it first if you’re building against the API.
How a call works
Every billable call goes through five phases. You don’t see most of these — they’re tracked server-side so we can refund failed calls and report exact usage.
Every successful response includes
x-kazzle-ai-billing-event-id: airesp_... — keep it if you want to correlate the request with usage exports later.
Billing & markup
We chargecloudflare_cost_usd × (1 + markup). The markup is published in Settings → Billing → Pricing. Calls that Cloudflare priced at $0 (free Workers AI tier, promos) reach the priced phase with zero cost and are never billed.
Reserve: you need at least $0.50 equivalent in credits to make a call. We hold this against your balance until the call finishes, then settle the actual cost.
Errors
Example — image generation
Example — text to speech
See also
- API Reference — full request/response schemas for every endpoint
- API keys — creating and using
kzl_keys - Billing — credits, plans, and the markup we apply