letzai-api

letz-ai/letzai-skill · updated Apr 8, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/letz-ai/letzai-skill --skill letzai-api
0 commentsdiscussion
summary

Generate AI images and videos with multiple model options, custom trained models, editing, and upscaling via LetzAI API.

  • Supports three image models (Nano Banana Pro, Flux2 Max, SeeDream) and three video models (VEO, Kling, Wan) with configurable resolution modes and dimensions
  • Includes context-based image editing, skin fixing, and upscaling with strength control (1-3x)
  • Custom trained models for persons, objects, and styles accessible via @modelname syntax in prompts
  • Asynchronous
skill.md

LetzAI API Integration Skill

Overview

This skill enables Claude to help users integrate with the LetzAI API for AI-powered image and video generation, editing, and upscaling. Users can also leverage custom-trained AI models (persons, objects, styles) via the @modelname syntax.

Authentication

Setting Up Authentication

const headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer YOUR_API_KEY'
};
headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_API_KEY'
}

Core Workflows

1. Image Generation

Endpoint: POST /images

Required Parameters:

  • prompt (string): Text description of the desired image. Can include @modelname to use trained models.

Optional Parameters:

  • baseModel: AI model to use
    • "gemini-3-pro-image-preview" - Nano Banana Pro (recommended)
    • "flux2-max" - Flux2 Max
    • "seedream-4-5-251128" - SeeDream 4.5
  • mode: Resolution mode (varies by model)
    • Nano Banana Pro: "default", "2k", "4k"
    • Flux2 Max: "1k", "hd"
    • SeeDream: "2k", "4k"
  • width / height: Image dimensions (520-2160px)

Workflow:

  1. POST to /images with parameters
  2. Receive id in response
  3. Poll GET /images/{id} every 3 seconds
  4. When status === "ready", access imageVersions.original

For code examples, see examples/image_generation.js

2. Video Generation

Endpoint: POST /videos

Required Parameters:

  • prompt (string): Text description of the desired video
  • Source image (one of):
    • imageUrl: URL of source image
    • originalImageCompletionId: ID from previous image generation

Optional Parameters:

  • settings.mode: Video model
    • "default" - Default model
    • "veo31" - VEO 3.1
    • "kling26" - Kling 2.6
    • "wan25" - Wan 2.5
  • settings.duration: Video length in seconds (2-12 depending on model)

Workflow:

  1. Ensure you have a source image (generate one first if needed)
  2. POST to /videos with parameters
  3. Receive id in response
  4. Poll GET /videos/{id} every 2-3 seconds
  5. When status === "ready", access videoPaths

For code examples, see examples/video_generation.py

3. Image Editing (Context Editing)

Endpoint: POST /image-edits

Required Parameters:

  • mode: Edit mode
    • "context" - AI editing (primary mode)
    • "skin" - Skin fix
  • prompt: Edit instruction (e.g., "change background to beach")
  • Source image (one of):
    • imageUrl: URL of source image
    • inputImageUrls[]: Array of source image URLs (max 9)
    • originalImageCompletionId: ID of previously generated LetzAI image

Optional Parameters:

  • settings.model: "gemini-3-pro-image-preview", "flux2-max", "seedream-4-5-251128"
  • settings.resolution: "2k" (HD) or "4k" (Ultra HD)
  • settings.aspect_ratio: "1:1", "16:9", "9:16", "4:3", "3:4", "21:9", "9:21"
  • baseModel: Alternative to settings.model
  • webhookUrl: Optional callback URL
  • organizationId: Optional org ID for billing

Workflow:

  1. POST to /image-edits with parameters
  2. Receive id in response
  3. Poll GET /image-edits/{id} every 3 seconds
  4. When status === "ready", access generatedImageCompletion.imageVersions.original

Note: Inpainting (mode: "in") and Outpainting (mode: "out") are deprecated - use Context Editing instead.

4. Image Upscaling

Endpoint: POST /upscales

Required Parameters:

  • Source image (one of):
    • imageUrl: URL of source image
    • imageCompletionId: ID from previous image generation

Optional Parameters:

  • strength: Upscale factor (1-3)

Workflow:

  1. POST to /upscales with parameters
  2. Receive id in response
  3. Poll GET /upscales/{id} every 3 seconds
  4. When status === "ready", access upscaled image

5. Custom AI Models (Trained Models)

LetzAI users can train custom AI models on persons, objects, or styles via the web interface. These trained models can be used in prompts via the @modelname syntax.

List Models Endpoint: GET /models

Query Parameters:

  • page: int (default: 1)
  • limit: int (default: 10)
  • sortBy: "createdAt" | "usages"
  • sortOrder: "ASC" | "DESC"
  • class: "person" | "object" | "style"

Get Model Details: GET /models/{id}

Model Classes:

  • person: Trained on photos of a specific person
  • object: Trained on product/object images
  • style: Trained on artistic style examples

Using Models in Prompts: Tag models with @modelname syntax:

  • @john_doe on the beach at sunset - Use a person model
  • A product photo featuring @my_product - Use an object model
  • Portrait in @vintage_style aesthetic - Use a style model

Note: Model training is done via the LetzAI web interface (letz.ai), not via API.

Workflow Decision Tree

User wants to create an image:

  1. Determine appropriate model based on quality/cost needs
  2. Use POST /images with appropriate baseModel
  3. If using a trained model, include @modelname in the prompt
  4. Poll GET /images/{id} every 3s until ready
  5. Return imageVersions.original URL

User wants to use a custom trained model:

  1. Use GET /models to list available trained models (filter by class if needed)
  2. Include @modelname in the prompt when generating images
  3. Generate image normally with POST /images

User wants to edit an existing image:

  1. Obtain source image URL, inputImageUrls array, or originalImageCompletionId
  2. Use POST /image-edits with mode="context"
  3. Include settings for resolution, aspect_ratio, and model as needed
  4. Poll GET /image-edits/{id} every 3s until ready
  5. Return generatedImageCompletion.imageVersions.original

User wants to create a video:

  1. Ensure they have a source image (URL or imageCompletionId)
  2. If no source image, generate one first using /images
  3. Use POST /videos with desired settings
  4. Poll GET /videos/{id} every 2-3s until ready
  5. Return video URL from videoPaths

User wants to upscale an image:

  1. Obtain source image URL or imageCompletionId
  2. Use POST /upscales with desired strength
  3. Poll GET /upscales/{id} every 3s until ready
  4. Return upscaled image URL

Status Polling Pattern

LetzAI uses asynchronous generation. After any POST request, you must poll the corresponding GET endpoint until the job completes.

Status Values

Status Meaning
new Job created, queued for processing
in progress / generating Currently processing
ready Complete - fetch URLs from response
failed Error occurred - check error message

Polling Intervals

  • Images: Every 3 seconds
  • Videos: Every 2-3 seconds
  • Image Edits: Every 3 seconds
  • Upscales: Every 3 seconds

For detailed polling implementation, see examples/polling_pattern.md

Pricing Reference

Feature Model Credits
Image Gen Nano Banana Pro 80/160/240 (1k/HD/4K)
Image Gen Flux2 Max 60/120 (1k/HD)
Image Gen SeeDream 80/160 (HD/4K)
Editing Same as above Same pricing
Video Default 60 cr/sec (2-6 sec)
Video VEO 3.1 1500-6000 cr (8 sec)
Video Kling 2.6 750-1500 cr (5-10 sec)
Upscale All 40 cr

Error Handling

Common HTTP Status Codes

Status Meaning Solution
401 Invalid or missing API key Check Authorization header format
402 Insufficient credits Top up at letz.ai/subscription
400 Invalid parameters Verify baseModel, mode, dimensions
404 Resource not found Check the ID is correct
429 Rate limited Implement exponential backoff
500 Server error Retry after delay

Error Response Format

{
  "error": "Error description",
  "code": "ERROR_CODE"
}

Limitations

  • Async Generation: All generation is asynchronous - must poll for results
  • Video Source: Video generation requires a source image
  • Reference Images: Maximum 9 reference images for image editing
  • Model Training: Cannot train custom AI models via API - use letz.ai web interface
  • API Key Required: Paid subscription required for API access

Quick Reference: API Endpoints

Endpoint Method Purpose
/images GET List user's images
/images POST Create image (prompt, baseModel, mode, width, height)
/images/{id} GET Get image status & URLs (poll every 3s)
/images/{id}/interruption PUT Stop image generation
/images/{id}/privacy PUT Change image privacy
/videos GET List user's videos
/videos POST Create video (prompt, imageUrl, settings)
/videos/{id} GET Get video status & URLs (poll every 2-3s)
/videos/{id}/interruption PUT Stop video generation
/videos/{id}/privacy PUT Change video privacy
/image-edits GET List user's edits
/image-edits POST Edit image (mode, prompt, imageUrl/inputImageUrls, settings)
/image-edits/{id} GET Get edit status & URLs (poll every 3s)
/upscales POST Upscale image (imageUrl/imageUrls, strength, mode, size)
/upscales/{id} GET Get upscale status & URLs (poll every 3s)
/models GET List trained AI models (filter by class: person/object/style)
/models/{id} GET Get specific model details

Key Response Fields

  • Images/Upscales: imageVersions.original, imageVersions["1920x1920"], imageVersions["640x640"]
  • Edits: generatedImageCompletion.imageVersions.original
  • Videos: videoPaths object, videoVersions array
  • Status values: new, in progress/generating, ready, failed

Additional Resources

how to use letzai-api

How to use letzai-api on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add letzai-api
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/letz-ai/letzai-skill --skill letzai-api

The skills CLI fetches letzai-api from GitHub repository letz-ai/letzai-skill and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/letzai-api

Reload or restart Cursor to activate letzai-api. Access the skill through slash commands (e.g., /letzai-api) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

Task Automation & Efficiency

Automate repetitive workflows and reduce manual effort

Example

Generate reports, summarize documents, draft communications

Save 3-5 hours per week on routine tasks

Knowledge Enhancement

Learn new skills, understand complex topics, get expert guidance

Example

Explain concepts, provide examples, suggest learning resources

Accelerate learning and skill development by 2x

Quality Improvement

Enhance output quality through reviews, suggestions, and refinements

Example

Review drafts, suggest improvements, catch errors

Improve work quality by 30-40% with less effort

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client with skill support
  • Clear understanding of task or problem to solve
  • Willingness to iterate and refine outputs

Time Estimate

15-45 minutes depending on use case complexity

Installation Steps

  1. 1.Install skill using provided installation command
  2. 2.Test with simple use case relevant to your work
  3. 3.Evaluate output quality and relevance
  4. 4.Iterate on prompts to improve results
  5. 5.Integrate into regular workflow if valuable

Common Pitfalls

  • Expecting perfect results without iteration
  • Not providing enough context in prompts
  • Using skill for tasks outside its intended scope
  • Accepting outputs without review and validation

Best Practices

✓ Do

  • +Start with clear, specific prompts
  • +Provide relevant context and constraints
  • +Review and refine all outputs before using
  • +Iterate to improve output quality
  • +Document successful prompt patterns

✗ Don't

  • Don't use without understanding skill limitations
  • Don't skip validation of outputs
  • Don't share sensitive information in prompts
  • Don't expect skill to replace human judgment

💡 Pro Tips

  • Be specific about desired format and style
  • Ask for multiple options to choose from
  • Request explanations to understand reasoning
  • Combine AI efficiency with human expertise

When to Use This

✓ Use When

Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.

✗ Avoid When

Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.

Learning Path

  1. 1Familiarize yourself with skill capabilities and limitations
  2. 2Start with low-risk, non-critical tasks
  3. 3Progress to more complex and valuable use cases
  4. 4Build expertise through regular use and experimentation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.664 reviews
  • Camila Agarwal· Dec 28, 2024

    letzai-api fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Amelia Iyer· Dec 16, 2024

    We added letzai-api from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Aditi Haddad· Dec 4, 2024

    letzai-api has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Rahul Santra· Nov 27, 2024

    Registry listing for letzai-api matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Camila Verma· Nov 27, 2024

    letzai-api reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Emma Lopez· Nov 23, 2024

    letzai-api fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Chinedu Patel· Nov 19, 2024

    letzai-api has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Alexander Flores· Nov 7, 2024

    Solid pick for teams standardizing on skills: letzai-api is focused, and the summary matches what you get after install.

  • Tariq Mehta· Nov 3, 2024

    Registry listing for letzai-api matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Alexander Sethi· Oct 26, 2024

    letzai-api has been reliable in day-to-day use. Documentation quality is above average for community skills.

showing 1-10 of 64

1 / 7