Image Generation
POST
https://api.oneinfer.ai/v1/ula/generate-imageGenerate stunning visuals from text descriptions using advanced models like GPT Image and FLUX, or edit pictures you send. Unified access via a single, standard completions interface.
Request parameters
Core parameters
modelstringrequiredThe image model, by its name in the model catalog (e.g. "blackforestlabs/flux-2-pro", "Bria/erase"). OneInfer picks the provider that serves it.
promptstringWhat to make or change. You can send it as
messages in chat format instead. Tools that only take a picture, such as Bria/remove_background and Bria/erase, need no prompt; the model's pricing rows say so in prompt_input.Input images
filesfileInput images as
multipart/form-data uploads. Repeat the field once per image.image_urlsstring[]Input images as https URLs, sent as a JSON array. Uploads come first, then URLs, each in the order sent.
Order matters. Where a model's input_image_labels are ["Image", "Mask"] (Bria/erase, Bria/gen_fill, Bria/fibo_edit), send the picture first and the mask second. min_input_images and max_input_images say how many images the model takes.
Image properties
sizestringImage dimensions (e.g., '1024x1024', '1024x1792'). Some models take labels such as '1MP'; the model's pricing rows list them in supported_sizes.
qualitystringRendering quality, where the model offers a choice (e.g. 'standard', 'high'). The model's pricing rows list them in supported_qualities.
numberintegerNumber of independent generations.
Text-to-image example: generate a detailed architectural render
{
"model": "openai/gpt-image-2.5-flare",
"messages": [
{
"role": "user",
"content": "A Bauhaus style villa in a lush forest, architectural photography."
}
],
"size": "1024x1024",
"quality": "high",
"number": 1
}Edit example: erase the masked area (the picture first, then the mask)
curl -X POST https://api.oneinfer.ai/v1/ula/generate-image \
-H "Authorization: Bearer <YOUR_TOKEN>" \
-F "model=Bria/erase" \
-F "files=@/path/to/photo.png" \
-F "files=@/path/to/mask.png"Response
JSON
{
"id": "img_12345abcde",
"created": 1711468800,
"images": [
{
"url": "https://media.oneinfer.ai/i/gen_987.png",
"revised_prompt": "A clean, Bauhaus-style villa..."
}
],
"provider": "openai",
"model": "dall-e-3"
}Speech-to-Text (Transcriptions)
Transcription has its own endpoint, Audio transcription, which takes the audio as a multipart/form-data upload rather than a chat-style JSON body. Speech-to-text models such as openai/whisper-large-v3-turbo are listed in the model catalog.
Error status codes
| Code | Status | Description |
|---|---|---|
200 | OK | Image generated successfully. |
400 | Bad Request | Invalid request body or unsupported model. |
401 | Unauthorized | Missing or invalid Authorization header / Bearer token. |
403 | Forbidden | Insufficient credit balance. |
422 | Unprocessable Entity | Request body failed schema validation. |
500 | Internal Server Error | Unexpected error during image generation. |