Hierarchy

  • APIResource
    • Images

Constructors

  • Parameters

    Returns Images

Methods

  • Creates a variation of a given image. This endpoint only supports dall-e-2.

    Parameters

    Returns APIPromise<ImagesResponse>

    const imagesResponse = await client.images.createVariation({
    image: fs.createReadStream('otter.png'),
    });
  • Creates an edited or extended image given one or more source images and a prompt. This endpoint only supports gpt-image-1 and dall-e-2.

    Parameters

    Returns APIPromise<ImagesResponse>

    const imagesResponse = await client.images.edit({
    image: fs.createReadStream('path/to/file'),
    prompt: 'A cute baby sea otter wearing a beret',
    });
  • Creates an image given a prompt. Learn more.

    Parameters

    Returns APIPromise<ImagesResponse>

    const imagesResponse = await client.images.generate({
    prompt: 'A cute baby sea otter',
    });