curl --request POST \
--url https://apiany.ai/v1/images/generations/sync \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-image-2.6",
"prompt": "A polished studio photograph of an orange ceramic robot",
"output_format": "png",
"size": "1:1",
"n": 1
}
'{
"created": 123,
"data": [
{
"url": "<string>",
"b64_json": "<string>",
"revised_prompt": "<string>"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"input_tokens": 123,
"output_tokens": 123,
"cached_input_tokens": 123
}
}{
"task_id": "task_123",
"status": "pending",
"poll_url": "/v1/tasks/task_123",
"model": "<string>"
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"param": "<string>",
"code": "<string>"
}
}Images
Créer une génération d'image et attendre le résultat
Crée une tâche d’image et attend jusqu’au délai maximal. Une requête GPT Image 2.6 terminée renvoie une URL PNG ou GIF animé dans data[0].url. HTTP 202 indique qu’il faut continuer à interroger la tâche renvoyée.
POST
/
v1
/
images
/
generations
/
sync
curl --request POST \
--url https://apiany.ai/v1/images/generations/sync \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-image-2.6",
"prompt": "A polished studio photograph of an orange ceramic robot",
"output_format": "png",
"size": "1:1",
"n": 1
}
'{
"created": 123,
"data": [
{
"url": "<string>",
"b64_json": "<string>",
"revised_prompt": "<string>"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"input_tokens": 123,
"output_tokens": 123,
"cached_input_tokens": 123
}
}{
"task_id": "task_123",
"status": "pending",
"poll_url": "/v1/tasks/task_123",
"model": "<string>"
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"param": "<string>",
"code": "<string>"
}
}Autorisations
Corps
application/json
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5