Create Image
POST
/v1/images/generationsCreates an image given a prompt
For coding agents, choose a model from
GET /v1/models, then send the selectedmodelexplicitly to this endpoint.
Request Body
Parameter model
Model to use (e.g., dall-e-3, gpt-image-1.5, flux-1.1-pro).
Parameter prompt
Text description of the desired image.
Parameter n
Number of images to generate (1-4, model dependent).
Parameter size
Image size. Options vary by model:
- DALL-E 3:
1024x1024,1792x1024,1024x1792 - Other models:
512x512,1024x1024, etc.
Parameter quality
Image quality (standard or hd). DALL-E 3 only.
Parameter response_format
Response format: url or b64_json.
Parameter style
Style for DALL-E 3: vivid or natural.
Parameter user
A unique identifier for the end-user.
Response
Inline Response
Response Field created
Unix timestamp of creation.
Response Field data
Array of generated images.
Each object contains:
url(string): URL of the generated imageb64_json(string): Base64-encoded image (if requested)revised_prompt(string): The prompt used (DALL-E 3)
Request Example
curl -X POST "https://api.anypath.dev/v1/images/generations" \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "dall-e-3",
"prompt": "A white cat sitting on a windowsill watching rain",
"size": "1024x1024",
"quality": "standard",
"n": 1
}'
from openai import OpenAI
client = OpenAI(
api_key="sk-your-api-key",
base_url="https://api.anypath.dev/v1"
)
response = client.images.generate(
model="dall-e-3",
prompt="A white cat sitting on a windowsill watching rain",
size="1024x1024",
quality="standard",
n=1
)
print(response.data[0].url)
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: 'sk-your-api-key',
baseURL: 'https://api.anypath.dev/v1'
});
const response = await client.images.generate({
model: 'dall-e-3',
prompt: 'A white cat sitting on a windowsill watching rain',
size: '1024x1024',
quality: 'standard',
n: 1
});
console.log(response.data[0].url);
<?php
$ch = curl_init('https://api.anypath.dev/v1/images/generations');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Authorization: Bearer sk-your-api-key'
],
CURLOPT_POSTFIELDS => json_encode([
'model' => 'dall-e-3',
'prompt' => 'A white cat sitting on a windowsill watching rain',
'size' => '1024x1024',
'quality' => 'standard',
'n' => 1
])
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
echo $data['data'][0]['url'];
Response Example
{
"created": 1706000000,
"data": [
{
"url": "https://...",
"revised_prompt": "A fluffy white cat with bright eyes sitting peacefully on a wooden windowsill, watching raindrops stream down the glass window..."
}
]
}
Available Models
The image-capable models available to your key change with route supply. Current examples:
| Model | Provider family | Notes |
|---|---|---|
dall-e-3 | OpenAI | Prompt revision; supports quality and style |
gpt-image-1.5 | OpenAI | Current OpenAI image generation and edits |
gemini-2.5-flash-image | Gemini | Gemini image generation |
grok-4-image | xAI | xAI image generation |
flux-1.1-pro | Aggregate gateways | Provider-qualified mapping |
Call GET /v1/models with your API key for the exact models currently available to you.