Image Generation — OneHub

Generate images via Replicate (FLUX) or OpenAI (GPT Image 2).

Docs Docs Quick Start Authentication SDK Setup Available Models Rate Limits Chat Completions Streaming List Models Embeddings Image Generation Text to Speech Speech to Text Billing & Wallet Webhooks Errors

Image Generation

POST https://www.onehub.design/v1/images/generations

Request

curl https://www.onehub.design/v1/images/generations \
  -H "Authorization: Bearer sk-onehub-xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "bfl/flux-2-klein-4b",
    "prompt": "A futuristic city at sunset, cinematic"
  }'

Response

{
  "created": 1730000000,
  "data": [
    {
      "url": "https://replicate.delivery/pbxt/abc123.png"
    }
  ]
}

Parameters

FieldTypeDescription
modelstringbfl/flux-2-klein-4b or openai/gpt-image-2
promptstringText prompt describing the image
sizestringe.g. 1024x1024, 1024x1536 (model-dependent)
nnumberNumber of images to generate (1–4, model-dependent)
qualitystringe.g. standard or high (GPT Image 2)