API Reference
Images
Generate images from text prompts using DALL-E and other supported image generation models through the OpenAI-compatible endpoint.
Endpoint
http
POST https://api.onerouter.app/v1/images/generationsRequest Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Model ID (e.g., dall-e-3, dall-e-2) |
| prompt | string | Yes | Text description of the desired image (max 4000 chars for DALL-E 3) |
| n | integer | No | Number of images to generate. Default: 1 |
| size | string | No | Image resolution: 256x256, 512x512, 1024x1024, 1792x1024, 1024x1792 |
| quality | string | No | "standard" or "hd" (DALL-E 3 only) |
| response_format | string | No | "url" (default) or "b64_json" |
| style | string | No | "vivid" (default) or "natural" (DALL-E 3 only) |
Example
python
from openai import OpenAI
client = OpenAI(
api_key="sk-your-key",
base_url="https://api.onerouter.app/v1",
)
response = client.images.generate(
model="dall-e-3",
prompt="A serene mountain lake at sunset, digital art style",
n=1,
size="1024x1024",
)
print(response.data[0].url)Available Models
Supported image generation models include DALL-E 3, DALL-E 2, and other provider-specific image models. See the Models page for the current model availability and pricing.