Skip to main content

Endpoint

POST https://api.omniakey.com/v1/images/generations
This endpoint is compatible with the OpenAI Images API. Generate images from text descriptions using multiple providers.

Request Examples

from openai import OpenAI

client = OpenAI(
    api_key="your-omniakey-api-key",
    base_url="https://api.omniakey.com/v1"
)

response = client.images.generate(
    model="dall-e-3",
    prompt="A serene mountain landscape at sunset, digital art style",
    n=1,
    size="1024x1024",
    quality="hd"
)

print(response.data[0].url)

Response

{
  "created": 1709251200,
  "data": [
    {
      "url": "https://api.omniakey.com/files/img-abc123.png",
      "revised_prompt": "A breathtaking mountain landscape bathed in the warm golden light of sunset..."
    }
  ]
}

Response with Base64

When response_format is set to b64_json:
{
  "created": 1709251200,
  "data": [
    {
      "b64_json": "iVBORw0KGgoAAAANSUhEUgAA..."
    }
  ]
}

Request Parameters

model
string
required
The model ID to use. Options: dall-e-3, dall-e-2, stable-diffusion-3, flux-1-pro, midjourney-v6.
prompt
string
required
A text description of the desired image. Maximum length varies by model (DALL-E 3 supports up to 4000 characters).
n
integer
Number of images to generate. Range: 1-10. Default: 1. Note: DALL-E 3 only supports n=1.
size
string
Image dimensions. Options depend on the model:
  • DALL-E 3: 1024x1024, 1024x1792, 1792x1024
  • DALL-E 2: 256x256, 512x512, 1024x1024
  • Stable Diffusion 3: 1024x1024, 768x1024, 1024x768
Default: 1024x1024.
quality
string
Image quality. Options: standard, hd. Default: standard. Only supported by DALL-E 3.
style
string
Image style. Options: vivid, natural. Default: vivid. Only supported by DALL-E 3.
response_format
string
Response format. Options: url, b64_json. Default: url. URLs expire after 1 hour.

Supported Models

ModelProviderMax ResolutionFeatures
DALL-E 3OpenAI1792x1024HD quality, style control, prompt revision
DALL-E 2OpenAI1024x1024Batch generation (up to 10)
Stable Diffusion 3Stability AI1024x1024Fine-grained control, negative prompts
FLUX.1 ProBlack Forest Labs1024x1024Photorealistic output
Midjourney V6Midjourney1024x1024Artistic style, high aesthetics

View All Models

See the complete list