API ReferenceImage SeriesOpenAI FormatPOSTImage Generation
Image SeriesPOSTImage Generations
API Reference

Image Generation

POSThttps://api.tokenbay.com/v1/images/generations

Create images from a text prompt using the OpenAI-compatible Images API

Creates an image from a text prompt and returns image URLs or base64-encoded image data, depending on the selected model.

Image Generations

openai
POST/v1/images/generations

Request

schema
modelstringRequired

Available image generation model ID.

promptstringRequired

Image generation prompt.

sizestringOptional

Output size. Supported values depend on the model, such as 1024x1024, 1024x1536, 1536x1024, or auto.

qualitystringOptional

Quality tier. Supported values depend on the model, such as auto, standard, hd, high, medium, or low.

backgroundstringOptional

Background control for models that support transparency or background settings, such as auto, transparent, or opaque.

nintegerOptional

Number of images. Limits depend on the model.

moderationstringOptional

Content moderation strength. Support depends on the upstream.

output_compressionintegerOptional

Output compression quality, usually for jpeg/webp.

response_format / output_formatstringOptional

Return URL, base64, or a requested image format such as png, jpeg, or webp when supported upstream.

userstringOptional

Client-side user identifier. Do not include sensitive data.

Response

schema

Usually returns image URLs or base64 data. Concrete fields and formats depend on the upstream image model.

createdintegerOptional

Creation timestamp.

data[]array<object>Optional

Image result array, possibly including url, b64_json, revised_prompt, and similar fields.

Related