OpenAI Image API

This platform provides endpoints compatible with the OpenAI Image API for the current image model gpt-image-2.

As of 2026-04-28, the official OpenAI model page lists gpt-image-2 as the default state-of-the-art image generation model. On ReachAPI, the request and response schema stays aligned with the native OpenAI interface. The main integration difference is replacing the base domain.

Need task polling, callback delivery, or final image URLs in data[].url? Use the GPT Image 2 Async Image API with model: "gpt-image-2-async".

Endpoint Mapping

CapabilityOpenAI nativeReachAPI
Image generationhttps://api.openai.com/v1/images/generationshttps://direct.reachapi.ai/v1/images/generations
Image editinghttps://api.openai.com/v1/images/editshttps://direct.reachapi.ai/v1/images/edits

Authentication

Use your ReachAPI key:

Authorization: Bearer YOUR_REACH_API_KEY

For image generation requests, also send:

Content-Type: application/json

Image edits follow the native OpenAI multipart/form-data contract. Use curl -F, SDK upload helpers, or FormData; do not hardcode the multipart boundary yourself.

Compatibility Notes

  • Recommended model: gpt-image-2
  • Request fields and response objects follow the official OpenAI Image API documentation
  • POST /v1/images/edits uses the native OpenAI image edit request shape with multipart/form-data
  • Edit request fields keep the official names such as image, mask, prompt, and model
  • The official gpt-image-2 model page currently lists image generation and image editing support, and notes that streaming is not supported

Minimal Examples

Generate an Image

curl -X POST "https://direct.reachapi.ai/v1/images/generations" \
  -H "Authorization: Bearer YOUR_REACH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "A precise editorial product shot of a cobalt blue mechanical keyboard on a slate desk"
  }'

Edit an Image

curl -X POST "https://direct.reachapi.ai/v1/images/edits" \
  -H "Authorization: Bearer YOUR_REACH_API_KEY" \
  -F "model=gpt-image-2" \
  -F "prompt=Replace the background with a clean studio backdrop and improve the lighting" \
  -F "image=@/path/to/source.png"

Official References

For the complete parameter list such as background, moderation, output_format, output_compression, size, quality, mask, input_fidelity, and response fields, follow the official OpenAI documentation above. For image edits, use the native official multipart/form-data request shape.

On this page