gpt-image-2
openai/gpt-image-2Generate an image from a written description.
- token
- —
- OpenAI
- 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.
| Field | Type | Required | Description |
|---|---|---|---|
| prompt | string | Yes | What 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.
