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

Images

Generate images from image or text input.

Create image

post

Generate images from a text prompt.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
promptstringRequired

A text description of the desired image(s).

modelstringRequiredExample: GPT Image 2
ninteger · min: 1 · max: 10 · nullableOptional

The number of images to generate. Must be between 1 and 10.

Example: 1
qualitystring · enum · nullableOptional

The quality of the generated images. Supported values depend on the model: GPT Image models accept low, medium, high, and auto; standard and hd are DALL-E values and are rejected by GPT Image models.

Possible values:
response_formatstring · enum · nullableOptional

The format of the generated images. The currently available models (GPT Image, Imagen) ignore this parameter and always return base64-encoded images (b64_json); url only applies to models that support hosted image URLs.

Possible values:
sizestring · enum · nullableOptional

The size of the generated images. Supported values depend on the model: GPT Image models accept 1024x1024, 1536x1024, 1024x1536, and auto; the remaining values are DALL-E sizes.

Possible values:
stylestring · enum · nullableOptional

The style of the generated images. DALL-E parameter; accepted but ignored by GPT Image models.

Possible values:
Responses
200

Represents an image response returned by model, based on the provided input.

application/json
createdintegerRequired

The Unix timestamp (in seconds) of when the images were created.

backgroundstringOptional

The background setting of the generated images. Returned by GPT Image models.

output_formatstringOptional

The output format of the generated images. Returned by GPT Image models.

qualitystringOptional

The quality of the generated images. Returned by GPT Image models.

sizestringOptional

The size of the generated images. Returned by GPT Image models.

providerstringOptional

The upstream provider that served the request (e.g. vertex-ai). Returned for some providers.

post/v1/images/generations
POST /v1/images/generations HTTP/1.1
Host: api.nexos.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 76

{
  "model": "GPT Image 2",
  "prompt": "three letters 'r' with strawberry texture"
}
{
  "created": 1,
  "data": [
    {
      "b64_json": "text",
      "revised_prompt": "text",
      "url": "text"
    }
  ],
  "background": "text",
  "output_format": "text",
  "quality": "text",
  "size": "text",
  "provider": "text",
  "usage": {
    "input_tokens": 1,
    "input_tokens_details": {
      "image_tokens": 1,
      "text_tokens": 1
    },
    "output_tokens": 1,
    "output_tokens_details": {
      "image_tokens": 1,
      "text_tokens": 1
    },
    "total_tokens": 1,
    "nexos_credits_cost": 1
  }
}

Last updated