For the complete documentation index, see llms.txt. This page is also available as Markdown.

Generate images

Start generating one or more images from a prompt and an image type for the specified WordPress installation.

Generate images

post

Start generating one or more images from a prompt and an image type for the specified WordPress installation. The generation runs asynchronously: the response is returned right away with status: in-progress and a generation_id. Poll GET /api/hosting/v1/accounts/{username}/wordpress/{software}/content/generations/{generation_id} every few seconds until status is completed or failed.

A completed generation returns temporary image URLs together with the time they expire; download the images before then. Images match the requested aspect ratio and are never smaller than the requested size; logos are transparent images cropped to the mark.

Only one image generation can run per installation at a time: while one is still in progress the endpoint returns 409 without the ID of the running generation, so a caller that did not receive the 202 has to wait for it to finish (up to a few minutes) before starting a new one. The endpoint is limited to 10 requests per minute.

Provide the WordPress installation (software) identifier in the path. It can be obtained from GET /api/hosting/v1/wordpress/installations (the id field).

Authorizations
AuthorizationstringRequired

API Token authentication

Path parameters
usernamestringRequiredExample: u123456789
softwarestringRequired

WordPress installation (software) identifier

Example: 1232456789Pattern: ^[0-9]+$
Body

Generate images from a prompt and an image type

promptstring · min: 3 · max: 2500Required

What the image should show. For the logo type, the wordmark and mark to render.

Example: A cozy artisan bakery interior at sunrise with fresh bread on wooden shelves
image_typestring · enumRequired

Kind of image to generate. It sets the default size and cropping.

Example: heroPossible values:
num_of_imagesinteger · min: 1 · max: 10Optional

How many images to generate

Default: 1Example: 1
widthinteger · min: 128 · max: 2048 · nullableOptional

Output width in pixels. Defaults per image type and is ignored for the logo type.

Example: 1200
heightinteger · min: 128 · max: 2048 · nullableOptional

Output height in pixels. Defaults per image type and is ignored for the logo type.

Example: 675
stylestring · max: 500 · nullableOptional

Style tokens appended to photographic prompts. Ignored for the logo type.

Example: Warm 35mm film photography, soft grain
color_guidancestring · max: 500 · nullableOptional

Colour direction for the logo type only. It is not rendered as text.

Example: Deep navy and muted gold
Responses
202

Accepted response

application/json

State of an AI content generation and, once completed, its result.

generation_idstringRequired

Generation ID (UUID) used to poll for the result

Example: 9d4f8a1e-2b3c-4d5e-8f6a-7b8c9d0e1f2a
typestring · enumRequired

Kind of generation, determines the shape of result

Example: image-generationPossible values:
statusstring · enumRequired

in-progress while the generation is still running, completed once result is available, failed when the generation stopped without a result.

Example: in-progressPossible values:
resultany of · nullableRequired

Generated content, null until the status is completed. For image-generation it is the generated images object; for website-generation it is the generated website document.

or
object · Website generation documentOptionalExample: {"editor":"gutenberg","single_page":false,"home_page_id":"home","language":{"name":"en","code":"en"},"brand":{"name":"Kava House","tagline":"Weekly roasts from our counter"},"theme":[],"menu":[],"pages":[]}
post/api/hosting/v1/accounts/{username}/wordpress/{software}/content/images/generate
POST /api/hosting/v1/accounts/{username}/wordpress/{software}/content/images/generate HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 246

{
  "prompt": "A cozy artisan bakery interior at sunrise with fresh bread on wooden shelves",
  "image_type": "hero",
  "num_of_images": 1,
  "width": 1200,
  "height": 675,
  "style": "Warm 35mm film photography, soft grain",
  "color_guidance": "Deep navy and muted gold"
}
{
  "generation_id": "9d4f8a1e-2b3c-4d5e-8f6a-7b8c9d0e1f2a",
  "type": "image-generation",
  "status": "in-progress",
  "result": {
    "images": [
      {
        "url": "https://storage.googleapis.com/ai-images/hero-1.webp?X-Goog-Signature=abc123",
        "width": 1600,
        "height": 900,
        "content_type": "image/webp"
      }
    ],
    "expires_at": "2026-10-15T10:29:23+00:00"
  }
}

Last updated

Was this helpful?