curl -X POST "https://api.lemondata.cc/v1/images/generations" \ -H "Authorization: Bearer sk-your-api-key" \ -H "Content-Type: application/json" \ -d '{ "model": "dall-e-3", "prompt": "A white cat sitting on a windowsill watching rain", "size": "1024x1024", "quality": "standard", "n": 1 }'
Copier
{ "created": 1706000000, "data": [ { "url": "https://...", "revised_prompt": "A fluffy white cat with bright eyes sitting peacefully on a wooden windowsill, watching raindrops stream down the glass window..." } ]}
Images
Créer une image
Crée une image à partir d’un prompt
POST
/
v1
/
images
/
generations
Copier
curl -X POST "https://api.lemondata.cc/v1/images/generations" \ -H "Authorization: Bearer sk-your-api-key" \ -H "Content-Type: application/json" \ -d '{ "model": "dall-e-3", "prompt": "A white cat sitting on a windowsill watching rain", "size": "1024x1024", "quality": "standard", "n": 1 }'
Copier
{ "created": 1706000000, "data": [ { "url": "https://...", "revised_prompt": "A fluffy white cat with bright eyes sitting peacefully on a wooden windowsill, watching raindrops stream down the glass window..." } ]}
Tableau avec des données provisoires. url sera vide jusqu’à la fin du traitement.
Lorsque vous recevez status: "pending", utilisez l’endpoint Obtenir le statut de l’image pour interroger le résultat.
Copier
curl -X POST "https://api.lemondata.cc/v1/images/generations" \ -H "Authorization: Bearer sk-your-api-key" \ -H "Content-Type: application/json" \ -d '{ "model": "dall-e-3", "prompt": "A white cat sitting on a windowsill watching rain", "size": "1024x1024", "quality": "standard", "n": 1 }'
Copier
{ "created": 1706000000, "data": [ { "url": "https://...", "revised_prompt": "A fluffy white cat with bright eyes sitting peacefully on a wooden windowsill, watching raindrops stream down the glass window..." } ]}
Les modèles asynchrones renvoient status: "pending" et nécessitent un polling. Consultez Obtenir le statut de l’image pour savoir comment récupérer les résultats.