Light Logo
Openai

Generate an image

OpenAI compatible image generation endpoint. If the model does not respond in time, the request will be timed out and the prediction will be cancelled.

POST
/images/generations
AuthorizationBearer <token>

In: header

modelModel

The model to use for this OpenAI compatible endpoint. Models must be in the following format: model_owner/model_name or model_owner/model_name:version_number.

promptPrompt

A text description of the desired image(s).

background?Background

Allows to set transparency for the background of the generated image(s).

moderation?Moderation

Control the content-moderation level for images generated by the image models.

n?N

The number of images to generate.

output_compression?Output Compression

The compression level for the generated images.

output_format?Output Format

The format in which the generated images are returned.

partial_images?Partial Images

The number of partial images to generate.

quality?Quality

The quality of the image that will be generated.

response_format?Response Format

The format in which generated images are returned.

size?Size

The size of the generated images.

style?Style

The style of the generated images.

Response Body

curl -X POST "https://api.wrift.ai/v1/images/generations" \  -H "Content-Type: application/json" \  -d '{    "model": "string",    "prompt": "string"  }'
{
  "created": 0,
  "background": "transparent",
  "data": [
    {
      "b64_json": "string",
      "revised_prompt": "string",
      "url": "string"
    }
  ],
  "output_format": "png",
  "quality": "low",
  "size": "1024x1024",
  "usage": {
    "input_tokens": 0,
    "input_tokens_details": {
      "image_tokens": 0,
      "text_tokens": 0
    },
    "output_tokens": 0,
    "total_tokens": 0,
    "output_tokens_details": {
      "image_tokens": 0,
      "text_tokens": 0
    }
  }
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}