gpt-image-2

by OpenAI

openai/gpt-image-2

Generate an image from a written description.

Billed per
token
Price
Provider
OpenAI
Timeout
5 min

Overview

Generate an image from a text prompt. The synchronous request remains open until the image is ready. Returns one 1024 × 1024 image at medium quality.

The generated image, returned inline as base64.

Input

These go in the input object of the run request.

FieldTypeRequiredDescription
promptstringYesWhat to draw, in plain language.

Requests up to 1 MB, prompt up to 1,000 characters.

Example

A call that works, with your own key.

curl https://gateway.agentsky.dev/v1/run \
  -H "authorization: Bearer $AGENTSKY_API_KEY" \
  -H "content-type: application/json" \
  -d '{"provider":"openai","endpoint":"gpt-image-2","input":{"prompt":"A paper airplane over a city at dusk, flat illustration"}}'

Pricing

per token on the default plan. Every run carries its price in the response.

Questions