npx skills add https://github.com/letz-ai/letzai-skill --skill letzai-api此技能使 Claude 能够帮助用户集成 LetzAI API,以进行 AI 驱动的图像和视频生成、编辑和放大。用户还可以通过 @modelname 语法利用自定义训练的 AI 模型(人物、对象、风格)。
https://api.letz.aiconst headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
};
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
}
端点: POST /images
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.
https://api.letz.aiconst headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
};
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
}
Endpoint: POST /images
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
必需参数:
prompt (string): 期望图像的文本描述。可以包含 @modelname 来使用训练好的模型。可选参数:
baseModel: 要使用的 AI 模型
"gemini-3-pro-image-preview" - Nano Banana Pro(推荐)"flux2-max" - Flux2 Max"seedream-4-5-251128" - SeeDream 4.5mode: 分辨率模式(因模型而异)
"default", "2k", "4k""1k", "hd""2k", "4k"width / height: 图像尺寸(520-2160px)工作流程:
/imagesidGET /images/{id}status === "ready" 时,访问 imageVersions.original代码示例请参见 examples/image_generation.js
端点: POST /videos
必需参数:
prompt (string): 期望视频的文本描述imageUrl: 源图像的 URLoriginalImageCompletionId: 先前图像生成的 ID可选参数:
settings.mode: 视频模型
"default" - 默认模型"veo31" - VEO 3.1"kling26" - Kling 2.6"wan25" - Wan 2.5settings.duration: 视频长度,单位秒(2-12 秒,取决于模型)工作流程:
/videosidGET /videos/{id}status === "ready" 时,访问 videoPaths代码示例请参见 examples/video_generation.py
端点: POST /image-edits
必需参数:
mode: 编辑模式
"context" - AI 编辑(主要模式)"skin" - 皮肤修复prompt: 编辑指令(例如,"change background to beach")imageUrl: 源图像的 URLinputImageUrls[]: 源图像 URL 数组(最多 9 个)originalImageCompletionId: 先前生成的 LetzAI 图像的 ID可选参数:
settings.model: "gemini-3-pro-image-preview", "flux2-max", "seedream-4-5-251128"settings.resolution: "2k" (HD) 或 "4k" (Ultra HD)settings.aspect_ratio: "1:1", "16:9", "9:16", "4:3", "3:4", "21:9", "9:21"baseModel: settings.model 的替代项webhookUrl: 可选的回调 URLorganizationId: 用于计费的可选组织 ID工作流程:
/image-editsidGET /image-edits/{id}status === "ready" 时,访问 generatedImageCompletion.imageVersions.original注意: 局部重绘 (mode: "in") 和扩展画布 (mode: "out") 已弃用 - 请改用上下文编辑。
端点: POST /upscales
必需参数:
imageUrl: 源图像的 URLimageCompletionId: 先前图像生成的 ID可选参数:
strength: 放大系数(1-3)工作流程:
/upscalesidGET /upscales/{id}status === "ready" 时,访问放大后的图像LetzAI 用户可以通过 Web 界面训练关于人物、对象或风格的自定义 AI 模型。这些训练好的模型可以通过 @modelname 语法在提示词中使用。
列出模型端点: GET /models
查询参数:
page: int (默认: 1)limit: int (默认: 10)sortBy: "createdAt" | "usages"sortOrder: "ASC" | "DESC"class: "person" | "object" | "style"获取模型详情: GET /models/{id}
模型类别:
person: 基于特定人物的照片训练object: 基于产品/对象图像训练style: 基于艺术风格示例训练在提示词中使用模型: 使用 @modelname 语法标记模型:
@john_doe on the beach at sunset - 使用人物模型A product photo featuring @my_product - 使用对象模型Portrait in @vintage_style aesthetic - 使用风格模型注意: 模型训练通过 LetzAI Web 界面 (letz.ai) 完成,而非通过 API。
POST /images 并指定合适的 baseModel@modelnameGET /images/{id} 直到就绪imageVersions.original URLGET /models 列出可用的训练好的模型(如果需要,按类别过滤)@modelnamePOST /images 生成图像POST /image-edits 并设置 mode="context"GET /image-edits/{id} 直到就绪generatedImageCompletion.imageVersions.original/images 生成一个POST /videos 并指定所需的设置GET /videos/{id} 直到就绪videoPaths 返回视频 URLPOST /upscales 并指定所需的 strengthGET /upscales/{id} 直到就绪LetzAI 使用异步生成。在任何 POST 请求之后,您必须轮询相应的 GET 端点,直到作业完成。
| 状态 | 含义 |
|---|---|
new | 作业已创建,排队等待处理 |
in progress / generating | 正在处理中 |
ready | 完成 - 从响应中获取 URL |
failed | 发生错误 - 检查错误信息 |
详细的轮询实现请参见 examples/polling_pattern.md
| 功能 | 模型 | 积分 |
|---|---|---|
| 图像生成 | Nano Banana Pro | 80/160/240 (1k/HD/4K) |
| 图像生成 | Flux2 Max | 60/120 (1k/HD) |
| 图像生成 | SeeDream | 80/160 (HD/4K) |
| 编辑 | 同上 | 相同定价 |
| 视频 | 默认 | 60 积分/秒 (2-6 秒) |
| 视频 | VEO 3.1 | 1500-6000 积分 (8 秒) |
| 视频 | Kling 2.6 | 750-1500 积分 (5-10 秒) |
| 放大 | 全部 | 40 积分 |
| 状态码 | 含义 | 解决方案 |
|---|---|---|
| 401 | API 密钥无效或缺失 | 检查 Authorization 头格式 |
| 402 | 积分不足 | 在 letz.ai/subscription 充值 |
| 400 | 参数无效 | 验证 baseModel、mode、尺寸 |
| 404 | 资源未找到 | 检查 ID 是否正确 |
| 429 | 速率限制 | 实施指数退避 |
| 500 | 服务器错误 | 延迟后重试 |
{
"error": "错误描述",
"code": "ERROR_CODE"
}
| 端点 | 方法 | 用途 |
|---|---|---|
/images | GET | 列出用户的图像 |
/images | POST | 创建图像 (prompt, baseModel, mode, width, height) |
/images/{id} | GET | 获取图像状态和 URL(每 3 秒轮询) |
/images/{id}/interruption | PUT | 停止图像生成 |
/images/{id}/privacy | PUT | 更改图像隐私设置 |
/videos | GET | 列出用户的视频 |
/videos | POST | 创建视频 (prompt, imageUrl, settings) |
/videos/{id} | GET | 获取视频状态和 URL(每 2-3 秒轮询) |
/videos/{id}/interruption | PUT | 停止视频生成 |
/videos/{id}/privacy | PUT | 更改视频隐私设置 |
/image-edits | GET | 列出用户的编辑 |
/image-edits | POST | 编辑图像 (mode, prompt, imageUrl/inputImageUrls, settings) |
/image-edits/{id} | GET | 获取编辑状态和 URL(每 3 秒轮询) |
/upscales | POST | 放大图像 (imageUrl/imageUrls, strength, mode, size) |
/upscales/{id} | GET | 获取放大状态和 URL(每 3 秒轮询) |
/models | GET | 列出训练好的 AI 模型(按类别过滤: person/object/style) |
/models/{id} | GET | 获取特定模型详情 |
imageVersions.original, imageVersions["1920x1920"], imageVersions["640x640"]generatedImageCompletion.imageVersions.originalvideoPaths 对象, videoVersions 数组new, in progress/generating, ready, failed每周安装数
877
代码仓库
首次出现
2026年1月27日
安全审计
安装于
opencode868
gemini-cli867
kimi-cli866
amp866
github-copilot866
codex866
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.5mode: Resolution mode (varies by model)
"default", "2k", "4k""1k", "hd""2k", "4k"width / height: Image dimensions (520-2160px)Workflow:
/images with parametersid in responseGET /images/{id} every 3 secondsstatus === "ready", access imageVersions.originalFor code examples, see examples/image_generation.js
Endpoint: POST /videos
Required Parameters:
prompt (string): Text description of the desired videoimageUrl: URL of source imageoriginalImageCompletionId: ID from previous image generationOptional Parameters:
settings.mode: Video model
"default" - Default model"veo31" - VEO 3.1"kling26" - Kling 2.6"wan25" - Wan 2.5settings.duration: Video length in seconds (2-12 depending on model)Workflow:
/videos with parametersid in responseGET /videos/{id} every 2-3 secondsstatus === "ready", access videoPathsFor code examples, see examples/video_generation.py
Endpoint: POST /image-edits
Required Parameters:
mode: Edit mode
"context" - AI editing (primary mode)"skin" - Skin fixprompt: Edit instruction (e.g., "change background to beach")imageUrl: URL of source imageinputImageUrls[]: Array of source image URLs (max 9)originalImageCompletionId: ID of previously generated LetzAI imageOptional 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.modelwebhookUrl: Optional callback URLorganizationId: Optional org ID for billingWorkflow:
/image-edits with parametersid in responseGET /image-edits/{id} every 3 secondsstatus === "ready", access generatedImageCompletion.imageVersions.originalNote: Inpainting (mode: "in") and Outpainting (mode: "out") are deprecated - use Context Editing instead.
Endpoint: POST /upscales
Required Parameters:
imageUrl: URL of source imageimageCompletionId: ID from previous image generationOptional Parameters:
strength: Upscale factor (1-3)Workflow:
/upscales with parametersid in responseGET /upscales/{id} every 3 secondsstatus === "ready", access upscaled imageLetzAI 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 personobject: Trained on product/object imagesstyle: Trained on artistic style examplesUsing Models in Prompts: Tag models with @modelname syntax:
@john_doe on the beach at sunset - Use a person modelA product photo featuring @my_product - Use an object modelPortrait in @vintage_style aesthetic - Use a style modelNote: Model training is done via the LetzAI web interface (letz.ai), not via API.
POST /images with appropriate baseModel@modelname in the promptGET /images/{id} every 3s until readyimageVersions.original URLGET /models to list available trained models (filter by class if needed)@modelname in the prompt when generating imagesPOST /imagesPOST /image-edits with mode="context"GET /image-edits/{id} every 3s until readygeneratedImageCompletion.imageVersions.original/imagesPOST /videos with desired settingsGET /videos/{id} every 2-3s until readyvideoPathsPOST /upscales with desired strengthGET /upscales/{id} every 3s until readyLetzAI uses asynchronous generation. After any POST request, you must poll the corresponding GET endpoint until the job completes.
| 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 |
For detailed polling implementation, see examples/polling_pattern.md
| 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 |
| 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": "Error description",
"code": "ERROR_CODE"
}
| 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 |
imageVersions.original, imageVersions["1920x1920"], imageVersions["640x640"]generatedImageCompletion.imageVersions.originalvideoPaths object, videoVersions arraynew, in progress/generating, ready, failedWeekly Installs
877
Repository
First Seen
Jan 27, 2026
Security Audits
Installed on
opencode868
gemini-cli867
kimi-cli866
amp866
github-copilot866
codex866
超能力技能使用指南:AI助手技能调用优先级与工作流程详解
37,500 周安装
Gemini Interactions API 指南:统一接口、智能体交互与服务器端状态管理
833 周安装
Apollo MCP 服务器:让AI代理通过GraphQL API交互的完整指南
834 周安装
智能体记忆系统构建指南:分块策略、向量存储与检索优化
835 周安装
Scrapling官方网络爬虫框架 - 自适应解析、绕过Cloudflare、Python爬虫库
836 周安装
抽奖赢家选取器 - 随机选择工具,支持CSV、Excel、Google Sheets,公平透明
838 周安装
Medusa 前端开发指南:使用 SDK、React Query 构建电商商店
839 周安装