LetzAI API Documentation

API Documentation

The LetzAI API enables developers to use LetzAI's Inference capabilities and community models in their own apps.
For more ideas about LetzAI API Use Cases, please have a look at the LetzAI Playground.

API URL: https://api.letz.ai

Use this URL for all your API calls.


Swagger Documentation: api.letz.ai/doc

The documentation in machine-readable format through Swagger.


AI Instructions: letz.ai/systemprompts/api_instructions.md

The documentation as instructions for LLMs and AI Coding Tools ('Vibe Coding Instructions').


OpenAPI YAML File api.letz.ai/doc-yaml

The documentation in OpenAPI YAML format.


Creating an API Key

Find and manage your API keys on your Subscription page.

A subscription is required to use the API.

LetzAI API Keys are 'Bearer' Tokens. You will need to use them as such in your endpoints.
What is a Bearer Token?

⚠️ Important note about privacy

All API calls are linked to the account associated with the API key.
This means that users of any app that use your account's keys will be able to access the private models and private images stored on that account. If you do not wish to expose all the models on your private account, we recommend setting up a separate account for your API needs.

Furthermore, the holder of the API key will be able to see all images generated with that key.
We recommend disclosing this information to your app's users in your privacy policy.

API Endpoints

POST/images

This endpoint allows you to create images.

Parameters

ParameterTypeDescription
promptStringRequired. The input prompt for image generation
widthIntegerMin: 520, Default: 1600, Max: 2160
heightIntegerMin: 520, Default: 1600, Max: 2160
qualityIntegerDefines how many steps the generation should take. Higher is slower, but generally better quality.
Min: 1, Default: 2, Max: 5
creativityIntegerDefines how strictly the prompt should be respected. Higher Creativity makes the images more artificial. Lower makes it more photorealistic.
Min: 1, Default: 2, Max: 5
hasWatermarkBooleanDefines whether to set a watermark or not. Default is true
systemVersionIntegerAllowed values: 2, 3
Use LetzAI V2, or V3 (newest). Default is the version currently selected on your account.
modeStringSelect one of the different modes that offer different generation settings.
Allowed values: "default", "cinematic", "sigma", "creative", "turbo"
Default is slow but high quality. Sigma is faster and great for close ups. Creative is more artistic and has less 'AI-look'. Turbo is fastest, but lower quality.
organizationIdStringOptional. Organization UUID to deduct credits from (user must be a member)
OrganizationId can be found on your organizations's dashboard.
const postData = {
        prompt: 'A beautiful landscape',
        width: 1920,
        height: 1080,
        quality: 5,
        creativity: 6,
        hasWatermark: true,
        systemVersion: 3
      };
      
      fetch('https://api.letz.ai/images', {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
          'Authorization': 'Bearer YOUR_API_KEY' // Replace YOUR_API_KEY with your actual key
        },
        body: JSON.stringify(postData)
      })
      .then(response => response.json())
      .then(data => console.log(data))
      .catch(error => console.error('Error:', error));
PUT/images/{id}/interruption

This endpoint allows you to interrupt the image generation process for a specific image.

Path Parameters

ParameterTypeDescription
idStringThe unique identifier for the image.

Responses

CodeDescription
204No Content - Success
400Bad Request
PUT/images/{id}/privacy

This endpoint allows you to change the privacy setting of an image. Images with status 'public' will be visible on the LetzAI feed, published under the account that has created the API key.

Path Parameters

ParameterTypeDescription
idStringThe unique identifier for the image.

Request Body

FieldTypeDescription
privacyStringThe privacy status.
Default: private. Allowed values: "private", "public"
{ "privacy": "public" }

Responses

CodeDescription
204No Content - Success
400Bad Request
GET/images/{id}

This endpoint allows you to retrieve one image including its generation status. It can be used to track the progress of an image, for example during long polling when generating images.

Response

FieldTypeDescription
idStringUnique identifier for your image
imageVersionsObjectAvailable image sizes/versions

Example:
{
  "original": "https://images.letz.ai/.../image.jpg",
  "96x96": "https://images.letz.ai/.../image_96x96.jpg",
  "240x240": "https://images.letz.ai/.../image_240x240.jpg",
  "640x640": "https://images.letz.ai/.../image_640x640.jpg",
  "1920x1920": "https://images.letz.ai/.../image_1920x1920.jpg"
}
userObjectReference to the User who made the request
originalImageCompletionObjectExists only for edited images. Reference to the originalImageCompletion that was used to edit an image.
promptStringThe input prompt provided by the user
statusStringCurrent status: new, in progress, ready or failed
progressMessageStringMessage describing the current progress
progressIntegerProgress value (0-100, where 100 is finished)
previewImageStringURL to a preview image (Base64)
isHotBooleanFlag indicating if trending
privacyStringPrivacy setting of the object
likesIntegerNumber of likes received
regenerationsIntegerCount of regenerations
hasWatermarkBooleanIndicates if watermarked
isNsfwBooleanIndicates mature content
isUnsafeBooleanIndicates potential Terms of Service violation
createdAtStringCreation timestamp (ISO format)
modelsObjectAI Models used for this image
systemVersionIntegerSystem version used
 
    // Replace 'your-image-id' with the actual ID returned by POST
    fetch("https://api.letz.ai/images/your-image-id", {
      method: 'GET',
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY' // Replace YOUR_API_KEY with your actual key
      }
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
GET/images

This endpoint allows you to retrieve multiple images. It returns an array containing the amount of images defined under the limit parameter.

Query Parameters

ParameterTypeDescription
sortByStringSort attribute (createdAt, likes, regenerations)
sortOrderStringOptional. Available values: "ASC", "DESC"
pageIntegerPage number for pagination
limitIntegerResults per page
modelIdsArray[String]Optional. Filter by specific models
userIdStringOptional. Filter by creator`'s user ID
usernameStringOptional. Filter by creator`'s username
isHotBooleanOptional. Show only trending images
onlyFollowingBooleanOptional. Show only images from followed users
 
    fetch("https://api.letz.ai/images?page=1&limit=20&sortOrder=DESC&sortBy=createdAt", {
      method: 'GET',
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY' // Replace YOUR_API_KEY with your actual key
      }
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));

Response

Returns an array of image objects with the following structure:

FieldTypeDescription
idStringUnique identifier for the image
imageVersionsObjectAvailable image sizes/versions

Example:
{
  "original": "https://images.letz.ai/.../image.jpg",
  "96x96": "https://images.letz.ai/.../image_96x96.jpg",
  "240x240": "https://images.letz.ai/.../image_240x240.jpg",
  "640x640": "https://images.letz.ai/.../image_640x640.jpg",
  "1920x1920": "https://images.letz.ai/.../image_1920x1920.jpg"
}
userObjectUser object containing id, name, username, profilePicture, and other user details
imageEditObjectPresent for edited images. Contains edit details, original image reference, and edit settings
promptStringThe input prompt used to generate the image
statusStringGeneration status: new, in progress, ready, or failed
progressMessageStringMessage describing current progress
progressIntegerProgress value (0-100)
previewImageStringURL to preview image (Base64)
isHotBooleanWhether image is trending
privacyStringPrivacy setting (private, public)
likesIntegerNumber of likes
regenerationsIntegerCount of regenerations
systemVersionIntegerSystem version used
hasWatermarkBooleanWhether image has watermark
isNsfwBooleanWhether image contains mature content
webhookUrlStringWebhook URL for notifications
hidePromptBooleanWhether prompt is hidden
createdAtStringCreation timestamp (ISO format)
modelsArray[Object]AI models used for image generation

Responses

CodeDescription
200Successfully retrieved the list of images
400Bad Request. Possible reasons:
  • page: Must be a positive integer
  • limit: Must be a positive integer between 1 and 100
  • sortBy: Must be one of the allowed sort fields
  • sortOrder: Must be either 'ASC' or 'DESC'
  • Invalid filter parameters provided
401Unauthorized. Authentication token is missing or invalid
403Forbidden. User does not have permission to access these images
500Internal Server Error. An unexpected error occurred while retrieving images
POST/upscale

This endpoint allows you to upscale images. You can provide either an `imageId` or an `imageURL`. The `strength` parameter specifies the degree of upscaling. Lower is more accurate. Higher is more creative.

Request Body

FieldTypeDescription
imageUrlsStringOptional. The URLs of the images to be upscaled. Must be a publicly available URLs.
strengthIntegerRequired. The strength of the upscaling process. Min. 1, Max. 3.
modeIntegerOptional. The upscaling mode. Sharp is more crisp. Soft is more natural. Default is Sharp.
sizeIntegerOptional. The resolution of the upscaled image in MP. Min. 2, Max. 12.
organizationIdStringOptional. Organization UUID to deduct credits from (user must be a member)
OrganizationId can be found on your organizations's dashboard.
GET/upscale/{id}

Path Parameters

ParameterTypeDescription
idStringRequired. The unique identifier of the upscale operation.
POST/image-edits

This endpoint allows you to edit images.

Parameters

ParameterTypeDescription
modeStringRequired. The Editing Mode.
Use either:
imageCompletionsCountIntegerAmount of images to generate for inpainting and outpainting. Default: 3, Maximum: 3

Does not work with skin mode.
originalImageCompletionIdStringOptional. The original image ID of the LetzAI image you want to edit.
Either this or imageUrl is required.
promptStringYour prompt. Can contain models with @tags.
maskStringOnly required for Inpainting.

Base64 encoded mask image, passed as string.

The mask needs to be white (#ffffff) on black background (#000000).

The mask needs to be the same size as the image.
imageUrlStringOptional. The URL to the image you want to edit.
Must be publicly available.
Either this, inputImageUrls or originalImageCompletionId is required.
inputImageUrlsString[]Optional. The URLs of the images to be upscaled. Must be publicly available URLs. All these images will be considered for the edit. Maximum 9 images.
Either this, inputImageUrl or originalImageCompletionId is required.
settingsObjectRequired for Outpainting and Skin Fix.

Outpainting Example:
{panControls: {up: false, right: false, down: false, left: false}, zoomSize: 1.5}

Skin Fix Example:
{face: true, body: true,eyes: true, mouth: true, nose: false, intensity: 3}
Default values are:
{face: true, body: true,eyes: false, mouth: false, nose: false, intensity: 2}
Intensity ranges from 1 (soft) to 5 (intense).
Please note that "mouth" and "nose" are subcategories of "face" and will only work if "face" is true.
organizationIdStringOptional. Organization UUID to deduct credits from (user must be a member)
OrganizationId can be found on your organizations's dashboard.
webhookUrlStringOptional. The URL to the webhook you want to send the image edit to.

Responses

CodeDescription
201The image edit was successfully created.

Media type: application/json

Example Response Schema:
{ "id": "string", "originalImageCompletion": { "id": "string", "user": { "id": "string", "name": "string", "username": "string", "profilePicture": "string", "description": "string", "website": "string", "socialMediaAccounts": {}, "imagesGenerated": 0, "imagesAvailable": 0, "modelsAvailable": 0, "followersCount": 0, "followingCount": 0, "isVerified": true }, "userId": "string", "regeneratedFromId": "string", "originalImageCompletion": "string", "imageEdit": "string", "prompt": "string", "baseModel": "string", "promptSystem": "string", "status": "string", "statusDetail": "string", "progress": 0, "previewImage": "string", "username": "string", "queue": "string", "isUserVerified": true, "isHot": true, "privacy": "string", "likes": 0, "comments": 0, "liked": true, "regenerations": 0, "reports": 0, "storageBucket": "string", "storagePath": "string", "generationSettings": {}, "generationData": "string", "generatedByUnit": "string", "generationSeconds": 0, "imageVersions": {}, "systemVersion": 0, "hasWatermark": true, "isNsfw": true, "webhookUrl": "string", "isBookmarked": true, "isUnsafe": true, "hidePrompt": true, "blockedAt": "2025-06-20T11:43:51.958Z", "createdAt": "2025-06-20T11:43:51.958Z", "models": [ { "id": "string", "user": { "id": "string", "name": "string", "username": "string", "profilePicture": "string", "description": "string", "website": "string", "socialMediaAccounts": {}, "imagesGenerated": 0, "imagesAvailable": 0, "modelsAvailable": 0, "followersCount": 0, "followingCount": 0, "isVerified": true }, "userId": "string", "name": "string", "username": "string", "class": "string", "type": "string", "description": "string", "website": "string", "status": "string", "progress": 0, "privacy": "string", "usages": 0, "imagesAvailable": 0, "likes": 0, "version": 0, "thumbnail": "string", "thumbnailOptions": {}, "settings": {}, "images": {}, "isActive": true, "blockedAt": "2025-06-20T11:43:51.958Z", "createdAt": "2025-06-20T11:43:51.958Z", "systemVersions": ["string"], "versions": [ { "id": "string", "version": 0, "storagePath": "string", "systemVersions": ["string"], "status": "string", "createdAt": "2025-06-20T11:43:51.958Z", "trainedAt": "2025-06-20T11:43:51.958Z" } ] } ] }, "originalImageEdit": "string", "generatedImageCompletion": { "id": "string", "user": { "id": "string", "name": "string", "username": "string", "profilePicture": "string", "description": "string", "website": "string", "socialMediaAccounts": {}, "imagesGenerated": 0, "imagesAvailable": 0, "modelsAvailable": 0, "followersCount": 0, "followingCount": 0, "isVerified": true }, "userId": "string", "regeneratedFromId": "string", "originalImageCompletion": "string", "imageEdit": "string", "prompt": "string", "baseModel": "string", "promptSystem": "string", "status": "string", "statusDetail": "string", "progress": 0, "previewImage": "string", "username": "string", "queue": "string", "isUserVerified": true, "isHot": true, "privacy": "string", "likes": 0, "comments": 0, "liked": true, "regenerations": 0, "reports": 0, "storageBucket": "string", "storagePath": "string", "generationSettings": {}, "generationData": "string", "generatedByUnit": "string", "generationSeconds": 0, "imageVersions": {}, "systemVersion": 0, "hasWatermark": true, "isNsfw": true, "webhookUrl": "string", "isBookmarked": true, "isUnsafe": true, "hidePrompt": true, "blockedAt": "2025-06-20T11:43:51.959Z", "createdAt": "2025-06-20T11:43:51.959Z", "models": [ { "id": "string", "user": { "id": "string", "name": "string", "username": "string", "profilePicture": "string", "description": "string", "website": "string", "socialMediaAccounts": {}, "imagesGenerated": 0, "imagesAvailable": 0, "modelsAvailable": 0, "followersCount": 0, "followingCount": 0, "isVerified": true }, "userId": "string", "name": "string", "username": "string", "class": "string", "type": "string", "description": "string", "website": "string", "status": "string", "progress": 0, "privacy": "string", "usages": 0, "imagesAvailable": 0, "likes": 0, "version": 0, "thumbnail": "string", "thumbnailOptions": {}, "settings": {}, "images": {}, "isActive": true, "blockedAt": "2025-06-20T11:43:51.959Z", "createdAt": "2025-06-20T11:43:51.959Z", "systemVersions": ["string"], "versions": [ { "id": "string", "version": 0, "storagePath": "string", "systemVersions": ["string"], "status": "string", "createdAt": "2025-06-20T11:43:51.959Z", "trainedAt": "2025-06-20T11:43:51.959Z" } ] } ] }, "imageCompletionChoices": ["string"], "mode": "string", "width": 0, "height": 0, "imageCompletionsCount": 0, "prompt": "string", "mask": "string", "inputImageUrls": "string", "webhookUrl": "string", "settings": {}, "models": [ { "id": "string", "user": { "id": "string", "name": "string", "username": "string", "profilePicture": "string", "description": "string", "website": "string", "socialMediaAccounts": {}, "imagesGenerated": 0, "imagesAvailable": 0, "modelsAvailable": 0, "followersCount": 0, "followingCount": 0, "isVerified": true }, "userId": "string", "name": "string", "username": "string", "class": "string", "type": "string", "description": "string", "website": "string", "status": "string", "progress": 0, "privacy": "string", "usages": 0, "imagesAvailable": 0, "likes": 0, "version": 0, "thumbnail": "string", "thumbnailOptions": {}, "settings": {}, "images": {}, "isActive": true, "blockedAt": "2025-06-20T11:43:51.959Z", "createdAt": "2025-06-20T11:43:51.959Z", "systemVersions": ["string"], "versions": [ { "id": "string", "version": 0, "storagePath": "string", "systemVersions": ["string"], "status": "string", "createdAt": "2025-06-20T11:43:51.959Z", "trainedAt": "2025-06-20T11:43:51.959Z" } ] } ], "status": "string", "hidePrompt": true }
400Bad Request. Possible reasons:
  • Invalid input parameters
  • Source image does not exist
  • Source image is not in a valid state
  • Invalid edit settings
  • organizationId: Must be a valid UUID format
  • Organization does not exist
401Unauthorized. The user is not authenticated, or user is not a member of the specified organization.
402Payment Required. Insufficient credits to create the image edit (either user or organization credits depending on request).
403Forbidden. User does not have permission to create image edits.
500Internal Server Error. An unexpected error occurred during image edit creation.
GET/image-edits

Query Parameters

ParameterTypeDescription
pageIntegerOptional. Default: 1
limitIntegerOptional. Default: 10
Maximum is 50
sortByStringOptional. Field to sort by
sortOrderStringOptional. Available values: "ASC", "DESC"
statusStringOptional. Available values: "new", "generating", "ready", "saved", "failed", "interrupted"

Responses

CodeDescription
200Successfully retrieved the list of image edits.

Media type: application/json

Example Response Schema:
{ "data": [ { "id": "string", "originalImageCompletion": { "id": "string", "user": { "id": "string", "name": "string", "username": "string", "profilePicture": "string", "description": "string", "website": "string", "socialMediaAccounts": {}, "imagesGenerated": 0, "imagesAvailable": 0, "modelsAvailable": 0, "followersCount": 0, "followingCount": 0, "isVerified": true }, "userId": "string", "regeneratedFromId": "string", "originalImageCompletion": "string", "imageEdit": "string", "prompt": "string", "baseModel": "string", "promptSystem": "string", "status": "string", "statusDetail": "string", "progress": 0, "previewImage": "string", "username": "string", "queue": "string", "isUserVerified": true, "isHot": true, "privacy": "string", "likes": 0, "comments": 0, "liked": true, "regenerations": 0, "reports": 0, "storageBucket": "string", "storagePath": "string", "generationSettings": {}, "generationData": "string", "generatedByUnit": "string", "generationSeconds": 0, "imageVersions": {}, "systemVersion": 0, "hasWatermark": true, "isNsfw": true, "webhookUrl": "string", "isBookmarked": true, "isUnsafe": true, "hidePrompt": true, "blockedAt": "2025-06-20T11:43:51.958Z", "createdAt": "2025-06-20T11:43:51.958Z", "models": [ { "id": "string", "user": { "id": "string", "name": "string", "username": "string", "profilePicture": "string", "description": "string", "website": "string", "socialMediaAccounts": {}, "imagesGenerated": 0, "imagesAvailable": 0, "modelsAvailable": 0, "followersCount": 0, "followingCount": 0, "isVerified": true }, "userId": "string", "name": "string", "username": "string", "class": "string", "type": "string", "description": "string", "website": "string", "status": "string", "progress": 0, "privacy": "string", "usages": 0, "imagesAvailable": 0, "likes": 0, "version": 0, "thumbnail": "string", "thumbnailOptions": {}, "settings": {}, "images": {}, "isActive": true, "blockedAt": "2025-06-20T11:43:51.958Z", "createdAt": "2025-06-20T11:43:51.958Z", "systemVersions": ["string"], "versions": [ { "id": "string", "version": 0, "storagePath": "string", "systemVersions": ["string"], "status": "string", "createdAt": "2025-06-20T11:43:51.958Z", "trainedAt": "2025-06-20T11:43:51.958Z" } ] } ] }, "originalImageEdit": "string", "generatedImageCompletion": { "id": "string", "user": { "id": "string", "name": "string", "username": "string", "profilePicture": "string", "description": "string", "website": "string", "socialMediaAccounts": {}, "imagesGenerated": 0, "imagesAvailable": 0, "modelsAvailable": 0, "followersCount": 0, "followingCount": 0, "isVerified": true }, "userId": "string", "regeneratedFromId": "string", "originalImageCompletion": "string", "imageEdit": "string", "prompt": "string", "baseModel": "string", "promptSystem": "string", "status": "string", "statusDetail": "string", "progress": 0, "previewImage": "string", "username": "string", "queue": "string", "isUserVerified": true, "isHot": true, "privacy": "string", "likes": 0, "comments": 0, "liked": true, "regenerations": 0, "reports": 0, "storageBucket": "string", "storagePath": "string", "generationSettings": {}, "generationData": "string", "generatedByUnit": "string", "generationSeconds": 0, "imageVersions": {}, "systemVersion": 0, "hasWatermark": true, "isNsfw": true, "webhookUrl": "string", "isBookmarked": true, "isUnsafe": true, "hidePrompt": true, "blockedAt": "2025-06-20T11:43:51.959Z", "createdAt": "2025-06-20T11:43:51.959Z", "models": [ { "id": "string", "user": { "id": "string", "name": "string", "username": "string", "profilePicture": "string", "description": "string", "website": "string", "socialMediaAccounts": {}, "imagesGenerated": 0, "imagesAvailable": 0, "modelsAvailable": 0, "followersCount": 0, "followingCount": 0, "isVerified": true }, "userId": "string", "name": "string", "username": "string", "class": "string", "type": "string", "description": "string", "website": "string", "status": "string", "progress": 0, "privacy": "string", "usages": 0, "imagesAvailable": 0, "likes": 0, "version": 0, "thumbnail": "string", "thumbnailOptions": {}, "settings": {}, "images": {}, "isActive": true, "blockedAt": "2025-06-20T11:43:51.959Z", "createdAt": "2025-06-20T11:43:51.959Z", "systemVersions": ["string"], "versions": [ { "id": "string", "version": 0, "storagePath": "string", "systemVersions": ["string"], "status": "string", "createdAt": "2025-06-20T11:43:51.959Z", "trainedAt": "2025-06-20T11:43:51.959Z" } ] } ] }, "imageCompletionChoices": ["string"], "mode": "string", "width": 0, "height": 0, "imageCompletionsCount": 0, "prompt": "string", "mask": "string", "inputImageUrls": "string", "webhookUrl": "string", "settings": {}, "models": [ { "id": "string", "user": { "id": "string", "name": "string", "username": "string", "profilePicture": "string", "description": "string", "website": "string", "socialMediaAccounts": {}, "imagesGenerated": 0, "imagesAvailable": 0, "modelsAvailable": 0, "followersCount": 0, "followingCount": 0, "isVerified": true }, "userId": "string", "name": "string", "username": "string", "class": "string", "type": "string", "description": "string", "website": "string", "status": "string", "progress": 0, "privacy": "string", "usages": 0, "imagesAvailable": 0, "likes": 0, "version": 0, "thumbnail": "string", "thumbnailOptions": {}, "settings": {}, "images": {}, "isActive": true, "blockedAt": "2025-06-20T11:43:51.959Z", "createdAt": "2025-06-20T11:43:51.959Z", "systemVersions": ["string"], "versions": [ { "id": "string", "version": 0, "storagePath": "string", "systemVersions": ["string"], "status": "string", "createdAt": "2025-06-20T11:43:51.959Z", "trainedAt": "2025-06-20T11:43:51.959Z" } ] } ], "status": "string", "hidePrompt": true } ], "pagination": { "page": 1, "limit": 10, "total": 100, "totalPages": 10 } }
400Bad Request. Possible reasons:
  • page: Must be a positive integer
  • limit: Must be a positive integer between 1 and 50
  • sortBy: Must be one of the allowed sort fields
  • sortOrder: Must be either 'ASC' or 'DESC'
  • status: Must be a valid status value
401Unauthorized. Authentication token is missing or invalid.
403Forbidden. User does not have permission to access image edits.
500Internal Server Error. An unexpected error occurred while retrieving image edits.
GET/image-edits/{id}

Path Parameters

ParameterTypeDescription
idStringID of the resource to retrieve

POST/videos

This endpoint allows you to create videos from images. You can provide either an image ID, a single image URL, or multiple image URLs for multi-frame video generation.

Either imageUrl or imageUrls is required to create a video.

Request Body

FieldTypeDescription
promptStringRequired. Text description for the video generation.
originalImageCompletionIdStringOptional. The unique identifier of a LetzAI image to use as the source. Either this, imageUrl, or imageUrls must be provided.
imageUrlStringOptional. A publicly available URL to an image to use as the source. Either this, originalImageCompletionId, or imageUrls must be provided.

Either imageUrl or imageUrls is required.
imageUrlsArray[String]Optional. An array of publicly available image URLs for multi-frame video generation. Either this, originalImageCompletionId, or imageUrl must be provided.

Either imageUrl or imageUrls is required. Maximum 2 images. Used for first/last frame animations. [0] is first frame, [1] is last frame.
widthIntegerOptional. Video width in pixels.
heightIntegerOptional. Video height in pixels.
resolutionIntegerOptional. Video resolution. Alternative to width/height.
settingsObjectOptional. Additional generation settings.

mode: Video generation mode. Available values: 'default', 'veo3', 'veo31', 'wan25', 'sora2'.
withSound: Boolean. Whether to generate audio (only available for certain modes).
highQuality: Boolean. Whether to use high quality generation (only available for certain modes).
duration: Integer. Video duration in seconds. Range depends on the selected mode (typically 2-12 seconds).
organizationIdStringOptional. Organization UUID to deduct credits from (user must be a member)
OrganizationId can be found on your organization's dashboard.
webhookUrlStringOptional. URL to receive progress notifications when the video is ready.
hidePromptBoolean false.
const postData = {
        prompt: 'A beautiful sunset over the ocean',
        originalImageCompletionId: '123e4567-e89b-12d3-a456-426614174000',
        width: 1024,
        height: 1024,
        settings: {
            mode: 'default',
            withSound: false,
            highQuality: true,
            duration: 4
        },
        webhookUrl: 'https://your-webhook-url.com/callback'
    };
    
    fetch('https://api.letz.ai/videos', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
            'Authorization': 'Bearer YOUR_API_KEY' // Replace YOUR_API_KEY with your actual key
        },
        body: JSON.stringify(postData)
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));

Response

Returns a video object with the following structure:

FieldTypeDescription
idStringUnique identifier for the video
statusStringCurrent status: new, generating, ready, saved, failed, or interrupted
progressIntegerProgress value (0-100, where 100 is finished)
videoPathsObjectAvailable video file paths/URLs. Only available when status is 'ready'.
videoVersionsArrayAvailable video versions/formats
promptStringThe input prompt provided by the user
widthIntegerVideo width in pixels
heightIntegerVideo height in pixels
settingsObjectGeneration settings used
privacyStringPrivacy setting of the video (private, public)
createdAtStringCreation timestamp (ISO format)

Responses

CodeDescription
201The video was successfully created.
400Bad Request. Possible reasons:
  • Missing required 'prompt' field
  • Missing image source: either originalImageCompletionId, imageUrl, or imageUrls must be provided. Note: Either imageUrl or imageUrls is required.
  • Invalid image URLs or image IDs
  • Invalid settings parameters
  • organizationId: Must be a valid UUID format
401Unauthorized. The user is not authenticated.
402Payment Required. Insufficient credits to create the video (either user or organization credits depending on request).
500Internal Server Error. An unexpected error occurred during video creation.
GET/videos/{id}

This endpoint allows you to retrieve one video including its generation status. It can be used to track the progress of a video, for example during long polling when generating videos.

Path Parameters

ParameterTypeDescription
idStringRequired. The unique identifier for the video.

Response

FieldTypeDescription
idStringUnique identifier for your video
videoPathsObjectAvailable video file paths/URLs

Example:
{
  "original": "https://videos.letz.ai/.../video.mp4",
  "thumbnail": "https://videos.letz.ai/.../thumbnail.jpg"
}
videoVersionsArrayAvailable video versions/formats
userObjectReference to the User who made the request
originalImageCompletionObjectReference to the original image that was used to generate the video.
promptStringThe input prompt provided by the user
statusStringCurrent status: new, generating, ready, saved, failed, or interrupted
progressIntegerProgress value (0-100, where 100 is finished)
previewImageStringURL to a preview image (Base64)
widthIntegerVideo width in pixels
heightIntegerVideo height in pixels
settingsObjectGeneration settings used (mode, withSound, highQuality, duration)
isHotBooleanFlag indicating if trending
privacyStringPrivacy setting of the object
likesIntegerNumber of likes received
hasWatermarkBooleanIndicates if watermarked
isNsfwBooleanIndicates mature content
isUnsafeBooleanIndicates potential Terms of Service violation
createdAtStringCreation timestamp (ISO format)
 
    // Replace 'your-video-id' with the actual ID returned by POST
    fetch("https://api.letz.ai/videos/your-video-id", {
      method: 'GET',
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY' // Replace YOUR_API_KEY with your actual key
      }
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));

Responses

CodeDescription
200Success. Returns the video details.
401Unauthorized. Authentication token is missing or invalid.
404Not Found. The requested video could not be found.
500Internal Server Error. An unexpected error occurred while retrieving the video.
GET/videos

This endpoint allows you to retrieve multiple videos. It returns an array containing the amount of videos defined under the limit parameter.

Query Parameters

ParameterTypeDescription
sortByStringSort attribute (createdAt, likes)
sortOrderStringOptional. Available values: "ASC", "DESC"
pageIntegerPage number for pagination
limitIntegerResults per page
modelIdsArray[String]Optional. Filter by specific models
userIdStringOptional. Filter by creator's user ID
usernameStringOptional. Filter by creator's username
isHotBooleanOptional. Show only trending videos
statusStringOptional. Filter by status (new, generating, ready, saved, failed, interrupted)
 
    fetch("https://api.letz.ai/videos?page=1&limit=20&sortOrder=DESC&sortBy=createdAt", {
      method: 'GET',
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY' // Replace YOUR_API_KEY with your actual key
      }
    })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));

Response

Returns an array of video objects with the following structure:

FieldTypeDescription
idStringUnique identifier for the video
videoPathsObjectAvailable video file paths/URLs
videoVersionsArrayAvailable video versions/formats
userObjectUser object containing id, name, username, profilePicture, and other user details
promptStringThe input prompt used to generate the video
statusStringGeneration status: new, generating, ready, saved, failed, or interrupted
progressIntegerProgress value (0-100)
previewImageStringURL to preview image (Base64)
widthIntegerVideo width in pixels
heightIntegerVideo height in pixels
settingsObjectGeneration settings used
isHotBooleanWhether video is trending
privacyStringPrivacy setting (private, public)
likesIntegerNumber of likes
hasWatermarkBooleanWhether video has watermark
isNsfwBooleanWhether video contains mature content
createdAtStringCreation timestamp (ISO format)

Responses

CodeDescription
200Successfully retrieved the list of videos
400Bad Request. Possible reasons:
  • page: Must be a positive integer
  • limit: Must be a positive integer between 1 and 100
  • sortBy: Must be one of the allowed sort fields
  • sortOrder: Must be either 'ASC' or 'DESC'
401Unauthorized. Authentication token is missing or invalid
500Internal Server Error. An unexpected error occurred while retrieving videos

GET/models

This endpoint allows you to retrieve available models.

Query Parameters

ParameterTypeDescription
sortByStringOptional. Sort by "createdAt" or "usages"
pageIntegerOptional. Page number for pagination
limitIntegerOptional. Results per page. Default: 20
Maximum is 50
sortOrderStringOptional. Available values: "ASC", "DESC"
searchStringOptional. Search query
classStringOptional. Filter by "Person", "Object", or "Style"
 
    const queryParams = new URLSearchParams({
        sortBy: 'createdAt',   // or 'usages'
        page: 1,
        limit: 20,             // adjust as needed
        sortOrder: 'DESC',     // or 'ASC'
        search: 'yoursearchquery', //optional
        class: 'Person'        // or 'Object' or 'Style', optional
      });
      
      fetch("https://api.example.com/models?${queryParams}, {
        method: 'GET',
        headers: {
          'Authorization': 'Bearer YOUR_API_KEY'  // Replace YOUR_API_KEY with your actual key
        }
      })
      .then(response => response.json())
      .then(data => console.log(data))
      .catch(error => console.error('Error:', error));
GET/models/{id}

This endpoint allows you to retrieve one model.

Path Parameters

ParameterTypeDescription
idStringRequired. The unique identifier of the model.

Response

FieldTypeDescription
idStringUnique identifier of the model
userObjectReference to the user who created the model, including id, name, username, profilePicture, description, website, stats, and verification status
userIdStringID of the user who created the model
nameStringName of the model
usernameStringUsername of the model creator
classStringClass of the model (e.g., 'Person', 'Object', 'Style')
typeStringType of the model
descriptionStringDescription of the model
websiteStringAssociated website URL
statusStringCurrent status of the model
progressIntegerTraining progress (0-100)
privacyStringPrivacy setting of the model
usagesIntegerNumber of times the model has been used
imagesAvailableIntegerNumber of images available for this model
likesIntegerNumber of likes received
versionIntegerCurrent version number
thumbnailStringURL to the model's thumbnail image
thumbnailOptionsObjectAvailable thumbnail options
settingsObjectModel settings configuration
imagesObjectAssociated images data
isActiveBooleanWhether the model is currently active
blockedAtStringTimestamp when the model was blocked (if applicable)
createdAtStringCreation timestamp (ISO format)
systemVersionsArray[String]List of compatible system versions
versionsArray[Object]List of model versions including id, version number, storage path, system versions, status, creation date, and training date

Responses

CodeDescription
200Success. Returns the model details.
404Not Found. The requested model could not be found.

Only for Enterprise Customers

The following endpoints are only available for Enterprise Customers.

Please contact us to get access to the Model Training API.


Contact Us

Model Training API

POST/models

This endpoint allows you to create a new model.

Request Body

FieldTypeDescription
nameStringThe name of the model. Must contain only alphanumeric characters, underscores, and dots.

Max length: 50 characters
privacyStringPrivacy setting of the model. Must be a valid value from the PrivacyEnum.
trainingModeStringOptional. Training mode of the model.
Only available for 'person' class.
Possible values: 'default', 'slow'
Default is fast, but may be inaccurate (around 5 minutes).
Slow mode is more accurate, but takes longer to train (around 12 minutes).
classStringClass of the model. Must be a valid value from the ClassEnum (e.g. 'person').
descriptionStringOptional. Description of the model.
websiteStringOptional. Website associated with the model.
webhookUrlStringOptional. A webhook to trigger when the model has finished training. We will send the entire model object as POST to the URL you provide.
settingsArray[String]Optional. Settings for the model (e.g. ['NO_VIOLENCE, NO_ADULT_CONTENT']).
To disable all settings, pass an empty array [].
trainingDataUrlsArray[String]Required. URLs to the training data (max 50 URLs).
Make sure that the URLs are valid and publicly accessible.
typeString or nullOptional. Type of the model. Must contain only allowed characters (alphanumeric, commas, hyphens, etc.).

⚠️We do not recommend passing a type, unless you know exactly what you're doing.

If no type is passed, the type of the model is automatically generated based on the training data URLs.
The type field cannot be an empty string. It is either not passed at all (null) or a valid value like 'brunette woman with blue eyes'

To learn more about types, please refer to our guides.

Responses

CodeDescription
200The model was successfully created.
400Bad Request. Possible reasons:
  • 'name': Must contain only alphanumeric characters, underscores, and dots.
  • 'privacy': Must be a valid value from the PrivacyEnum.
  • 'type': Must contain only allowed characters (alphanumeric, commas, hyphens, etc.).
  • 'class': Must be a valid value from the ClassEnum.
  • 'trainingDataUrls': Must be an array of valid URLs (max 50).
  • Missing or invalid 'class' field (mandatory).
  • Failed to analyze model type due to invalid training data URLs.
401Unauthorized. The user is not authenticated.
404Not Found. The requested resource could not be found.
500Internal Server Error. An unexpected error occurred.
DELETE/models/{id}

This endpoint allows you to delete your model.

Path Parameters

ParameterTypeDescription
idStringRequired. ID of the model to delete.

Responses

CodeDescription
204Model deleted successfully
401Unauthorized
PATCH/models/{id}

This endpoint allows you to update information of your model.

Path Parameters

ParameterTypeDescription
idStringRequired. ID of the model to update.

Request Body

FieldTypeDescription
privacyStringOptional. Privacy setting of the model. Must be a valid value from the PrivacyEnum.
typeString or nullOptional. Type of the model. Must contain only allowed characters (alphanumeric, commas, hyphens, etc.).
descriptionStringOptional. Description of the model.
websiteStringOptional. Website associated with the model.
settingsArray[String]Optional. Settings for the model (e.g. ['NO_VIOLENCE, NO_ADULT_CONTENT']).
To disable all settings, pass an empty array [].

Responses

CodeDescription
200Success. Returns the updated model details.
400Bad Request. Invalid parameters provided.
401Unauthorized
404Not Found. The requested model could not be found.
PUT/models/{id}/thumbnail

This endpoint allows you to update the thumbnail of your model.

Path Parameters

ParameterTypeDescription
idStringRequired. ID of the model to update thumbnail.

Request Body

FieldTypeDescription
imageCompletionIdStringRequired. The ID of the image completion to use as thumbnail.

Responses

CodeDescription
200Success. Thumbnail updated successfully.
400Bad Request. Invalid image completion ID provided.
401Unauthorized
404Not Found. The model or image completion could not be found.

Building a LetzAI App using AI Code Builder

The recent success of AI Code Builder tools has made it easy for anyone to build their own apps and user interfaces.

At LetzAI we want to support you as much as we can to build your own apps on top of our API.


To instruct your LLMs and Codebuilders as efficiently as possible, we are providing an api_instructions.md file, that contains our API documentation in a way that can easily be read by humans and machines.


Open api_instructions.md

As for the different AI Code builders, we recommend using Lovable.dev

Configuring a Custom GPT

When configuring a CustomGPT, make sure to add your LetzAI API Key as a Bearer Token in the Authorization header.

Bearer Token Configuration
Setting the LetzAI API Key as a Bearer Token

System Prompt

In order for a CustomGPT to generate the desired output and use the right API endpoints, you will need to provide a system prompt. The requirements for your system prompt can vary depending on the use case of your GPT.


See Example LetzAIGPT System Prompt

OpenAPI Instructions

To configure the actions for your GPT, you will need an OpenAPI documentation. This documentation will help the GPT know the different endpoints and parameters available.


Access OpenAPI Documentation

LetzAI Plugins

LetzAI Plugins and Integrations are available on the following platforms:

ComfyUI Plugin

LetzAI Image Generation Custom Node for ComfyUI



Zapier.com

Zapier Image Generation Automation



Claude official LetzAI MCP

Include LetzAI into Claude by Anthrophic



LetzAI n8n Package

N8N Image Generation Automation



ChatGPT Demo - Custom GPT (Deprecated)

A custom GPT that uses the LetzAI API to generated images.

Request for Feedback

The LetzAI API is under constant development. We would love to hear your feedback. If you have any questions, suggestions or comments, please feel free to reach out to us at contact@letz.ai