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 ErrorsImage 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
| Field | Type | Description |
|---|---|---|
model | string | bfl/flux-2-klein-4b or openai/gpt-image-2 |
prompt | string | Text prompt describing the image |
size | string | e.g. 1024x1024, 1024x1536 (model-dependent) |
n | number | Number of images to generate (1–4, model-dependent) |
quality | string | e.g. standard or high (GPT Image 2) |