POST
/
v1
/
images
/
generations
import { AtomaSDK } from "atoma-sdk";

const atomaSDK = new AtomaSDK({
  bearerAuth: process.env["ATOMASDK_BEARER_AUTH"] ?? "",
});

async function run() {
  const result = await atomaSDK.images.generate({
    model: "black-forest-labs/FLUX.1-schnell",
    prompt: "A cute baby sea otter",
    n: 1,
    size: "1024x1024"
  });

  // Handle the result
  console.log(result);
}

run();
{
  "created": 1677649420,
  "data": [
    {
      "revised_prompt": "A stunning image of a baby sea otter floating on its back in crystal clear blue water, with gentle ripples surrounding it. The otter's fur appears soft and well-detailed, and its expression is peaceful and content.",
      "url": "https://oaidalleapiprodscus.blob.core.windows.net/private/image.png"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request body for image generation

model
string
required

The model to use for image generation.

Example:

"black-forest-labs/FLUX.1-schnell"

prompt
string
required

A text description of the desired image(s). The maximum length is 1000 characters.

Example:

"A cute baby sea otter floating on its back"

n
integer | null

The number of images to generate. Defaults to 1.

Required range: x >= 0
Example:

1

quality
string | null

The quality of the image that will be generated. hd creates images with finer details and greater consistency across the image.

Example:

"hd"

response_format
string | null

The format in which the generated images are returned.

Example:

"url"

size
string | null

The size of the generated images.

Example:

"1024x1024"

style
string | null

The style of the generated images.

Example:

"vivid"

user
string | null

A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.

Example:

"user-1234"

Response

200
application/json
Image generations

Response format for image generation

created
integer
required
Example:

1677649420

data
object[]
required

Individual image data in the response