Generate images
Flux 2, GPT Image, Midjourney V7, Seedream
Image generation is synchronous — you get the result URL in the response body. No polling needed.
Endpoint
POST /v1/imagesRequest
curl https://api.rlay.ai/v1/images \
-H "Authorization: Bearer $RLAY_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "flux-2",
"prompt": "a fox reading rust docs",
"size": "1024x1024",
"n": 1
}'Parameters
Prop
Type
Response
{
"data": [
{
"url": "https://cdn.rlay.ai/...",
"revised_prompt": "..."
}
],
"credits_used": 1.8
}Available models
| Model | Best for | Price |
|---|---|---|
flux-2 | Photorealistic, 2K | $0.018/img |
gpt-image | Text rendering, UI | $0.025/img |
midjourney-7 | Stylized, concept art | $0.030/img |
seedream-4 | Posters, CN scenarios | $0.012/img |
MkSaaS文档