Creates an image from a text prompt using supported GPT Image models. Only non-stream requests are currently supported: omit stream or set it to false. Results are not converted into Chat Completions choices.
Request
Header Params
Body Params application/jsonRequired
Example
{"model":"openai/gpt-image-2","prompt":"A small red cube on a white background.","size":"1024x1024","quality":"medium"}
Request Code Samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl--location'/images/generations' \
--header'x-opengateway-user-id;' \
--header'x-opengateway-session-id;' \
--header'x-sionic-task-id;' \
--header'Content-Type: application/json' \
--data'{
"model": "openai/gpt-image-2",
"prompt": "A small red cube on a white background.",
"size": "1024x1024",
"quality": "medium"
}'