Image Generation

POSThttps://api.oneinfer.ai/v1/ula/generate-image

Generate 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

modelstringrequired
The image model, by its name in the model catalog (e.g. "blackforestlabs/flux-2-pro", "Bria/erase"). OneInfer picks the provider that serves it.
promptstring
What 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

filesfile
Input 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

sizestring
Image dimensions (e.g., '1024x1024', '1024x1792'). Some models take labels such as '1MP'; the model's pricing rows list them in supported_sizes.
qualitystring
Rendering quality, where the model offers a choice (e.g. 'standard', 'high'). The model's pricing rows list them in supported_qualities.
numberinteger
Number 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

CodeStatusDescription
200OKImage generated successfully.
400Bad RequestInvalid request body or unsupported model.
401UnauthorizedMissing or invalid Authorization header / Bearer token.
403ForbiddenInsufficient credit balance.
422Unprocessable EntityRequest body failed schema validation.
500Internal Server ErrorUnexpected error during image generation.

Response

202 - application/json