RA2 Art Generator API
Generate images from text prompts with one POST request. Use the tester to confirm your key, then copy code or agent instructions into your codebase.
API Tester
Production endpoint{}
Real RA2 Output
Unretouched renders from the endpoint below, 1024x1024, one request each.




Need to change an existing image instead? The RA2 Image Editor takes an image plus a prompt and keeps identity and composition (style transfer, object edits), same 4 credit price. RA2 is also the default image model on OpenPaths (model: "auto-image" or "ra2").
Pricing & Credits
Cost Per Image
$0.04 USD
4 credits ($0.04) per image up to 1024x1024 · 12 credits ($0.12) per 2K image (up to 2048x2048, rendered then enhanced 2x)
Billing Policy
Success: Charged $0.04 (4 credits)
Failed: No charge
Only pay for successful generations
API Reference
POST /api/ra2-art-generator
Generate high-quality AI images from text descriptions. Alias: /api/ra2
Request Format
Send a POST request with a JSON body containing these parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | string | Required | Your API key for authentication. |
| prompt | string | Required | Text description of the image you want to generate. Be detailed for best results. Max 1000 characters. |
| size | string | Optional |
Size preset key. Default: "square".
Supported presets:
resolution is supplied.
|
| resolution | string | Optional | Explicit size in widthxheight format, multiples of 32 between 256 and 2048. Sizes up to about 1.1 megapixels (for example 1024x1024, 1360x768) render directly for 4 credits. Larger sizes are the 2K tier: RA2 renders the composition at half size, then a 2x enhancement pass restores fine detail at the requested size (2048x2048, 1536x1536, 2048x1536). 2K images cost 12 credits and take roughly twice as long. |
| num_images | integer | Optional | Number of images to generate, 1 to 4. Default: 1. Credits scale with the image count. |
| seed | integer | Optional | Fixes generation randomness for reproducible results. Omit for a random seed. |
Response Examples
Success Response (200 OK)
When your image is successfully generated, you'll receive:
{
"success": true,
"request_id": "ra2_1758500000_ab12cd34",
"image_url": "https://netwrckstatic.netwrck.com/static/uploads/ai/blog/new-art-tools-hero.webp",
"images": [
"https://netwrckstatic.netwrck.com/static/uploads/ai/blog/new-art-tools-hero.webp"
],
"prompt_used": "A futuristic city with flying cars and neon lights, hyperrealistic, 8k",
"final_prompt": "A futuristic city with flying cars and neon lights, hyperrealistic, 8k",
"credits_charged": 4,
"price_cents": 4
}
Error Responses
If something goes wrong, you'll receive one of these error responses:
401 Unauthorized
{
"error": "Authentication failed",
"status": 401
}
Check your API key is correct
402 Payment Required
{
"error": "Insufficient credits. Required: 4, Available: 0",
"status": 402
}
Add more credits to your account
400 Bad Request
{
"error": "Prompt is required",
"status": 400
}
Check your request parameters
502 Generation Error
{
"success": false,
"error": "Image generation failed. Please try again."
}
Try again in a moment
Pro Tips for Better Results
Prompt Writing
- Be specific and descriptive
- Include style keywords like "photorealistic", "digital art"
- Mention lighting: "golden hour", "studio lighting"
- Add composition: "close-up", "wide angle", "aerial view"
Size Selection
- 1024x1024 - Social media posts
- 1360x768 - Website banners
- 768x1360 - Mobile wallpapers
- 1152x864 - Presentations
Example Great Prompts
"A cozy coffee shop interior, warm lighting, vintage furniture, steam rising from coffee cup, photorealistic, highly detailed"
"Futuristic cyberpunk city at night, neon signs, rain-soaked streets, flying cars, blade runner style, cinematic lighting"
"Portrait of a wise old wizard, long white beard, blue robes, magical staff, fantasy art style, detailed character design"
Netwrck