POST/v1/images/generations
Generate one or more images from a text prompt. OpenAI-compatible wire shape — the openai SDKs work with a base_url swap to https://api.tokenfactory.omniva.com/v1.
Beta
Image generation is in Beta. Parameters and response shape may shift before GA.
#Authentication
Bearer token in the Authorization header. See Authentication for how to mint and rotate keys.
#Parameters
| Field | Type | Description |
|---|---|---|
modelrequired | string | ID of the image model to use. Browse the Image tab in Model Library for available IDs in your workspace. |
promptrequired | string | Text description of the desired image. Be specific — style cues, subject, composition, and lighting all influence output. |
n | integer | Number of images to generate. Some models cap this at 1. Default: 1 |
size | string | Pixel dimensions of the output, e.g. "1024x1024". Supported sizes vary by model — check the model card. Default: 1024x1024 |
response_format | string | Either "url" (hosted URL with a short TTL) or "b64_json" (base64-encoded bytes inline). Default: url |
Subject to drift
The image surface is evolving — model-specific parameters (style, quality, guidance scale) may appear here before they're documented. Open Playground to see the canonical parameter set for any image model in your workspace.
#Response
#Response fields
created— Unix timestamp of generation.data[].url— present whenresponse_format=url. Hosted URL with a short TTL — download promptly if you need to keep the image.data[].b64_json— present whenresponse_format=b64_json. Base64-encoded image bytes.
#Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_payload | model or prompt is missing, or size is unsupported by the model. |
| 401 | unauthorized | Missing or invalid Bearer token. |
| 404 | model_not_found | Unknown image model. |
| 429 | rate_limited | Rate limit or quota exceeded. |
| 503 | upstream_unavailable | No healthy upstream — retry with backoff. |
See Errors for the full error envelope and retry guidance.