sleek-design-mobile-apps by sleekdotdesign/agent-skills
npx skills add https://github.com/sleekdotdesign/agent-skills --skill sleek-design-mobile-appssleek.design 是一个由 AI 驱动的移动应用设计工具。您可以通过 /api/v1/* 的 REST API 与其交互,以创建项目、用通俗语言描述您想要构建的内容,并获取渲染后的屏幕截图。所有通信均使用标准的 HTTP 协议,并采用承载令牌认证。
基础 URL : https://sleek.design
认证 : 在每个 /api/v1/* 请求中添加 Authorization: Bearer $SLEEK_API_KEY
内容类型 : application/json (请求和响应)
CORS : 在所有 /api/v1/* 端点上启用
在 https://sleek.design/dashboard/api-keys 创建 API 密钥。完整的密钥值仅在创建时显示一次——请将其存储在 环境变量中。
sleek.design is an AI-powered mobile app design tool. You interact with it via a REST API at /api/v1/* to create projects, describe what you want built in plain language, and get back rendered screens. All communication is standard HTTP with bearer token auth.
Base URL : https://sleek.design Auth : Authorization: Bearer $SLEEK_API_KEY on every /api/v1/* request Content-Type : application/json (requests and responses) CORS : Enabled on all /api/v1/* endpoints
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
暂无相关 Skills
SLEEK_API_KEY所需套餐 : Pro+ (API 访问受套餐限制)
| 作用域 | 解锁的功能 |
|---|---|
projects:read | 列出 / 获取项目 |
projects:write | 创建 / 删除项目 |
components:read | 列出项目中的组件 |
chats:read | 获取聊天运行状态 |
chats:write | 发送聊天消息 |
screenshots | 渲染组件截图 |
请仅为任务所需的作用域创建密钥。
https://sleek.design。不会向第三方发送任何数据。Authorization 请求头发送到 Sleek 的端点。imageUrls 时,这些 URL 将由 Sleek 的服务器获取。请避免传递包含敏感内容的 URL。当用户说类似"设计一个健身追踪应用"或"为我构建一个设置屏幕"时:
message.text;Sleek 的 AI 能理解自然语言您不需要先将请求分解成多个屏幕。将完整的意图作为单条消息发送,让 Sleek 决定创建哪些屏幕。
在每次产生 screen_created 或 screen_updated 操作的聊天运行之后,务必截取截图并将其展示给用户。 切勿在未交付视觉效果的情况下静默完成聊天运行。
当在项目中首次创建屏幕时(即运行包含 screen_created 操作),交付:
componentIds: [screenId])componentIds: [all screen ids])当仅更新现有屏幕时,为每个受影响的屏幕交付一张截图。
除非用户明确要求,否则所有截图都使用 background: "transparent"。
| 方法 | 路径 | 作用域 | 描述 |
|---|---|---|---|
GET | /api/v1/projects | projects:read | 列出项目 |
POST | /api/v1/projects | projects:write | 创建项目 |
GET | /api/v1/projects/:id | projects:read | 获取项目 |
DELETE | /api/v1/projects/:id | projects:write | 删除项目 |
GET | /api/v1/projects/:id/components | components:read | 列出组件 |
POST | /api/v1/projects/:id/chat/messages | chats:write | 发送聊天消息 |
GET | /api/v1/projects/:id/chat/runs/:runId | chats:read | 轮询运行状态 |
POST | /api/v1/screenshots | screenshots | 渲染截图 |
所有 ID 都是稳定的字符串标识符。
GET /api/v1/projects?limit=50&offset=0
Authorization: Bearer $SLEEK_API_KEY
响应 200:
{
"data": [
{
"id": "proj_abc",
"name": "My App",
"slug": "my-app",
"createdAt": "2026-01-01T00:00:00Z",
"updatedAt": "..."
}
],
"pagination": { "total": 12, "limit": 50, "offset": 0 }
}
POST /api/v1/projects
Authorization: Bearer $SLEEK_API_KEY
Content-Type: application/json
{ "name": "My New App" }
响应 201 —— 与单个项目结构相同。
GET /api/v1/projects/:projectId
DELETE /api/v1/projects/:projectId → 204 No Content
GET /api/v1/projects/:projectId/components?limit=50&offset=0
Authorization: Bearer $SLEEK_API_KEY
响应 200:
{
"data": [
{
"id": "cmp_xyz",
"name": "Hero Section",
"activeVersion": 3,
"versions": [{ "id": "ver_001", "version": 1, "createdAt": "..." }],
"createdAt": "...",
"updatedAt": "..."
}
],
"pagination": { "total": 5, "limit": 50, "offset": 0 }
}
这是核心操作:在 message.text 中描述您想要的内容,AI 将创建或修改屏幕。
POST /api/v1/projects/:projectId/chat/messages?wait=false
Authorization: Bearer $SLEEK_API_KEY
Content-Type: application/json
idempotency-key: <optional, max 255 chars>
{
"message": { "text": "Add a pricing section with three tiers" },
"imageUrls": ["https://example.com/ref.png"],
"target": { "screenId": "scr_abc" }
}
| 字段 | 必需 | 说明 |
|---|---|---|
message.text | 是 | 1+ 字符,已修剪 |
imageUrls | 否 | 仅限 HTTPS URL;作为视觉上下文包含 |
target.screenId | 否 | 编辑特定屏幕;省略则让 AI 决定 |
?wait=true/false | 否 | 同步等待模式(默认:false) |
idempotency-key 请求头 | 否 | 可安全重放的重新发送 |
wait=false)状态 202 Accepted。在运行达到终止状态之前,result 和 error 不存在。
{
"data": {
"runId": "run_111",
"status": "queued",
"statusUrl": "/api/v1/projects/proj_abc/chat/runs/run_111"
}
}
wait=true)阻塞最多 300 秒。完成时返回 200,超时则返回 202。
{
"data": {
"runId": "run_111",
"status": "completed",
"statusUrl": "...",
"result": {
"assistantText": "I added a pricing section with...",
"operations": [
{ "type": "screen_created", "screenId": "scr_xyz", "screenName": "Pricing" },
{ "type": "screen_updated", "screenId": "scr_abc" },
{ "type": "theme_updated" }
]
}
}
}
在异步发送后使用此端点检查进度。
GET /api/v1/projects/:projectId/chat/runs/:runId
Authorization: Bearer $SLEEK_API_KEY
响应 —— 与发送消息的 data 对象结构相同:
{
"data": {
"runId": "run_111",
"status": "queued",
"statusUrl": "..."
}
}
当成功完成时,result 存在:
{
"data": {
"runId": "run_111",
"status": "completed",
"statusUrl": "...",
"result": {
"assistantText": "...",
"operations": [...]
}
}
}
当失败时,error 存在:
{
"data": {
"runId": "run_111",
"status": "failed",
"statusUrl": "...",
"error": { "code": "execution_failed", "message": "..." }
}
}
运行状态生命周期 : queued → running → completed | failed
获取一个或多个渲染组件的快照。
POST /api/v1/screenshots
Authorization: Bearer $SLEEK_API_KEY
Content-Type: application/json
{
"componentIds": ["cmp_xyz", "cmp_abc"],
"projectId": "proj_abc",
"format": "png",
"scale": 2,
"gap": 40,
"padding": 40,
"background": "transparent"
}
| 字段 | 默认值 | 说明 |
|---|---|---|
format | png | png 或 webp |
scale | 2 | 1–3 (设备像素比) |
gap | 40 | 组件之间的像素间距 |
padding | 40 | 所有边的统一内边距 |
paddingX | (可选) | 水平内边距;提供时覆盖 padding 的左右值 |
paddingY | (可选) | 垂直内边距;提供时覆盖 padding 的上下值 |
paddingTop | (可选) | 顶部内边距;提供时覆盖 paddingY |
paddingRight | (可选) | 右侧内边距;提供时覆盖 paddingX |
paddingBottom | (可选) | 底部内边距;提供时覆盖 paddingY |
paddingLeft | (可选) | 左侧内边距;提供时覆盖 paddingX |
background | transparent | 任何 CSS 颜色(十六进制、命名颜色、transparent) |
showDots | false | 在背景上叠加微妙的点阵图案 |
内边距解析遵循级联规则:单边 → 轴向 → 统一。例如,paddingTop 回退到 paddingY,再回退到 padding。因此 { "padding": 20, "paddingX": 10, "paddingLeft": 5 } 会得到上/下 20px,右 10px,左 5px。
当 showDots 为 true 时,会在背景颜色上绘制点阵图案。点阵会自动适应背景:深色背景显示浅色点,浅色背景显示深色点。当 background 为 "transparent" 时,此设置无效。
除非用户明确请求特定的背景颜色,否则始终使用 "background": "transparent"。
响应:原始的二进制 image/png 或 image/webp,附带 Content-Disposition: attachment。
{ "code": "UNAUTHORIZED", "message": "..." }
| HTTP | 代码 | 何时出现 |
|---|---|---|
| 401 | UNAUTHORIZED | 缺少/无效/过期的 API 密钥 |
| 403 | FORBIDDEN | 密钥有效,但作用域或套餐错误 |
| 404 | NOT_FOUND | 资源不存在 |
| 400 | BAD_REQUEST | 验证失败 |
| 409 | CONFLICT | 此项目有另一个运行中的任务 |
| 500 | INTERNAL_SERVER_ERROR | 服务器错误 |
聊天运行级别的错误(在 data.error 中):
| 代码 | 含义 |
|---|---|
out_of_credits | 组织已无剩余额度 |
execution_failed | AI 执行错误 |
1. POST /api/v1/projects → 获取 projectId
2. POST /api/v1/projects/:id/chat/messages → 获取 runId (202)
3. 轮询 GET /api/v1/projects/:id/chat/runs/:runId
直到 status == "completed" 或 "failed"
4. 从 result.operations 收集 screenIds
(screen_created 和 screen_updated 条目)
5. 单独截取每个受影响屏幕的截图
6. 如果有任何 screen_created:同时截取所有项目屏幕的组合截图
7. 向用户展示所有截图
轮询建议 : 从 2 秒间隔开始,10 秒后回退到 5 秒,5 分钟后放弃。
最适合短任务或可以接受延迟的情况。
1. POST /api/v1/projects/:id/chat/messages?wait=true
→ 阻塞最多 300 秒
→ 完成则返回 200,超时则返回 202
2. 如果返回 202,则回退到流程 1 的轮询,使用返回的 runId
3. 完成后,截取并展示受影响的屏幕截图(参见截图交付规则)
1. GET /api/v1/projects/:id/components → 查找 screenId
2. POST /api/v1/projects/:id/chat/messages
body: { message: { text: "..." }, target: { screenId: "scr_xyz" } }
3. 如上所述进行轮询或等待
4. 截取更新后的屏幕截图并展示给用户
在发送请求时添加 idempotency-key 请求头。如果网络中断,您使用相同的密钥重试,服务器将返回现有的运行,而不是创建重复项。密钥必须 ≤255 个字符。
POST /api/v1/projects/:id/chat/messages
idempotency-key: my-unique-request-id-abc123
每个项目只允许一个活动运行。如果您在运行时发送消息,您将收到 409 CONFLICT。等待活动运行完成后再发送下一条消息。
409 响应 → 轮询现有运行 → 完成 → 发送下一条消息
所有列表端点都接受 limit (1–100,默认 50) 和 offset (≥0)。响应始终包含 pagination.total,以便您可以分页浏览所有结果。
GET /api/v1/projects?limit=10&offset=20
| 错误 | 修复方法 |
|---|---|
发送到 /api/v1 时没有 Authorization 请求头 | 在每个请求中添加 Authorization: Bearer $SLEEK_API_KEY |
| 使用错误的作用域 | 检查密钥的作用域是否与端点匹配(例如,发送消息需要 chats:write) |
| 在运行完成前发送下一条消息 | 在下一次发送前轮询直到 completed/failed |
在长生成任务上使用 wait=true | 它最多阻塞 300 秒;对于 202 响应,要有回退到轮询的方案 |
在 imageUrls 中使用 HTTP URL | 仅接受 HTTPS URL |
假设 202 响应中存在 result | 在状态变为 completed 之前,result 不存在 |
每周安装量
84.9K
仓库
GitHub 星标数
8
首次出现
12 天前
安全审计
安装于
claude-code60.6K
codex45.7K
opencode32.8K
openclaw29.8K
cursor6.4K
amp3.2K
Create API keys at https://sleek.design/dashboard/api-keys. The full key value is shown only once at creation — store it in the SLEEK_API_KEY environment variable.
Required plan : Pro+ (API access is gated)
| Scope | What it unlocks |
|---|---|
projects:read | List / get projects |
projects:write | Create / delete projects |
components:read | List components in a project |
chats:read | Get chat run status |
chats:write | Send chat messages |
screenshots | Render component screenshots |
Create a key with only the scopes needed for the task.
https://sleek.design. No data is sent to third parties.Authorization header to Sleek endpoints.imageUrls in chat messages, those URLs are fetched by Sleek's servers. Avoid passing URLs that contain sensitive content.When the user says something like "design a fitness tracking app" or "build me a settings screen":
message.text; Sleek's AI interprets natural languageYou do not need to decompose the request into screens first. Send the full intent as a single message and let Sleek decide what screens to create.
After every chat run that producesscreen_created or screen_updated operations, always take screenshots and show them to the user. Never silently complete a chat run without delivering the visuals.
When screens are created for the first time on a project (i.e. the run includes screen_created operations), deliver:
componentIds: [screenId])componentIds: [all screen ids])When only existing screens are updated , deliver one screenshot per affected screen.
Use background: "transparent" for all screenshots unless the user explicitly requests otherwise.
| Method | Path | Scope | Description |
|---|---|---|---|
GET | /api/v1/projects | projects:read | List projects |
POST | /api/v1/projects | projects:write | Create project |
GET | /api/v1/projects/:id | projects:read | Get project |
DELETE | /api/v1/projects/:id | projects:write | Delete project |
GET | /api/v1/projects/:id/components | components:read | List components |
POST | /api/v1/projects/:id/chat/messages | chats:write | Send chat message |
GET | /api/v1/projects/:id/chat/runs/:runId | chats:read | Poll run status |
POST | /api/v1/screenshots | screenshots | Render screenshot |
All IDs are stable string identifiers.
GET /api/v1/projects?limit=50&offset=0
Authorization: Bearer $SLEEK_API_KEY
Response 200:
{
"data": [
{
"id": "proj_abc",
"name": "My App",
"slug": "my-app",
"createdAt": "2026-01-01T00:00:00Z",
"updatedAt": "..."
}
],
"pagination": { "total": 12, "limit": 50, "offset": 0 }
}
POST /api/v1/projects
Authorization: Bearer $SLEEK_API_KEY
Content-Type: application/json
{ "name": "My New App" }
Response 201 — same shape as a single project.
GET /api/v1/projects/:projectId
DELETE /api/v1/projects/:projectId → 204 No Content
GET /api/v1/projects/:projectId/components?limit=50&offset=0
Authorization: Bearer $SLEEK_API_KEY
Response 200:
{
"data": [
{
"id": "cmp_xyz",
"name": "Hero Section",
"activeVersion": 3,
"versions": [{ "id": "ver_001", "version": 1, "createdAt": "..." }],
"createdAt": "...",
"updatedAt": "..."
}
],
"pagination": { "total": 5, "limit": 50, "offset": 0 }
}
This is the core action: describe what you want in message.text and the AI creates or modifies screens.
POST /api/v1/projects/:projectId/chat/messages?wait=false
Authorization: Bearer $SLEEK_API_KEY
Content-Type: application/json
idempotency-key: <optional, max 255 chars>
{
"message": { "text": "Add a pricing section with three tiers" },
"imageUrls": ["https://example.com/ref.png"],
"target": { "screenId": "scr_abc" }
}
| Field | Required | Notes |
|---|---|---|
message.text | Yes | 1+ chars, trimmed |
imageUrls | No | HTTPS URLs only; included as visual context |
target.screenId | No | Edit a specific screen; omit to let AI decide |
?wait=true/false | No | Sync wait mode (default: false) |
idempotency-key header | No | Replay-safe re-sends |
wait=false)Status 202 Accepted. result and error are absent until the run reaches a terminal state.
{
"data": {
"runId": "run_111",
"status": "queued",
"statusUrl": "/api/v1/projects/proj_abc/chat/runs/run_111"
}
}
wait=true)Blocks up to 300 seconds. Returns 200 when completed, 202 if timed out.
{
"data": {
"runId": "run_111",
"status": "completed",
"statusUrl": "...",
"result": {
"assistantText": "I added a pricing section with...",
"operations": [
{ "type": "screen_created", "screenId": "scr_xyz", "screenName": "Pricing" },
{ "type": "screen_updated", "screenId": "scr_abc" },
{ "type": "theme_updated" }
]
}
}
}
Use this after async send to check progress.
GET /api/v1/projects/:projectId/chat/runs/:runId
Authorization: Bearer $SLEEK_API_KEY
Response — same shape as send message data object:
{
"data": {
"runId": "run_111",
"status": "queued",
"statusUrl": "..."
}
}
When completed successfully, result is present:
{
"data": {
"runId": "run_111",
"status": "completed",
"statusUrl": "...",
"result": {
"assistantText": "...",
"operations": [...]
}
}
}
When failed, error is present:
{
"data": {
"runId": "run_111",
"status": "failed",
"statusUrl": "...",
"error": { "code": "execution_failed", "message": "..." }
}
}
Run status lifecycle : queued → running → completed | failed
Takes a snapshot of one or more rendered components.
POST /api/v1/screenshots
Authorization: Bearer $SLEEK_API_KEY
Content-Type: application/json
{
"componentIds": ["cmp_xyz", "cmp_abc"],
"projectId": "proj_abc",
"format": "png",
"scale": 2,
"gap": 40,
"padding": 40,
"background": "transparent"
}
| Field | Default | Notes |
|---|---|---|
format | png | png or webp |
scale | 2 | 1–3 (device pixel ratio) |
gap | 40 | Pixels between components |
padding | 40 | Uniform padding on all sides |
paddingX | (optional) | Horizontal padding; overrides padding for left/right when provided |
paddingY | (optional) | Vertical padding; overrides padding for top/bottom when provided |
paddingTop | (optional) | Top padding; overrides paddingY when provided |
paddingRight | (optional) | Right padding; overrides paddingX when provided |
paddingBottom | (optional) | Bottom padding; overrides paddingY when provided |
paddingLeft | (optional) | Left padding; overrides paddingX when provided |
background | transparent | Any CSS color (hex, named, transparent) |
showDots | false | Overlay a subtle dot grid on the background |
Padding resolves with a cascade: per-side → axis → uniform. For example, paddingTop falls back to paddingY, which falls back to padding. So { "padding": 20, "paddingX": 10, "paddingLeft": 5 } gives top/bottom 20px, right 10px, left 5px.
When showDots is true, a dot pattern is drawn over the background color. The dots automatically adapt to the background: dark backgrounds get light dots, light backgrounds get dark dots. This has no effect when background is "transparent".
Always use "background": "transparent" unless the user explicitly requests a specific background color.
Response: raw binary image/png or image/webp with Content-Disposition: attachment.
{ "code": "UNAUTHORIZED", "message": "..." }
| HTTP | Code | When |
|---|---|---|
| 401 | UNAUTHORIZED | Missing/invalid/expired API key |
| 403 | FORBIDDEN | Valid key, wrong scope or plan |
| 404 | NOT_FOUND | Resource doesn't exist |
| 400 | BAD_REQUEST | Validation failure |
| 409 | CONFLICT | Another run is active for this project |
| 500 | INTERNAL_SERVER_ERROR | Server error |
Chat run-level errors (inside data.error):
| Code | Meaning |
|---|---|
out_of_credits | Organization has no credits left |
execution_failed | AI execution error |
1. POST /api/v1/projects → get projectId
2. POST /api/v1/projects/:id/chat/messages → get runId (202)
3. Poll GET /api/v1/projects/:id/chat/runs/:runId
until status == "completed" or "failed"
4. Collect screenIds from result.operations
(screen_created and screen_updated entries)
5. Screenshot each affected screen individually
6. If any screen_created: also screenshot all project screens combined
7. Show all screenshots to the user
Polling recommendation : start at 2s interval, back off to 5s after 10s, give up after 5 minutes.
Best for short tasks or when latency is acceptable.
1. POST /api/v1/projects/:id/chat/messages?wait=true
→ blocks up to 300s
→ 200 if completed, 202 if timed out
2. If 202, fall back to Flow 1 polling with the returned runId
3. On completion, screenshot and show affected screens (see screenshot delivery rule)
1. GET /api/v1/projects/:id/components → find screenId
2. POST /api/v1/projects/:id/chat/messages
body: { message: { text: "..." }, target: { screenId: "scr_xyz" } }
3. Poll or wait as above
4. Screenshot the updated screen and show it to the user
Add idempotency-key header on the send request. If the network drops and you retry with the same key, the server returns the existing run rather than creating a duplicate. The key must be ≤255 chars.
POST /api/v1/projects/:id/chat/messages
idempotency-key: my-unique-request-id-abc123
Only one active run is allowed per project. If you send a message while one is running, you get 409 CONFLICT. Wait for the active run to complete before sending the next message.
409 response → poll existing run → completed → send next message
All list endpoints accept limit (1–100, default 50) and offset (≥0). The response always includes pagination.total so you can page through all results.
GET /api/v1/projects?limit=10&offset=20
| Mistake | Fix |
|---|---|
Sending to /api/v1 without Authorization header | Add Authorization: Bearer $SLEEK_API_KEY to every request |
| Using wrong scope | Check key's scopes match the endpoint (e.g. chats:write for sending messages) |
| Sending next message before run completes | Poll until completed/failed before next send |
Using wait=true on long generations | It blocks 300s max; have a fallback to polling for 202 response |
HTTP URLs in imageUrls | Only HTTPS URLs are accepted |
Assuming result is present on 202 | result is absent until status is completed |
Weekly Installs
84.9K
Repository
GitHub Stars
8
First Seen
12 days ago
Security Audits
Installed on
claude-code60.6K
codex45.7K
opencode32.8K
openclaw29.8K
cursor6.4K
amp3.2K