v1
OAS 3.1.0

Lummi API

Introduction

Lummi REST API offers tools for searching, retrieving, and customizing images, with features like filters, metadata, and advanced image effects.

Authentication

The API uses Bearer Token authentication. Developers must include their API key in the Authorization header of each request.

Example:

Authorization: Bearer YOUR_API_KEY

Rate Limiting

The API enforces rate limits to ensure fair usage and system stability.

  • Default Limit: 10 requests per minute.
  • Approved Applications: 100 requests per minute.

If the limit is exceeded, the API will return a 429 Too Many Requests response. To avoid disruptions:

  • Optimize your API usage by batching requests where possible.
  • Implement retry logic with exponential backoff to handle rate limit errors.

For higher limits, submit your application for review at https://www.lummi.ai/portal/developer.

Attribution Guidelines

To comply with usage guidelines and ensure proper credit is given to image creators, developers MUST include both image attribution and author attribution for each image displayed.

Image Attribution

When displaying images obtained through the Lummi API, you MUST provide a clickable link to the original source of the image. Use the attributionUrl property from the image object.

Author Attribution

Developers MUST also attribute the original author of the image. Use the attributionUrl from the author object to create a clickable link to the author's profile.

Example

<div className="relative">
  <img src={image.url} alt={image.name} />

  <p className="absolute bottom-0 right-0">
    Photo by
    <a href={author.attributionUrl} target="_blank">
      {author.name}
    </a>
    on
    <a href={image.attributionUrl} target="_blank">
      Lummi
    </a>
  </p>
</div>

General Best Practices for Attribution

  • Visibility: The attribution should appear near the image, on top of it, or be visible on hover.
  • Formatting: Use clear and clickable text links for all attribution URLs.
  • Styling: Match the attribution style with your application’s design for a seamless user experience.

By adhering to these guidelines, developers ensure compliance with Lummi's terms of service and respect the work of creators.

Dynamic Image Transformations

Every image object includes a url property, which returns a direct URL to the image. You can customize the size and format of each image by adding specific query parameters to this URL. Below are the supported parameters and examples of their usage.

1. Resizing

You can resize an image by specifying one or both of the following parameters:

  • w (width): Sets the output width (in pixels).
  • h (height): Sets the output height (in pixels).

When you provide both w and h, the image is fit within those dimensions while preserving its aspect ratio. In this case, only one dimension (either width or height) will match your parameters — unless the original aspect ratio is 1:1.

By default, the URL for each image may already include query parameters for width (w) and height (h). These default values ensure a certain size is always delivered unless you override them. You can modify or remove these parameters to fetch different sizes or the original image.

Examples

const imageUrl = new URL(image.url);

# Default size
imageUrl.toString(); # "https://assets.lummi.ai/assets/abc123?w=xxx&h=xxx&auto=format"

# Original size
imageUrl.searchParams.delete("w");
imageUrl.searchParams.delete("h");
imageUrl.toString(); # "https://assets.lummi.ai/assets/abc123?auto=format"

# Resize to a width of 400px
imageUrl.searchParams.set("w", "400");
imageUrl.searchParams.delete("h");
imageUrl.toString(); # "https://assets.lummi.ai/assets/abc123?w=400&auto=format"

# Resize to a height of 300px
imageUrl.searchParams.set("h", "300");
imageUrl.searchParams.delete("w");
imageUrl.toString(); # "https://assets.lummi.ai/assets/abc123?h=300&auto=format"

# Resize to both width 400px and height 300px (maintains aspect ratio)
imageUrl.searchParams.set("w", "400");
imageUrl.searchParams.set("h", "300");
imageUrl.toString(); # "https://assets.lummi.ai/assets/abc123?w=400&h=300&auto=format"

2. Format Conversion

You can also convert an image to a different format by removing the auto parameter and adding the fm parameter. Supported values for fm include jpg, png, avif, and webp.

By default, the URL for each image includes a query parameter for automatic format selection (auto). This ensures that the most optimal format is always delivered unless you override it. You can remove auto parameter to fetch a different format or the original one.

Examples

const imageUrl = new URL(image.url);

# Default (automatic) format
imageUrl.toString(); # "https://assets.lummi.ai/assets/abc123?auto=format&w=xxx&h=xxx"

# Original format
imageUrl.searchParams.delete("auto");
imageUrl.toString(); # "https://assets.lummi.ai/assets/abc123?w=xxx&h=xxx"

# Convert to `png` format
imageUrl.searchParams.delete("auto");
imageUrl.searchParams.set("fm", "png");
imageUrl.toString(); # "https://assets.lummi.ai/assets/abc123?fm=png&w=xxx&h=xxx"

Combining Parameters

You can mix-and-match the w, h, fm, and auto parameters to perform multiple transformations at once:

const imageUrl = new URL(image.url);
imageUrl.searchParams.delete("auto");
imageUrl.searchParams.set("fm", "avif");
imageUrl.searchParams.set("w", "400");
imageUrl.searchParams.set("h", "300");
imageUrl.toString(); # "https://assets.lummi.ai/assets/abc123?fm=avif&w=400&h=300"
Server: https://api.lummi.ai/v1
Client Libraries

/images

List images.

Query Parameters
  • imageType
    Type:string enum
    • photo
    • illustration
    • 3d
  • orientation
    Type:string enum
    • square
    • horizontal
    • vertical
  • color
    Type:string Pattern: ^#(?:[0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$

    Color in HEX format.

  • categories
    Type:string

    Include only images from any of the specified category IDs, separated by commas.

  • luminance
    Type:string enum
    • dark
    • neutral
    • bright
  • numberOfPeople
    Type:string

    Include only images with the specified number of people. This can optionally be prefixed with an operator:

    • gt (grater than)
    • gte (grater than or equal to)
    • lt (lower than)
    • lte (lower than or equal to)
  • free
    Type:boolean
    default: 
    false

    Include only images that are free.

  • orderBy
    Type:string enum
    default: 
    featuredScore
    • featuredScore
    • trendScore
    • createdAt
  • orderDirection
    Type:string enum
    default: 
    desc
    • asc
    • desc
  • page
    Type:integer
    min: 
    1

    Page number.

  • perPage
    Type:integer
    min: 
    1
    max: 
    20

    Page size.

Responses
  • application/json
  • application/json
  • application/json
  • application/json
Request Example forGET/images
curl https://api.lummi.ai/v1/images \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "data": [
    {
      "attributionUrl": "https://www.lummi.ai/photo/abc",
      "url": "https://assets.lummi.ai/assets/abc123",
      "author": {
        "attributionUrl": "https://www.lummi.ai/creator/abc",
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "username": "string",
        "name": "string",
        "avatar": "https://assets.lummi.ai/assets/abc123",
        "role": "user"
      },
      "imageType": "photo",
      "contentType": "image/png",
      "createdAt": "2025-05-10T15:39:19.784Z",
      "updatedAt": "2025-05-10T15:39:19.784Z",
      "featuredAt": null,
      "featuredScoreUpdatedAt": null,
      "vibeDescription": "string",
      "detailedDescription": "string",
      "description": "string",
      "collections": 123,
      "searchAppearances": 123,
      "viewCount": 123,
      "downloadCount": 123,
      "trendScore": 12.3,
      "randomFieldScore": 123,
      "featuredScore": 123,
      "luminance": 0.12,
      "focalPositionX": 0.12,
      "focalPositionY": 0.12,
      "focalWidth": 0.12,
      "focalHeight": 0.12,
      "focalZone": "top_left",
      "numberOfPeople": 123,
      "shootId": null,
      "tags": [
        {
          "id": "123e4567-e89b-12d3-a456-426614174000",
          "name": "string",
          "slug": "cool-cat"
        }
      ],
      "categories": [
        {
          "id": "123e4567-e89b-12d3-a456-426614174000",
          "name": "string",
          "slug": "cool-cat"
        }
      ],
      "colorPalette": {
        "ANY_ADDITIONAL_PROPERTY": {
          "hex": "#00ff00",
          "weight": 0.12
        }
      },
      "colorGroups": [
        "string"
      ],
      "dominantColorGroup": "string",
      "dominantColorWeight": 0.12,
      "pro": true,
      "free": true,
      "transparent": true,
      "discoverable": true,
      "becameDiscoverableAt": null,
      "unsafe": true,
      "size": 123,
      "width": 123,
      "height": 123,
      "aspectRatio": 1.23,
      "orientation": "square",
      "generation": {
        "aiModel": "sd",
        "batchId": "123e4567-e89b-12d3-a456-426614174000",
        "parentId": "123e4567-e89b-12d3-a456-426614174000",
        "rootId": "123e4567-e89b-12d3-a456-426614174000",
        "prompt": "string",
        "aspectRatio": "9:21",
        "imageType": "photo",
        "shotType": "string",
        "trend": "string"
      },
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "string",
      "blurhash": "string",
      "slug": "cool-cat"
    }
  ],
  "meta": {
    "totalCount": 123
  }
}

/images/random

List random images.

Query Parameters
  • limit
    Type:integer
    min: 
    1
    max: 
    20

    The number of images to return.

  • imageType
    Type:string enum
    • photo
    • illustration
    • 3d
  • orientation
    Type:string enum
    • square
    • horizontal
    • vertical
  • color
    Type:string Pattern: ^#(?:[0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$

    Color in HEX format.

  • categories
    Type:string

    Include only images from any of the specified category IDs, separated by commas.

  • luminance
    Type:string enum
    • dark
    • neutral
    • bright
  • numberOfPeople
    Type:string

    Include only images with the specified number of people. This can optionally be prefixed with an operator:

    • gt (grater than)
    • gte (grater than or equal to)
    • lt (lower than)
    • lte (lower than or equal to)
  • free
    Type:boolean
    default: 
    false

    Include only images that are free.

Responses
  • application/json
  • application/json
  • application/json
  • application/json
Request Example forGET/images/random
curl https://api.lummi.ai/v1/images/random \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
[
  {
    "attributionUrl": "https://www.lummi.ai/photo/abc",
    "url": "https://assets.lummi.ai/assets/abc123",
    "author": {
      "attributionUrl": "https://www.lummi.ai/creator/abc",
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "username": "string",
      "name": "string",
      "avatar": "https://assets.lummi.ai/assets/abc123",
      "role": "user"
    },
    "imageType": "photo",
    "contentType": "image/png",
    "createdAt": "2025-05-10T15:39:19.784Z",
    "updatedAt": "2025-05-10T15:39:19.784Z",
    "featuredAt": null,
    "featuredScoreUpdatedAt": null,
    "vibeDescription": "string",
    "detailedDescription": "string",
    "description": "string",
    "collections": 123,
    "searchAppearances": 123,
    "viewCount": 123,
    "downloadCount": 123,
    "trendScore": 12.3,
    "randomFieldScore": 123,
    "featuredScore": 123,
    "luminance": 0.12,
    "focalPositionX": 0.12,
    "focalPositionY": 0.12,
    "focalWidth": 0.12,
    "focalHeight": 0.12,
    "focalZone": "top_left",
    "numberOfPeople": 123,
    "shootId": null,
    "tags": [
      {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "name": "string",
        "slug": "cool-cat"
      }
    ],
    "categories": [
      {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "name": "string",
        "slug": "cool-cat"
      }
    ],
    "colorPalette": {
      "ANY_ADDITIONAL_PROPERTY": {
        "hex": "#00ff00",
        "weight": 0.12
      }
    },
    "colorGroups": [
      "string"
    ],
    "dominantColorGroup": "string",
    "dominantColorWeight": 0.12,
    "pro": true,
    "free": true,
    "transparent": true,
    "discoverable": true,
    "becameDiscoverableAt": null,
    "unsafe": true,
    "size": 123,
    "width": 123,
    "height": 123,
    "aspectRatio": 1.23,
    "orientation": "square",
    "generation": {
      "aiModel": "sd",
      "batchId": "123e4567-e89b-12d3-a456-426614174000",
      "parentId": "123e4567-e89b-12d3-a456-426614174000",
      "rootId": "123e4567-e89b-12d3-a456-426614174000",
      "prompt": "string",
      "aspectRatio": "9:21",
      "imageType": "photo",
      "shotType": "string",
      "trend": "string"
    },
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "string",
    "blurhash": "string",
    "slug": "cool-cat"
  }
]