OpenAI: GPT Image 2
Image Generationopenai/gpt-image-2GPT Image 2 is OpenAI's most recent image generation model, released on 2026-04-21. It improves on overall performance and image quality while adding finer editing controls and face preservation. The model supports high input fidelity and can add or remove a single aspect of an image while keeping everything else intact, with improvements in aspect ratio handling, resolution, and editing capability. Image input is accepted for edit and reference workflows, and prompt caching is available, with cached image input billed below fresh input. Accessible via the OpenAI-compatible protocol through Ofox.
Context Window
0
Max Output Tokens
0
Released
2026-04-21
Capabilities
VisionPrompt Caching
Available Providers
Azure
Supported Protocols
openai
Providers
Azure
Input Tokens
$5/M
Output Tokens
$30/M
Cache Read
$1.25/M
Image Input
$8/M
Cached Image
$2/M
Output Image
$30/M
Web Search
$0.035/R
Protocols
openai
/v1/images/generationsCode Examples
from openai import OpenAIclient = OpenAI(base_url="https://api.ofox.run/v1",api_key="YOUR_OFOX_API_KEY",)response = client.images.generate(model="openai/gpt-image-2",prompt="A beautiful sunset over mountains",size="1024x1024",)print(response.data[0].url)
Related Models
Frequently Asked Questions
OpenAI: GPT Image 2 on Ofox.ai costs $5/M per million input tokens and $30/M per million output tokens. Pay-as-you-go, no monthly fees.
OpenAI: GPT Image 2 supports a context window of 0 tokens with max output of 0 tokens, allowing you to process large documents and maintain long conversations.
Simply set your base URL to https://api.ofox.run/v1 and use your Ofox API key. The API is OpenAI-compatible — just change the base URL and API key in your existing code.
OpenAI: GPT Image 2 supports the following capabilities: Vision, Prompt Caching. Access all features through the Ofox.ai unified API.