OpenAI's state-of-the-art image generation and editing model with strong instruction following, sharp text rendering, and detailed editing. Quality-based pricing lets you trade off cost vs. fidelity.
Test this model instantly in the Console Playground โ no code required
Copy usage instructions for Claude, ChatGPT, or other AI
curl -X POST "https://api.core.today/v1/predictions" \
-H "Content-Type: application/json" \
-H "X-API-Key: cdt_your_api_key" \
-d '{
"model": "openai/gpt-image-2",
"input": {
"prompt": "A photorealistic close-up portrait of an elderly Japanese ceramicist with deep wrinkles and a warm smile, carefully inspecting a freshly glazed tea bowl in his rustic sun-drenched workshop.",
"aspect_ratio": "3:2",
"quality": "high",
"output_format": "webp"
}
}'| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | Yes | - | A text description of the desired image |
input_images | array | No | - | Array of image URLs to use as input for editing or composition |
aspect_ratio | string | No | 1:1 | Output aspect ratio 1:13:22:3 |
quality | string | No | auto | Quality tier โ sharper but slower and more expensive at higher tiers lowmediumhighauto |
background | string | No | auto | Set background mode (transparent backgrounds not supported) autoopaque |
output_format | string | No | webp | Output image format webppngjpeg |
output_compression | integer | No | 90 | Compression level (0-100) for webp/jpeg output |
moderation | string | No | auto | Content moderation level autolow |
number_of_images | integer | No | 1 | Limited to 1 โ call multiple times for batches |
There are 3 ways to provide files for the input_images parameter:
Attach files directly to POST /v1/predictions/upload. No separate upload step needed.
curl -X POST "https://api.core.today/v1/predictions/upload" \
-H "X-API-Key: cdt_your_api_key" \
-F "model=openai/gpt-image-2" \
-F 'input={"prompt":"your prompt here"}' \
-F "file:input_images=@your_file.png"Pass a publicly accessible URL directly. You can also use file_url from the Storage API.
{
"model": "openai/gpt-image-2",
"input": {
"prompt": "your prompt here",
"input_images": ["https://example.com/image.jpg"]
}
}Common parameters used when calling POST /v1/predictions.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | - | Model identifier |
input | object | Yes | - | Object containing the model-specific parameters from the table above |
output_folder | string | No | - | Folder path for output files (max 256 chars, '..' not allowed) |
webhook_url | string | No | - | Webhook URL to call on completion |
is_public | boolean | No | false | If true, output files are also available via permanent public URLs |
Generate a high-fidelity portrait with rich detail
curl -X POST "https://api.core.today/v1/predictions" \
-H "Content-Type: application/json" \
-H "X-API-Key: cdt_your_api_key" \
-d '{
"model": "openai/gpt-image-2",
"input": {
"prompt": "A photorealistic close-up portrait of an elderly Japanese ceramicist with deep wrinkles and a warm smile, carefully inspecting a freshly glazed tea bowl in his rustic sun-drenched workshop.",
"aspect_ratio": "3:2",
"quality": "high",
"output_format": "webp"
}
}'POST /v1/predictions