List generations
curl --request GET \
--url https://codzen.ai/api/v1/generations \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://codzen.ai/api/v1/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://codzen.ai/api/v1/generations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": [
{
"id": "<string>",
"model": "<string>",
"status": "queued",
"input": {},
"outputs": [
{
"type": "video",
"url": "<string>"
}
],
"cost": {
"currency": "USD",
"estimated": "<string>",
"amount": "<string>",
"usage": [
{
"unit": "<string>",
"quantity": 1,
"unit_price": "<string>"
}
]
},
"error": {
"type": "invalid_request_error",
"code": "invalid_request",
"message": "<string>",
"retryable": true,
"param": "<string>",
"stage": "input"
},
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
}
],
"has_more": true
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_request",
"message": "<string>",
"retryable": true,
"param": "<string>",
"stage": "input"
},
"request_id": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_request",
"message": "<string>",
"retryable": true,
"param": "<string>",
"stage": "input"
},
"request_id": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_request",
"message": "<string>",
"retryable": true,
"param": "<string>",
"stage": "input"
},
"request_id": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_request",
"message": "<string>",
"retryable": true,
"param": "<string>",
"stage": "input"
},
"request_id": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_request",
"message": "<string>",
"retryable": true,
"param": "<string>",
"stage": "input"
},
"request_id": "<string>"
}API reference
List generations
Your generations, newest first, one page at a time. While has_more is true, pass the last id of a page as after to get the next one.
GET
/
generations
List generations
curl --request GET \
--url https://codzen.ai/api/v1/generations \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://codzen.ai/api/v1/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://codzen.ai/api/v1/generations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": [
{
"id": "<string>",
"model": "<string>",
"status": "queued",
"input": {},
"outputs": [
{
"type": "video",
"url": "<string>"
}
],
"cost": {
"currency": "USD",
"estimated": "<string>",
"amount": "<string>",
"usage": [
{
"unit": "<string>",
"quantity": 1,
"unit_price": "<string>"
}
]
},
"error": {
"type": "invalid_request_error",
"code": "invalid_request",
"message": "<string>",
"retryable": true,
"param": "<string>",
"stage": "input"
},
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
}
],
"has_more": true
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_request",
"message": "<string>",
"retryable": true,
"param": "<string>",
"stage": "input"
},
"request_id": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_request",
"message": "<string>",
"retryable": true,
"param": "<string>",
"stage": "input"
},
"request_id": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_request",
"message": "<string>",
"retryable": true,
"param": "<string>",
"stage": "input"
},
"request_id": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_request",
"message": "<string>",
"retryable": true,
"param": "<string>",
"stage": "input"
},
"request_id": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_request",
"message": "<string>",
"retryable": true,
"param": "<string>",
"stage": "input"
},
"request_id": "<string>"
}Authorizations
Your API key (cz_…), created in the console. Use it only on your server.
Query Parameters
How many generations to return.
Required range:
1 <= x <= 100Return the generations created before this one: the last id of the previous page.
Pattern:
^gen_Only this status.
Available options:
queued, processing, succeeded, failed Only this model slug.

