AI API in apps
Kazzle apps should use Kazzle’s AI API for chat, images, speech, transcription, and video. Do not ask users for OpenAI, Anthropic, or other provider keys unless they specifically want to bill those providers directly.What to use
All app AI calls go throughhttps://api.kazzle.app plus a kzl_ API key:
KAZZLE_API_KEY is an app credential you create with the api_key tool, store in the vault, and wire into the app’s process component.
Common endpoints
| Job | Endpoint |
|---|---|
| Chat or text generation | POST /ai/chat/completions |
| Images | POST /ai/images/generations |
| Text to speech | POST /ai/audio/speech |
| Speech to text | POST /ai/audio/transcriptions |
| Video generation | POST /ai/video/generations |
| Model catalog | GET /ai/models |
/ai/models first when the app needs to pick a model dynamically.
Wiring the API key
- Create a scoped Kazzle API key for the app.
- Store it in a secret collection + environment with the name
KAZZLE_API_KEY(the secret name becomes the env var key). - Point the process component at that collection + environment.
- Keep calls server-side unless the endpoint is intentionally public through your own backend.
process.env.KAZZLE_API_KEY resolved from the vault at runtime. There is no env.vars field — secrets only reach app components through the collection + environment they point at.
Never put a private API key in frontend code or a VITE_* variable.