> ## Documentation Index
> Fetch the complete documentation index at: https://docs.snapgen.org/llms.txt
> Use this file to discover all available pages before exploring further.

# GPT Image 2 All

> Generate one 1K image for $0.02 with gpt-image-2-all.

`gpt-image-2-all` is the alternate GPT Image 2 serving route. A successful 1K generation costs **\$0.02**, equal to **2 SnapGen credits**.

| Property | Value              |
| -------- | ------------------ |
| Model ID | `gpt-image-2-all`  |
| Price    | \$0.02 per image   |
| Output   | 1K                 |
| Response | `data[0].b64_json` |

<ParamField body="model" type="string" required>
  Set to `gpt-image-2-all`.
</ParamField>

<ParamField body="prompt" type="string" required>
  Describe the desired subject, composition, lighting, and style.
</ParamField>

<ParamField body="size" type="string">
  Use `1024x1024`, `1536x1024`, or `1024x1536`. Other values use automatic
  framing.
</ParamField>

<ParamField body="n" type="integer" default="1">
  Set to `1`; multiple-image requests are not supported.
</ParamField>

## Request

```bash theme={null}
curl https://api.snapgen.org/v1/images/generations \
  -H "Authorization: Bearer $SNAPGEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2-all",
    "prompt": "An indigo paper lantern floating above a quiet city street",
    "size": "1024x1536",
    "n": 1
  }' \
  | jq -r '.data[0].b64_json' \
  | base64 --decode > image.png
```

The request normally completes in 20 to 60 seconds. Set a timeout of at least 120 seconds and decode `data[0].b64_json` as image bytes.

<Card title="Open the model playground" icon="wand-magic-sparkles" href="https://snapgen.org/models/gpt-image-2-all">
  Run the same route from the SnapGen model page.
</Card>
