# GPT Image 2 > OpenAI's state-of-the-art image generation model. Create and edit images from text with strong instruction following, sharp text rendering, and detailed editing. - **Provider**: replicate - **Model ID**: openai/gpt-image-2 - **Category**: image_generation - **Credits**: 480 per request - **Pricing Type**: input_based ## API Endpoint Base URL: https://api.core.today/v1 ### Create Prediction POST /predictions ### Get Status GET /predictions/{job_id} ### Cancel DELETE /predictions/{job_id} ## Authentication Header: `X-API-Key: YOUR_API_KEY` ## Input Parameters - `openai_api_key` (string, optional): Your OpenAI API key (optional - uses proxy if not provided) - `aspect_ratio` (string, optional): The aspect ratio of the generated image (Default: `1:1`; Options: `1:1`, `3:2`, `2:3`) - `input_images` (array, optional): A list of images to use as input for the generation (for editing or composing) (Default: `[]`) - `number_of_images` (integer, optional): Number of images to generate. Limited to 1 — for multiple images, call the API multiple times. (Default: `1`; Range: min: 1, max: 1) - `output_format` (string, optional): Output image format (Default: `webp`; Options: `webp`, `png`, `jpeg`) - `output_compression` (integer, optional): Compression level (0-100%) for webp/jpeg output (Default: `90`; Range: min: 0, max: 100) - `user_id` (string, optional): An optional unique identifier representing your end-user. This helps OpenAI monitor and detect abuse. - `background` (string, optional): Set whether the background is opaque or choose automatically (transparent backgrounds not supported) (Default: `auto`; Options: `auto`, `opaque`) - `moderation` (string, optional): Content moderation level (Default: `auto`; Options: `auto`, `low`) - `prompt` (string, **required**): A text description of the desired image - `quality` (string, optional): The quality of the generated image. Higher quality is sharper but slower and more expensive. (Default: `auto`; Options: `low`, `medium`, `high`, `auto`) ## Example Request ```json { "model": "openai/gpt-image-2", "input": { "aspect_ratio": "3:2", "number_of_images": 1, "output_format": "webp", "output_compression": 90, "background": "auto", "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. Soft golden hour light streams through a window.", "quality": "high" } } ``` ## Response Format ```json { "job_id": "abc123", "status": "pending", "provider": "replicate", "model": "black-forest-labs/flux-schnell", "created_at": "2026-01-01T00:00:00Z", "result": null, "error": null } ``` Status values: `pending`, `processing`, `completed`, `failed`, `cancelled` ## Usage Flow 1. POST /predictions with model and input → receive job_id 2. Poll GET /predictions/{job_id} until status is `completed` or `failed` 3. Result contains output URL(s) or data ## Output Type url ## Tags image-generation, text-to-image, image-editing, openai, typography, photorealistic, text-rendering, character-consistency, frontier ## Documentation https://replicate.com/openai/gpt-image-2