API ReferenceImage SeriesPOSTOpenAI Images
Image SeriesPOSTImage Generations
API Reference

Images

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

Image generation and image editing APIs

Images routes currently enter the OpenAI platform orchestration chain.

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.

Image Edits

openai
POST/v1/images/edits

Request

schema
modelform stringRequired

Available image editing model ID.

imageform file | form file[]Required

Image to edit. Some models support multiple images.

promptform stringRequired

Edit prompt.

maskform fileOptional

Mask image for models that support inpainting.

size / quality / backgroundform stringOptional

Size, quality, and background settings. Support depends on the model.

nform integerOptional

Number of images.

output_compressionform integerOptional

Output compression quality, usually for jpeg/webp.

response_format / output_formatform stringOptional

Return URL, base64, or a requested image format.

Response

schema

The multipart form is forwarded to the upstream image editing service. Responses usually return image URLs or base64 data.

createdintegerOptional

Creation timestamp.

data[]array<object>Optional

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

Related