Skip to content
InferenceHub

Image generation

The gateway serves the OpenAI Images API at POST /v1/images/generations. The OpenAI SDK's client.images.generate(...) works unchanged against the https://app.inferencehub.tech/v1 base.

curl https://app.inferencehub.tech/v1/images/generations \
-H "Authorization: Bearer sk-prov-live-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"prompt": "flat minimalist vector logo of an orange fox head, white background",
"size": "1024x1024",
"quality": "low"
}'

The image comes back inline as base64 in .data[0].b64_json (there is no url variant) — decode straight to a file: jq -r '.data[0].b64_json' | base64 -d > image.png.

Models & cost

Two models are live, billed per-token at the native published rates like every other model here: gpt-image-2 ($5.00/1M text-input, $30.00/1M image-output tokens) and gpt-image-1.5 ($5.00/1M in, $10.00/1M out). Cost scales with size and quality (low / medium / high / auto) — the low-quality 1024×1024 example above bills about $0.006.

  • Sizes: 1024x1024, 1536x1024, 1024x1536, or auto — larger concrete sizes are rejected.
  • Up to 4 images per request (n).
  • Non-streaming only — omit stream.
  • Generation only for now: /v1/images/edits and variations are not yet available.