You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ClawRouter handles x402 payments automatically. Start it with openclaw gateway start, then call localhost:8402 directly.
curl -X POST http://localhost:8402/v1/images/generations \
-H "Content-Type: application/json" \
-d '{"model":"zai/cogview-4","prompt":"a futuristic city at night","size":"1024x1024"}'
Open the returned URL directly:
URL=$(curl -s -X POST http://localhost:8402/v1/images/generations \ -H "Content-Type: application/json" \ -d '{"model":"google/nano-banana","prompt":"your prompt here","size":"1024x1024"}' \| python3 -c "import sys,json; print(json.load(sys.stdin)['data'][0]['url'])")
open "$URL"# macOS
xdg-open "$URL"# Linux
Direct API (cURL)
curl -X POST https://blockrun.ai/api/v1/images/generations \
-H "Content-Type: application/json" \
-H "X-Payment: $PAYMENT_HEADER" \
-d '{ "model": "zai/cogview-4", "prompt": "a minimalist logo for an AI company", "size": "1024x1024" }'
Python
fromblockrun_llmimportImageClientclient=ImageClient()
# CogView-4 (cheapest, supports Chinese prompts)result=client.generate(
"一个未来城市的夜景",
model="zai/cogview-4",
size="1344x768"
)
print(result.data[0].url)
# DALL-E 3result=client.generate(
"A futuristic AI robot",
model="openai/dall-e-3",
size="1024x1024"
)
print(result.data[0].url)
TypeScript
import{ImageClient}from'@blockrun/llm';constclient=newImageClient();// CogView-4constresult=awaitclient.generate('a futuristic city at night',{model: 'zai/cogview-4',size: '1344x768',});console.log(result.data[0].url);// DALL-E 3constresult2=awaitclient.generate('A futuristic AI robot',{model: 'openai/dall-e-3',size: '1024x1024',});console.log(result2.data[0].url);
Pricing
Model
Size
Price
CogView-4
up to 1440x1440
$0.015
CogView-4
1440x1440
$0.02
DALL-E 3 Standard
1024x1024
$0.042
DALL-E 3 Wide
1792x1024
$0.084
GPT Image 1
1024x1024
$0.021
Nano Banana
1024x1024
$0.053
Nano Banana Pro
1024x1024
$0.105
Nano Banana Pro 4K
4096x4096
$0.158
Error Codes
Code
Description
400
Invalid request (bad prompt or parameters)
402
Payment required (insufficient balance)
403
Content policy violation
429
Rate limit exceeded
500
Server error
Model Selection Guide
Use Case
Recommended
Cheapest
zai/cogview-4
Chinese prompts
zai/cogview-4
Highest quality
google/nano-banana-pro
Fast & reliable
google/nano-banana
Best prompt following
openai/dall-e-3
Image editing (img2img)
openai/gpt-image-1
OpenAI Compatibility
This endpoint is compatible with OpenAI's Images API: