- Base URL:
https://codzen.ai/api/v1 - Authentication:
Authorization: Bearer cz_… - Format: JSON request and response bodies,
snake_casefields
1
Create an API key
Sign in to Codzen, open the console and create an API key. Copy it right away: the full key is shown only once.Keep it in an environment variable on your server:Never put an API key in a browser or mobile app. See Authentication and rate limits.
2
Submit a generation
Send the model’s slug as The API answers
model and its parameters as input. This example uses codzen-play; the Models index lists every slug and links to each model’s input fields.202 Accepted with the new generation, queued. The estimate is held from your balance:3
Poll until it finishes
Fetch the generation by its Once it has succeeded, If it failed,
id every few seconds until status is succeeded or failed:outputs lists what it produced and cost.amount is what it cost:error says why. See Errors.4
Download the output
Each output’s
url downloads without an API key:Next steps
Generation lifecycle
The states a generation goes through, and polling versus webhooks.
Webhooks and signatures
Get called when a generation finishes, and verify the call.
Errors
Every error code, and which ones to retry.
API reference
Every endpoint with its request and response shapes.

