POST /v1/image/generate
Synchronous JSON. Same Bearer auth as chat. Use a live image model from GET /v1/models.
Two paths hit the same job pipeline. Both return base64 in images[]. Neither returns a hosted URL.
Request
PZERO / Venice-shaped generate job. Typical fields: model, prompt, plus optional resolution, quality, aspect_ratio, variants (1–4). You can also send n (1–4); it maps to variants. Do not send conflicting variants and n.
bash
curl -sS -X POST "https://api.pzero.studio/v1/image/generate" \
-H "Authorization: Bearer pzero_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "<live-image-model-id>",
"prompt": "a red balloon over the harbour"
}'POST /v1/images/generations
OpenAI-compatible request path for the same pipeline. Prefer n (1–4) instead of variants. The response is still Venice JSON with base64 in images[], not OpenAI { "data": [{ "url": "..." }] }.
bash
curl -sS -X POST "https://api.pzero.studio/v1/images/generations" \
-H "Authorization: Bearer pzero_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "<live-image-model-id>",
"prompt": "a red balloon over the harbour"
}'Response
Success is synchronous JSON. images[] holds base64-encoded image data (one entry per variant). Decode client-side. WebP unless you set format. Output is forced to JSON (return_binary=false upstream).
On success the response also carries X-Pzero-Cost-Usdc, X-Pzero-Clearing-Price-Cents, and X-Balance-Remaining.
Billing is a flat job from published image pricing, settled like other inference against confirmed balance and eligible supply. Models with resolution/quality matrices need a published tier; a missing or unpublished tier is 400.
Generated images carry the upstream provider's watermark unless you ask otherwise. Send hide_watermark: true to get an unmarked image. It costs the same, since price comes from resolution, quality, and variant count. PZERO forwards fields it does not price straight through to the provider, so provider options like hide_watermark, safe_mode, format, seed, and steps behave as documented upstream and keep their upstream defaults when you omit them. The exception is enable_web_search, rejected because it bills beyond published pricing.
Common failures: 400 (bad body or unpublished tier), 401, 402, 404 (model), 429 (buyer_concurrency_limit: one in-flight image job per wallet), 500 (settle_failed, not charged), 502 (upstream), 503. See Errors.