POST /v1/generate — Generate Images via API
POST /v1/generate — Generate Images via API
Generate AI images from text prompts using Artnex’s model lineup. Choose from 8 models, control dimensions, and get URLs back in seconds.
POST
POST /v1/generate — Generate Images via API
TheDocumentation Index
Fetch the complete documentation index at: https://docs.artnex.app/llms.txt
Use this file to discover all available pages before exploring further.
/v1/generate endpoint converts a text prompt into one or more images using your chosen AI model. Send a prompt and model name; receive a list of image URLs you can use immediately or store for later.
Endpoint
Request parameters
The text description of the image you want to generate. Be specific — more detail leads to better results. Maximum 4,000 characters.
The AI model to use for generation. Must be one of the supported model IDs listed in the Models section below.
Image width in pixels. Accepted values depend on the model. Defaults to
1024 for most models.Image height in pixels. Accepted values depend on the model. Defaults to
1024 for most models.Number of images to generate in a single request. Accepted range:
1–4. Each image costs the full per-model credit amount.Response fields
true when the request completed successfully.Array of generated image objects. Each object contains a
url field with a CDN-hosted link to the image.Unique identifier for this request, useful for support queries or logging.
Total credits deducted from your account balance for this request.
Models
Choose the model that fits your quality and budget requirements:| Model ID | Credits per image | Description |
|---|---|---|
z-image-turbo | 100 | Fast, affordable generation for prototyping |
artsyn-light | 240 | Balanced quality and speed |
flux-2-pro | 250 | High-quality professional output |
seedream-v4 | 200 | Bytedance Seedream v4 |
seedream-v4.5 | 800 | Higher-fidelity Seedream output |
nano-banana-pro | 800 | Premium generation with fine detail |
nano-banana-pro-ultra | 1,000 | Ultra-high-resolution (up to 8K) output |
gpt-image-2 | Varies | OpenAI GPT-Image-2; credits vary by resolution and quality |
gpt-image-2 uses dynamic pricing based on resolution (1k, 2k, 4k) and quality (low, medium, high). Pass resolution and quality fields alongside the standard parameters when using this model.Example requests
Example response
Error codes
| HTTP status | Error code | Cause |
|---|---|---|
400 | missing_prompt | The prompt field is absent or empty |
400 | invalid_model | The model value is not a supported model ID |
400 | invalid_dimensions | width or height is outside the allowed range for the selected model |
401 | invalid_api_key | The API key is missing, malformed, or revoked |
402 | insufficient_credits | Your account does not have enough credits to complete the request |
429 | rate_limit_exceeded | You have exceeded your plan’s daily request quota |