API keys
Every request sends an API key in theAuthorization header:
GET /models is the only endpoint that works without an API key.
- Create API keys in the console. An API key starts with
cz_. Give each key a name, such as the app or environment that uses it; an account can have up to 10 API keys. - The full key is shown only once, when you create it. Codzen stores only a hash, so a lost key cannot be shown again: create a new one and revoke the old one.
- Revoking a key in the console removes it for good. Requests with a revoked key fail with
401 invalid_api_key. - API keys do not expire, and every key can call every endpoint for its account.
Authentication errors
Generations submitted before a suspension still finish, are charged and send their webhooks. See Errors for the error format.
Rate limits
- Every request with an API key counts toward its rate limit, including
GETrequests that poll a generation. - The concurrency limit is per account, across all of its API keys. A generation stops counting once it succeeds or fails.
- The API does not queue for you. A request over a limit fails right away with
429and aRetry-Afterheader: the number of seconds to wait before trying again. - Responses carry no
X-RateLimit-*headers. Rely on429andRetry-After.
429, wait for Retry-After seconds, then send the same request again. To stay under the concurrency limit, keep your own queue of pending work and submit a new generation when one finishes.
Request IDs
Every response carries anx-request-id header, and every error body repeats it as request_id. Quote it when you contact support about a request.
