Skip to content
HomeModels
DocsImages

Image generations

Generate images from a text prompt. Supported sizes, quality settings, and response formats vary by model.

OpenAI compatible
POST/v1/images/generations
Base URLhttps://api.linkinfra.ai

Authorization

Bearer Token
AuthorizationBearer <token>

Authenticate requests with your API key in the request header:

Authorization: Bearer sk-your-api-key

Need a key? Create one in the console

Image generation can take longer than text. Set a sufficient client timeout. Base64 data is omitted in this example.

Request body

application/json
modelstringrequired

Model ID from the model catalog. Availability depends on your account group and configured channels.

promptstringrequired

A text description of the desired image.

ninteger

Number of images, subject to model limits.

sizestring

Image size, such as 1024x1024, subject to model support.

qualitystring

Image quality. Accepted values vary by model.

response_formatstring

Some models accept url or b64_json. The gpt-image family generally returns Base64.

Response

application/json
200Successful response
createdinteger

Creation time as a Unix timestamp in seconds.

dataarray<object>

Image results containing url or b64_json.

Request failed? Read the error handling guide