API ReferenceImages
Generate image
OpenAI Images API compatible image generation endpoint.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X POST "https://example.com/v1/images/generations" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-image-1", "prompt": "A futuristic screenshot of an API gateway console", "size": "1024x1024" }'{
"created": 0,
"data": [
{
"url": "http://example.com",
"b64_json": "string",
"revised_prompt": "string"
}
]
}{
"error": {
"code": "string",
"message": "string",
"request_id": "string"
}
}