
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
/imagesThis endpoint allows you to create images.
Parameters
| Parameter | Type | Description |
|---|---|---|
| prompt | String | Required. The input prompt for image generation |
| width | Integer | Min: 520, Default: 1600, Max: 2160 |
| height | Integer | Min: 520, Default: 1600, Max: 2160 |
| quality | Integer | Defines how many steps the generation should take. Higher is slower, but generally better quality. Min: 1, Default: 2, Max: 5 |
| creativity | Integer | Defines 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 |
| hasWatermark | Boolean | Defines whether to set a watermark or not. Default is true |
| systemVersion | Integer | Allowed values: 2, 3 Use LetzAI V2, or V3 (newest). Default is the version currently selected on your account. |
| mode | String | Select 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. |
| organizationId | String | Optional. 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));/images/{id}/interruptionThis endpoint allows you to interrupt the image generation process for a specific image.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| id | String | The unique identifier for the image. |
Responses
| Code | Description |
|---|---|
| 204 | No Content - Success |
| 400 | Bad Request |
/images/{id}/privacyThis 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
| Parameter | Type | Description |
|---|---|---|
| id | String | The unique identifier for the image. |
Request Body
| Field | Type | Description |
|---|---|---|
| privacy | String | The privacy status. Default: private. Allowed values: "private", "public" |
{ "privacy": "public" }Responses
| Code | Description |
|---|---|
| 204 | No Content - Success |
| 400 | Bad Request |
/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
| Field | Type | Description |
|---|---|---|
| id | String | Unique identifier for your image |
| imageVersions | Object | Available image sizes/versions Example: { |
| user | Object | Reference to the User who made the request |
| originalImageCompletion | Object | Exists only for edited images. Reference to the originalImageCompletion that was used to edit an image. |
| prompt | String | The input prompt provided by the user |
| status | String | Current status: new, in progress, ready or failed |
| progressMessage | String | Message describing the current progress |
| progress | Integer | Progress value (0-100, where 100 is finished) |
| previewImage | String | URL to a preview image (Base64) |
| isHot | Boolean | Flag indicating if trending |
| privacy | String | Privacy setting of the object |
| likes | Integer | Number of likes received |
| regenerations | Integer | Count of regenerations |
| hasWatermark | Boolean | Indicates if watermarked |
| isNsfw | Boolean | Indicates mature content |
| isUnsafe | Boolean | Indicates potential Terms of Service violation |
| createdAt | String | Creation timestamp (ISO format) |
| models | Object | AI Models used for this image |
| systemVersion | Integer | System 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));/imagesThis endpoint allows you to retrieve multiple images. It returns an array containing the amount of images defined under the limit parameter.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| sortBy | String | Sort attribute (createdAt, likes, regenerations) |
| sortOrder | String | Optional. Available values: "ASC", "DESC" |
| page | Integer | Page number for pagination |
| limit | Integer | Results per page |
| modelIds | Array[String] | Optional. Filter by specific models |
| userId | String | Optional. Filter by creator`'s user ID |
| username | String | Optional. Filter by creator`'s username |
| isHot | Boolean | Optional. Show only trending images |
| onlyFollowing | Boolean | Optional. 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:
| Field | Type | Description |
|---|---|---|
| id | String | Unique identifier for the image |
| imageVersions | Object | Available image sizes/versions Example: { |
| user | Object | User object containing id, name, username, profilePicture, and other user details |
| imageEdit | Object | Present for edited images. Contains edit details, original image reference, and edit settings |
| prompt | String | The input prompt used to generate the image |
| status | String | Generation status: new, in progress, ready, or failed |
| progressMessage | String | Message describing current progress |
| progress | Integer | Progress value (0-100) |
| previewImage | String | URL to preview image (Base64) |
| isHot | Boolean | Whether image is trending |
| privacy | String | Privacy setting (private, public) |
| likes | Integer | Number of likes |
| regenerations | Integer | Count of regenerations |
| systemVersion | Integer | System version used |
| hasWatermark | Boolean | Whether image has watermark |
| isNsfw | Boolean | Whether image contains mature content |
| webhookUrl | String | Webhook URL for notifications |
| hidePrompt | Boolean | Whether prompt is hidden |
| createdAt | String | Creation timestamp (ISO format) |
| models | Array[Object] | AI models used for image generation |
Responses
| Code | Description |
|---|---|
| 200 | Successfully retrieved the list of images |
| 400 | Bad Request. Possible reasons:
|
| 401 | Unauthorized. Authentication token is missing or invalid |
| 403 | Forbidden. User does not have permission to access these images |
| 500 | Internal Server Error. An unexpected error occurred while retrieving images |
/upscaleThis 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
| Field | Type | Description |
|---|---|---|
| imageUrls | String | Optional. The URLs of the images to be upscaled. Must be a publicly available URLs. |
| strength | Integer | Required. The strength of the upscaling process. Min. 1, Max. 3. |
| mode | Integer | Optional. The upscaling mode. Sharp is more crisp. Soft is more natural. Default is Sharp. |
| size | Integer | Optional. The resolution of the upscaled image in MP. Min. 2, Max. 12. |
| organizationId | String | Optional. Organization UUID to deduct credits from (user must be a member) OrganizationId can be found on your organizations's dashboard. |
Response
/upscale/{id}Path Parameters
| Parameter | Type | Description |
|---|---|---|
| id | String | Required. The unique identifier of the upscale operation. |
Response
/image-editsThis endpoint allows you to edit images.
Parameters
| Parameter | Type | Description |
|---|---|---|
| mode | String | Required. The Editing Mode. Use either:
|
| imageCompletionsCount | Integer | Amount of images to generate for inpainting and outpainting. Default: 3, Maximum: 3 Does not work with skin mode. |
| originalImageCompletionId | String | Optional. The original image ID of the LetzAI image you want to edit. Either this or imageUrl is required. |
| prompt | String | Your prompt. Can contain models with @tags. |
| mask | String | Only 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. |
| imageUrl | String | Optional. The URL to the image you want to edit. Must be publicly available. Either this, inputImageUrls or originalImageCompletionId is required. |
| inputImageUrls | String[] | 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. |
| settings | Object | Required 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. |
| organizationId | String | Optional. Organization UUID to deduct credits from (user must be a member) OrganizationId can be found on your organizations's dashboard. |
| webhookUrl | String | Optional. The URL to the webhook you want to send the image edit to. |
Responses
| Code | Description |
|---|---|
| 201 | The 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
} |
| 400 | Bad Request. Possible reasons:
|
| 401 | Unauthorized. The user is not authenticated, or user is not a member of the specified organization. |
| 402 | Payment Required. Insufficient credits to create the image edit (either user or organization credits depending on request). |
| 403 | Forbidden. User does not have permission to create image edits. |
| 500 | Internal Server Error. An unexpected error occurred during image edit creation. |
/image-editsQuery Parameters
| Parameter | Type | Description |
|---|---|---|
| page | Integer | Optional. Default: 1 |
| limit | Integer | Optional. Default: 10 Maximum is 50 |
| sortBy | String | Optional. Field to sort by |
| sortOrder | String | Optional. Available values: "ASC", "DESC" |
| status | String | Optional. Available values: "new", "generating", "ready", "saved", "failed", "interrupted" |
Responses
| Code | Description |
|---|---|
| 200 | Successfully 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
}
} |
| 400 | Bad Request. Possible reasons:
|
| 401 | Unauthorized. Authentication token is missing or invalid. |
| 403 | Forbidden. User does not have permission to access image edits. |
| 500 | Internal Server Error. An unexpected error occurred while retrieving image edits. |
/image-edits/{id}Path Parameters
| Parameter | Type | Description |
|---|---|---|
| id | String | ID of the resource to retrieve |
Response
/videosThis 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
| Field | Type | Description |
|---|---|---|
| prompt | String | Required. Text description for the video generation. |
| originalImageCompletionId | String | Optional. The unique identifier of a LetzAI image to use as the source. Either this, imageUrl, or imageUrls must be provided. |
| imageUrl | String | Optional. 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. |
| imageUrls | Array[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. |
| width | Integer | Optional. Video width in pixels. |
| height | Integer | Optional. Video height in pixels. |
| resolution | Integer | Optional. Video resolution. Alternative to width/height. |
| settings | Object | Optional. 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). |
| organizationId | String | Optional. Organization UUID to deduct credits from (user must be a member) OrganizationId can be found on your organization's dashboard. |
| webhookUrl | String | Optional. URL to receive progress notifications when the video is ready. |
| hidePrompt | Boolean | 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:
| Field | Type | Description |
|---|---|---|
| id | String | Unique identifier for the video |
| status | String | Current status: new, generating, ready, saved, failed, or interrupted |
| progress | Integer | Progress value (0-100, where 100 is finished) |
| videoPaths | Object | Available video file paths/URLs. Only available when status is 'ready'. |
| videoVersions | Array | Available video versions/formats |
| prompt | String | The input prompt provided by the user |
| width | Integer | Video width in pixels |
| height | Integer | Video height in pixels |
| settings | Object | Generation settings used |
| privacy | String | Privacy setting of the video (private, public) |
| createdAt | String | Creation timestamp (ISO format) |
Responses
| Code | Description |
|---|---|
| 201 | The video was successfully created. |
| 400 | Bad Request. Possible reasons:
|
| 401 | Unauthorized. The user is not authenticated. |
| 402 | Payment Required. Insufficient credits to create the video (either user or organization credits depending on request). |
| 500 | Internal Server Error. An unexpected error occurred during video creation. |
/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
| Parameter | Type | Description |
|---|---|---|
| id | String | Required. The unique identifier for the video. |
Response
| Field | Type | Description |
|---|---|---|
| id | String | Unique identifier for your video |
| videoPaths | Object | Available video file paths/URLs Example: { |
| videoVersions | Array | Available video versions/formats |
| user | Object | Reference to the User who made the request |
| originalImageCompletion | Object | Reference to the original image that was used to generate the video. |
| prompt | String | The input prompt provided by the user |
| status | String | Current status: new, generating, ready, saved, failed, or interrupted |
| progress | Integer | Progress value (0-100, where 100 is finished) |
| previewImage | String | URL to a preview image (Base64) |
| width | Integer | Video width in pixels |
| height | Integer | Video height in pixels |
| settings | Object | Generation settings used (mode, withSound, highQuality, duration) |
| isHot | Boolean | Flag indicating if trending |
| privacy | String | Privacy setting of the object |
| likes | Integer | Number of likes received |
| hasWatermark | Boolean | Indicates if watermarked |
| isNsfw | Boolean | Indicates mature content |
| isUnsafe | Boolean | Indicates potential Terms of Service violation |
| createdAt | String | Creation 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
| Code | Description |
|---|---|
| 200 | Success. Returns the video details. |
| 401 | Unauthorized. Authentication token is missing or invalid. |
| 404 | Not Found. The requested video could not be found. |
| 500 | Internal Server Error. An unexpected error occurred while retrieving the video. |
/videosThis endpoint allows you to retrieve multiple videos. It returns an array containing the amount of videos defined under the limit parameter.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| sortBy | String | Sort attribute (createdAt, likes) |
| sortOrder | String | Optional. Available values: "ASC", "DESC" |
| page | Integer | Page number for pagination |
| limit | Integer | Results per page |
| modelIds | Array[String] | Optional. Filter by specific models |
| userId | String | Optional. Filter by creator's user ID |
| username | String | Optional. Filter by creator's username |
| isHot | Boolean | Optional. Show only trending videos |
| status | String | Optional. 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:
| Field | Type | Description |
|---|---|---|
| id | String | Unique identifier for the video |
| videoPaths | Object | Available video file paths/URLs |
| videoVersions | Array | Available video versions/formats |
| user | Object | User object containing id, name, username, profilePicture, and other user details |
| prompt | String | The input prompt used to generate the video |
| status | String | Generation status: new, generating, ready, saved, failed, or interrupted |
| progress | Integer | Progress value (0-100) |
| previewImage | String | URL to preview image (Base64) |
| width | Integer | Video width in pixels |
| height | Integer | Video height in pixels |
| settings | Object | Generation settings used |
| isHot | Boolean | Whether video is trending |
| privacy | String | Privacy setting (private, public) |
| likes | Integer | Number of likes |
| hasWatermark | Boolean | Whether video has watermark |
| isNsfw | Boolean | Whether video contains mature content |
| createdAt | String | Creation timestamp (ISO format) |
Responses
| Code | Description |
|---|---|
| 200 | Successfully retrieved the list of videos |
| 400 | Bad Request. Possible reasons:
|
| 401 | Unauthorized. Authentication token is missing or invalid |
| 500 | Internal Server Error. An unexpected error occurred while retrieving videos |
/modelsThis endpoint allows you to retrieve available models.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| sortBy | String | Optional. Sort by "createdAt" or "usages" |
| page | Integer | Optional. Page number for pagination |
| limit | Integer | Optional. Results per page. Default: 20 Maximum is 50 |
| sortOrder | String | Optional. Available values: "ASC", "DESC" |
| search | String | Optional. Search query |
| class | String | Optional. 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));/models/{id}This endpoint allows you to retrieve one model.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| id | String | Required. The unique identifier of the model. |
Response
| Field | Type | Description |
|---|---|---|
| id | String | Unique identifier of the model |
| user | Object | Reference to the user who created the model, including id, name, username, profilePicture, description, website, stats, and verification status |
| userId | String | ID of the user who created the model |
| name | String | Name of the model |
| username | String | Username of the model creator |
| class | String | Class of the model (e.g., 'Person', 'Object', 'Style') |
| type | String | Type of the model |
| description | String | Description of the model |
| website | String | Associated website URL |
| status | String | Current status of the model |
| progress | Integer | Training progress (0-100) |
| privacy | String | Privacy setting of the model |
| usages | Integer | Number of times the model has been used |
| imagesAvailable | Integer | Number of images available for this model |
| likes | Integer | Number of likes received |
| version | Integer | Current version number |
| thumbnail | String | URL to the model's thumbnail image |
| thumbnailOptions | Object | Available thumbnail options |
| settings | Object | Model settings configuration |
| images | Object | Associated images data |
| isActive | Boolean | Whether the model is currently active |
| blockedAt | String | Timestamp when the model was blocked (if applicable) |
| createdAt | String | Creation timestamp (ISO format) |
| systemVersions | Array[String] | List of compatible system versions |
| versions | Array[Object] | List of model versions including id, version number, storage path, system versions, status, creation date, and training date |
Responses
| Code | Description |
|---|---|
| 200 | Success. Returns the model details. |
| 404 | Not 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
/modelsThis endpoint allows you to create a new model.
Request Body
| Field | Type | Description |
|---|---|---|
| name | String | The name of the model. Must contain only alphanumeric characters, underscores, and dots. Max length: 50 characters |
| privacy | String | Privacy setting of the model. Must be a valid value from the PrivacyEnum. |
| trainingMode | String | Optional. 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). |
| class | String | Class of the model. Must be a valid value from the ClassEnum (e.g. 'person'). |
| description | String | Optional. Description of the model. |
| website | String | Optional. Website associated with the model. |
| webhookUrl | String | Optional. A webhook to trigger when the model has finished training. We will send the entire model object as POST to the URL you provide. |
| settings | Array[String] | Optional. Settings for the model (e.g. ['NO_VIOLENCE, NO_ADULT_CONTENT']). To disable all settings, pass an empty array []. |
| trainingDataUrls | Array[String] | Required. URLs to the training data (max 50 URLs). Make sure that the URLs are valid and publicly accessible. |
| type | String or null | Optional. 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
| Code | Description |
|---|---|
| 200 | The model was successfully created. |
| 400 | Bad Request. Possible reasons:
|
| 401 | Unauthorized. The user is not authenticated. |
| 404 | Not Found. The requested resource could not be found. |
| 500 | Internal Server Error. An unexpected error occurred. |
/models/{id}This endpoint allows you to delete your model.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| id | String | Required. ID of the model to delete. |
Responses
| Code | Description |
|---|---|
| 204 | Model deleted successfully |
| 401 | Unauthorized |
/models/{id}This endpoint allows you to update information of your model.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| id | String | Required. ID of the model to update. |
Request Body
| Field | Type | Description |
|---|---|---|
| privacy | String | Optional. Privacy setting of the model. Must be a valid value from the PrivacyEnum. |
| type | String or null | Optional. Type of the model. Must contain only allowed characters (alphanumeric, commas, hyphens, etc.). |
| description | String | Optional. Description of the model. |
| website | String | Optional. Website associated with the model. |
| settings | Array[String] | Optional. Settings for the model (e.g. ['NO_VIOLENCE, NO_ADULT_CONTENT']). To disable all settings, pass an empty array []. |
Responses
| Code | Description |
|---|---|
| 200 | Success. Returns the updated model details. |
| 400 | Bad Request. Invalid parameters provided. |
| 401 | Unauthorized |
| 404 | Not Found. The requested model could not be found. |
/models/{id}/thumbnailThis endpoint allows you to update the thumbnail of your model.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| id | String | Required. ID of the model to update thumbnail. |
Request Body
| Field | Type | Description |
|---|---|---|
| imageCompletionId | String | Required. The ID of the image completion to use as thumbnail. |
Responses
| Code | Description |
|---|---|
| 200 | Success. Thumbnail updated successfully. |
| 400 | Bad Request. Invalid image completion ID provided. |
| 401 | Unauthorized |
| 404 | Not 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.

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
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