curl --request POST \
--url https://apiany.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "nano-banana",
"prompt": "A clean product hero image for an AI API gateway",
"size": "1k"
}
'{
"task_id": "task_123",
"status": "pending",
"poll_url": "/v1/tasks/task_123",
"model": "<string>"
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"param": "<string>",
"code": "<string>"
}
}Images
Créer une tâche de génération d'image
Crée une tâche de génération d’image asynchrone et renvoie un task_id.
POST
/
v1
/
images
/
generations
curl --request POST \
--url https://apiany.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "nano-banana",
"prompt": "A clean product hero image for an AI API gateway",
"size": "1k"
}
'{
"task_id": "task_123",
"status": "pending",
"poll_url": "/v1/tasks/task_123",
"model": "<string>"
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"param": "<string>",
"code": "<string>"
}
}Autorisations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Corps
application/json
- Option 1
- Option 2
- Option 3
Allowed value:
"gpt-image-2"Accepts auto, a positive WIDTHxHEIGHT target, or ratio shorthand such as 16:9. Every non-auto target is mapped to the nearest official popular size: 1024x1024, 1536x1024, 1024x1536, 2048x2048, 2048x1152, 3840x2160, or 2160x3840.
Exemples:
"auto"
"1024x1024"
"1280x720"
"16:9"
GPT-Image 2 rendering quality.
Options disponibles:
auto, low, medium, high Number of images to generate. Billing scales with the image count.
Plage requise:
1 <= x <= 10Deprecated ratio shorthand. The ratio and compatibility tier are mapped to the nearest official popular size.
Deprecated compatibility tier used to form the target size before nearest-official-size mapping.
Options disponibles:
1K, 2K, 4K