Preview: these APIs are still being designed and aren't available yet.
Skip to Content
UpskyDocs
API reference

Create an image

Makes images from a prompt, in OpenAI's Images format. With a test key the image is a placeholder and nothing is charged.

POST
/v1/ai/images/generations

Makes images from a prompt, in OpenAI's Images format. With a test key the image is a placeholder and nothing is charged.

Authorization

apiKey
headerAuthorizationBearer <token>

Your API key, starting with upsky_test_ or upsky_live_.

Request Body

application/json
  1. body

OpenAI's Images format. Other fields, such as quality or style, are ignored.

model*string

An image model ID from GET /v1/ai/models?type=image.

Length1 <= length <= 200
prompt*string

What to draw.

Length1 <= length <= 32000
n?integer

How many images to make, up to 4. Defaults to 1. Each is charged.

Range1 <= value <= 4
size?string

Width and height in pixels, such as 1024x1024. Sizes each model supports vary.

Match^\d{2,5}x\d{2,5}$
aspect_ratio?string

Width to height, such as 16:9, for models that take a ratio instead of a size.

Match^\d{1,3}:\d{1,3}$
seed?integer

Makes results repeatable, on models that support it.

response_format?"b64_json"

Only b64_json: images are returned as base64, never as links.

Value in"b64_json"
[key: string]?unknown

Response Body

The images.

application/json
  1. response
created*integer

Seconds since the epoch.

data*array<>
usage*
Example Request
curl -X POST 'https://api.upsky.dev/v1/ai/images/generations' \  -H 'Content-Type: application/json' \  -d '{  "model": "string",  "prompt": "string",  "property1": null,  "property2": null}'
Example Response
{  "created": 0,  "data": [    {      "b64_json": "string"    }  ],  "usage": {    "images": 0,    "input_tokens": 0,    "output_tokens": 0,    "total_tokens": 0,    "cost": 0  }}