API ReferenceOpenAI Compatible
Images
DALL-E API - Generate images from text prompts through UniterRouter. Access DALL-E 3, Stable Diffusion, Midjourney-style image generation with unified API.
Images
Create images from text descriptions using various image generation models.
Endpoint
POST https://api.uniterouter.ai/v1/images/generationsRequest Body
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | ID of the image model to use |
prompt | string | Yes | Text description of the desired image |
n | integer | No | Number of images to generate (default: 1) |
size | string | No | Image dimensions (e.g., 1024x1024) |
quality | string | No | Image quality: standard or hd |
style | string | No | Style: natural or vivid |
response_format | string | No | url (default) or b64_json |
Supported Models
| Model | Provider | Sizes | Features |
|---|---|---|---|
dall-e-3 | OpenAI | 1024x1024, 1792x1024, 1024x1792 | HD quality, styles |
dall-e-2 | OpenAI | 256x256, 512x512, 1024x1024 | Multiple images |
flux-pro | Black Forest Labs | Various | High quality |
flux-schnell | Black Forest Labs | Various | Fast generation |
Example Request
curl https://api.uniterouter.ai/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $UNITEROUTER_API_KEY" \
-d '{
"model": "dall-e-3",
"prompt": "A serene Japanese garden with cherry blossoms",
"size": "1024x1024",
"quality": "hd"
}'from openai import OpenAI
client = OpenAI(
base_url="https://api.uniterouter.ai/v1",
api_key="your_api_key",
)
response = client.images.generate(
model="dall-e-3",
prompt="A serene Japanese garden with cherry blossoms",
size="1024x1024",
quality="hd",
n=1
)
image_url = response.data[0].url
print(f"Generated image: {image_url}")import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.uniterouter.ai/v1",
apiKey: process.env.UNITEROUTER_API_KEY,
});
const response = await client.images.generate({
model: "dall-e-3",
prompt: "A serene Japanese garden with cherry blossoms",
size: "1024x1024",
quality: "hd",
n: 1,
});
console.log(`Generated image: ${response.data[0].url}`);Response
{
"created": 1706123456,
"data": [
{
"url": "https://...",
"revised_prompt": "A tranquil Japanese garden featuring delicate pink cherry blossoms..."
}
]
}Size Options
DALL-E 3
| Size | Aspect Ratio | Use Case |
|---|---|---|
1024x1024 | 1:1 | Square, general purpose |
1792x1024 | 16:9 | Landscape, headers |
1024x1792 | 9:16 | Portrait, mobile |
Quality & Style
- Quality:
standard(faster) orhd(more detail) - Style:
natural(realistic) orvivid(dramatic)
Note: Image URLs from DALL-E are temporary and expire after ~1 hour. Download images promptly or use b64_json format.
How is this guide?
Embeddings POST
OpenAI Embeddings API - Generate text-embedding-3-large, ada-002 vectors through UniterRouter. Build semantic search, RAG applications with unified embedding API.
Audio POST
OpenAI Whisper API - Speech-to-text transcription through UniterRouter. Convert audio to text with GPT-4 level accuracy, supports multiple languages and formats.