Skip to Content
PurAI is SHUT DOWN. This website is purely for archival purposes. No such services exist anymore.
DocsImage Generation

Image Generation

Image generation creates new images from a text description. Common uses include:

  • Creating unique visual content from user input.
  • Generating environments and assets for games and simulations.
  • Applying artistic styles to produce stylized images.
  • Producing custom visual assets tailored to individual requirements.
  • Creating renderings for architecture and design work.

Image generation is served by OpenAI models through the endpoint below.

Request

URL: https://ai.purlabs.xyz/openai/images/generations

Request Method: POST

TS Request Interface

interface Request { prompt: string; n?: number | null; size?: '256x256' | '512x512' | '1024x1024' | null; response_format?: 'url' | 'b64_json' | null; user?: string; };

Request API Reference

ParameterType (check TS Interface)RequiredDescription
promptstringRequiredA text description of the desired image(s). The maximum length is 1000 characters.
nnumber | nullOptionalThe number of images to generate. Must be between 1 and 10. Defaults to 1.
sizestring | nullOptionalThe size of the generated images. Must be one of 256x256, 512x512, or 1024x1024. Defaults to 1024x1024.
response_formatstring | nullOptionalThe format in which the generated images are returned. Must be one of url or b64_json. Defaults to url.
userstringOptionalA unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more .

Example JSON Request Body

{ "prompt": "A scene where people are commuting to work using giant inflatable rubber ducks instead of regular vehicles." }

Response

TS Response Interface

interface Response { model?: string; data: { url: `https://${string}` }[]; };

Example JSON Response

{ "data": [ { "url": "https://images.example.com/generations/kqwrb1beHYyY1imA.png" } ], }
Last updated on