GGateYourWay API
SDKs and clients RU Create key
Image API

Image generation

The OpenAI-compatible endpoint returns one completed generation as base64.

01

Models

gpt-image-2, gpt-image-2.5-flare, gpt-image-2.5-sunburst

02

POST /v1/images/generations

bash
curl https://api.gateyourway.com/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer gyw-sk-YOUR_KEY" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "A clean editorial product photo of a silver watch",
    "n": 1,
    "size": "1024x1024",
    "quality": "low",
    "response_format": "b64_json"
  }'
json
{
  "created": 1785600000,
  "data": [{"b64_json": "iVBORw0KGgoAAA..."}]
}
03

Parameters

FieldRequirement
modelA public image model from the catalog.
promptA non-empty string.
nOnly 1.
response_formatThe gateway normalizes the response to b64_json.
size / qualitySupport depends on the selected model.
04

Decode the image

python
import base64
from pathlib import Path

image_bytes = base64.b64decode(result.data[0].b64_json)
Path("image.png").write_bytes(image_bytes)