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

Response

200
application/json

Image generations

Response format for image generation