Skip to main content
The Nexus Image Generation endpoint lets you create AI-generated images directly from a text description. You specify what the image should contain and optionally control the visual style, output dimensions, and how many images to produce in a single request. The API returns a list of image URLs hosted on the Verbosec CDN that you can download or embed immediately. Endpoint
POST https://api.verbosec.com/v1/image/generate

Request parameters

prompt
string
required
A text description of the image you want to generate. The more descriptive and specific your prompt, the more accurately the output will reflect your intent.
style
string
The visual style applied to the generated image. Accepted values are "photorealistic", "illustration", and "abstract". Defaults to "photorealistic".
size
string
The pixel dimensions of the output image. Accepted values are "512x512", "1024x1024", and "1024x1792". Defaults to "1024x1024". Choose "1024x1792" for portrait-format images.
count
integer
The number of images to generate in this request. Accepts an integer between 1 and 4 inclusive. Defaults to 1. Each image consumes tokens separately.

Example request

generate-image.sh
curl -X POST https://api.verbosec.com/v1/image/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A sunlit mountain lake at dawn with mist rising off the water",
    "style": "photorealistic",
    "size": "1024x1024",
    "count": 2
  }'

Example response

response.json
{
  "id": "img_xyz789",
  "images": [
    {
      "url": "https://cdn.verbosec.com/images/img_xyz789_1.png",
      "size": "1024x1024"
    },
    {
      "url": "https://cdn.verbosec.com/images/img_xyz789_2.png",
      "size": "1024x1024"
    }
  ],
  "created_at": "2025-01-15T10:31:00Z"
}

Response fields

id
string
A unique identifier for this image generation request.
images
array
An array of image objects, one for each image generated. The length of this array matches the count value you specified in the request.
created_at
string
An ISO 8601 timestamp indicating when the images were generated.
Image URLs are available for 24 hours after generation. If you need to retain the images beyond that window, download them to your own storage immediately after the request completes.

Error responses

Returned when the prompt field is missing or a parameter value falls outside its accepted range (for example, count: 5).
400-response.json
{
  "error": {
    "code": "invalid_parameter",
    "message": "The 'count' parameter must be between 1 and 4."
  }
}
Returned when your API key is missing or invalid. See the Authentication guide for help.
401-response.json
{
  "error": {
    "code": "unauthorized",
    "message": "Invalid or missing API key."
  }
}
Returned when you have exceeded your plan’s rate limit. Check the Retry-After header and wait before resending the request.
429-response.json
{
  "error": {
    "code": "rate_limit_exceeded",
    "message": "You have exceeded your plan's rate limit. Please wait before retrying."
  }
}