venice-image-generate
This skill provides two endpoints for text-to-image generation on the Venice AI platform: a Venice-native API offering full control over parameters like negative prompts, CFG scale, and up to four variants, and an OpenAI-compatible endpoint for seamless SDK migration. Use it when generating images from text prompts, producing multiple image variants simultaneously, or replacing OpenAI's image generation without code changes. The skill also includes a style presets endpoint for browsing available style options before requests.
git clone --depth 1 https://github.com/veniceai/skills /tmp/venice-image-generate && cp -r /tmp/venice-image-generate/skills/venice-image-generate ~/.claude/skills/venice-image-generateSKILL.md
# Venice Image Generation
Two text-to-image endpoints:
1. **`POST /api/v1/image/generate`** — Venice-native, full control (negative prompts, CFG, seed, up to 4 variants).
2. **`POST /api/v1/images/generations`** — OpenAI-compatible, fewer knobs but drop-in for the OpenAI SDK.
Plus:
- **`GET /api/v1/image/styles`** — list of style preset names for `style_preset`.
For editing / upscaling / multi-image / background removal, see [`venice-image-edit`](../venice-image-edit/SKILL.md).
## Use when
- You need to generate images from text prompts.
- You need multiple variants in one call.
- You're porting from OpenAI's `images.generate` and want a zero-change SDK swap.
- You want to browse style presets before committing to one.
## `/image/generate` — Venice-native
### Request
```bash
curl https://api.venice.ai/api/v1/image/generate \
-H "Authorization: Bearer $VENICE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "z-image-turbo",
"prompt": "A beautiful sunset over a mountain range",
"width": 1024,
"height": 1024,
"cfg_scale": 7.5,
"steps": 8,
"seed": 123456789,
"variants": 1,
"format": "webp",
"style_preset": "3D Model",
"safe_mode": true
}'
```
### Fields
| Field | Type | Default | Notes |
|---|---|---|---|
| `model` | string | — | **Required.** Image model ID. `GET /models?type=image`. |
| `prompt` | string | — | **Required.** Max `promptCharacterLimit` from the model's `model_spec.constraints` (typically 1500–7500). |
| `negative_prompt` | string | — | Describe what *not* to show. Same character cap as prompt. |
| `width`, `height` | int | 1024, 1024 | ≤ 1280 each. Must be divisible by `constraints.widthHeightDivisor` on the model's `model_spec`. |
| `aspect_ratio` | string | — | `"1:1"`, `"16:9"`, `"9:16"`, … — used by models like Nano Banana instead of width/height. |
| `resolution` | string | — | `"1K"`, `"2K"`, `"4K"` — used by resolution-driven models. |
| `cfg_scale` | number | model default | 0 < x ≤ 20. Higher = more prompt adherence. |
| `steps` | int | 8 | Inference steps. Some models ignore it (e.g. Turbo). |
| `seed` | int | 0 | `-999999999..999999999`. Use `0`/omit for random. |
| `variants` | int | 1 | 1–4. Only if `return_binary: false`. |
| `lora_strength` | int | — | 0–100 when model uses Loras. |
| `style_preset` | string | — | Value from `GET /image/styles`. |
| `format` | `"webp"`/`"png"`/`"jpeg"` | `webp` | Response image format. |
| `return_binary` | bool | `false` | `true` → binary `image/*` response; `false` → JSON with base64. |
| `embed_exif_metadata` | bool | `false` | Embed prompt info in EXIF. |
| `hide_watermark` | bool | `false` | Venice may still watermark certain content. |
| `safe_mode` | bool | `true` | Blurs adult content. |
| `enable_web_search` | bool | `false` | Only some models. Charges extra. |
| `inpaint` | — | — | **Deprecated** since May 19 2025. A new inpaint API is forthcoming. |
### Response (JSON, `return_binary: false`)
```json
{
"id": "...",
"images": ["<base64>", "<base64>"],
"timing": {...},
"request": {...}
}
```
With `return_binary: true`, response is raw `image/webp` (or `png`/`jpeg`) with matching `Content-Type`.
## `/images/generations` — OpenAI-compatible
Use this if you're already on the OpenAI SDK. Field names match `openai.images.generate()`.
```ts
import OpenAI from 'openai'
const client = new OpenAI({
apiKey: process.env.VENICE_API_KEY,
baseURL: 'https://api.venice.ai/api/v1',
})
const res = await client.images.generate({
model: 'z-image-turbo',
prompt: 'A beautiful sunset over mountain ranges',
size: '1024x1024',
response_format: 'b64_json',
})
const b64 = res.data[0].b64_json
```
### Mapped fields
| Field | Values | Notes |
|---|---|---|
| `model` | string, default `"default"` | Unknown model IDs fall back to Venice's default. |
| `prompt` | string, ≤ 1500 chars | Required. |
| `size` | `auto`, `256x256`, `512x512`, `1024x1024`, `1536x1024`, `1024x1536`, `1792x1024`, `1024x1792` | — |
| `output_format` | `jpeg` / `png` / `webp` | Defaults to `png`. |
| `response_format` | `b64_json` / `url` | `url` returns a `data:` URL (not a hosted URL). |
| `moderation` | `auto` (safe mode on) / `low` (safe mode off) | — |
| `n` | `1` | Venice only supports a single image per call here. |
| `quality`, `style` (`vivid`/`natural`), `background`, `output_compression`, `user` | — | Accepted for OpenAI compat, not used by Venice. |
If you need `variants`, `seed`, `negative_prompt`, `cfg_scale`, or `style_preset`, switch to `/image/generate`.
## `/image/styles` — list presets
```bash
curl https://api.venice.ai/api/v1/image/styles \
-H "Authorization: Bearer $VENICE_API_KEY"
```
Returns a list of `styles[]`, each with a `name` you can pass to `style_preset`. Cache this — it's small and stable.
## Choosing a model
```bash
curl "https://api.venice.ai/api/v1/models?type=image" \
-H "Authorization: Bearer $VENICE_API_KEY"
```
Inspect per-model `model_spec`:
- `constraints.widthHeightDivisor` — `width` and `height` must both be divisible by this.
- `constraints.aspectRatios[]` + `defaultAspectRatio` — if present, the model supports aspect-ratio-driven sizing.
- `constraints.resolutions[]` + `defaultResolution` — if present, the model supports `resolution` (`1K`/`2K`/`4K`).
- `constraints.steps.{default,max}` — step bounds (some models ignore `steps` entirely).
- `constraints.promptCharacterLimit` — max prompt length (also applies to `negative_prompt`).
- `pricing.generation.usd` — flat USD per image, or `pricing.resolutions[].usd` for resolution-tiered models.
Pick a model that matches the **feature + size combo** you plan to use.
## Common patterns
### Fixed-seed A/B test
```json
{"model": "z-image-turbo", "prompt": "...", "seed": 42, "variants": 4}
```
### Aspect-ratio-driven model (Nano Banana family)
```json
{"model": "nano-banana-2", "prompt": "...", "aspect_ratio": "16:9", "resolution": "2K"}
```
(Other nano-banana variManage Venice API keys. Covers GET/POST/PATCH/DELETE /api_keys, GET /api_keys/{id}, GET /api_keys/rate_limits, GET /api_keys/rate_limits/log, the two-step /api_keys/generate_web3_key wallet flow, INFERENCE vs ADMIN key types, and per-key consumption limits (USD / DIEM).
High-level map of the Venice.ai API - base URL, authentication modes, endpoint categories, response headers, pricing model, error shape, and versioning. Load this first when starting any Venice integration.
Async music / audio-track generation via Venice. Covers the /audio/quote + /audio/queue + /audio/retrieve + /audio/complete lifecycle, lyrics vs instrumental, voice selection, duration, language, speed, model capability probing, and webhook-free polling.
Generate speech from text via POST /audio/speech. Covers TTS models (Kokoro, Qwen 3, xAI, Inworld, Chatterbox, Orpheus, ElevenLabs Turbo, MiniMax, Gemini Flash), voices per family, output formats (mp3/opus/aac/flac/wav/pcm), streaming, prompt/emotion styling, temperature/top_p, and language hints.
Transcribe audio files to text via POST /audio/transcriptions. Covers supported models (Parakeet, Whisper, Wizper, Scribe, xAI STT), supported formats (wav/flac/m4a/aac/mp4/mp3/ogg/webm), response formats (json/text), timestamps, and language hints. OpenAI-compatible multipart.
Venice augmentation endpoints for agent pipelines. Covers POST /augment/text-parser (extract text from PDF/DOCX/XLSX/plain text, multipart, up to 25MB, JSON or plain text response), POST /augment/scrape (fetch a URL and return markdown; blocks X/Reddit), and POST /augment/search (Brave ZDR or anonymized Google; structured title/url/content/date results, up to 20 per query). Privacy (zero data retention), rate limits, and error shapes.
Authenticate to the Venice API with a Bearer API key or with an x402 / SIWE wallet. Covers header formats, the SIWE message fields, TTL and nonce rules, the venice-x402-client SDK, and how to choose between the two modes.
Venice billing and usage analytics - GET /billing/balance, GET /billing/usage (paginated per-request ledger, JSON or CSV), and GET /billing/usage-analytics (aggregated by date/model/key). Covers the DIEM/USD/BUNDLED_CREDITS consumption priority and building dashboards. (Beta)