API Endpoints
All endpoints are relative to https://smdg.app. Unless noted, all endpoints require authentication.
Endpoint Summary
| Method | Path | Description |
|---|---|---|
POST | /api/upload | Upload source files |
POST | /api/prefill | Get AI-suggested metadata |
POST | /api/generate | Generate a skill (SSE stream) |
GET | /api/skills | List your skills |
GET | /api/skills/:id | Get a specific skill |
PUT | /api/skills/:id | Update a skill |
DELETE | /api/skills/:id | Delete a skill |
GET | /api/skills/:id/download | Download skill file |
POST | /api/skills/:id/share | Toggle public sharing |
POST | /api/skills/:id/duplicate | Duplicate a skill |
POST | /api/skills/:id/regenerate | Regenerate a skill |
GET | /api/credits | Check credit balance |
POST | /api/checkout | Create payment session |
POST /api/upload
Upload one or more source files for skill generation. Uses multipart/form-data.
Request
curl -X POST https://smdg.app/api/upload \
-H "Authorization: Bearer smdg_sk_..." \
-F "files=@document.pdf" \
-F "files=@notes.md"Response
{
"sources": [
{
"id": "src_abc123",
"filename": "document.pdf",
"type": "pdf",
"size": 142560,
"status": "uploaded"
},
{
"id": "src_def456",
"filename": "notes.md",
"type": "md",
"size": 3241,
"status": "uploaded"
}
]
}POST /api/prefill
Submit source IDs and receive AI-suggested name, description, and category.
Request
{
"source_ids": ["src_abc123", "src_def456"]
}Response
{
"name": "css-layout-patterns",
"description": "Modern CSS layout patterns using flexbox and grid",
"category": "coding"
}POST /api/generate
Generate a SKILL.md from uploaded sources. Returns a Server-Sent Events (SSE) stream with progress updates. Costs 1 credit.
Request
{
"source_ids": ["src_abc123", "src_def456"],
"name": "css-layout-patterns",
"description": "Modern CSS layout patterns using flexbox and grid",
"category": "coding"
}SSE Events
event: progress
data: {"stage": "extracting", "message": "Parsing 2 sources..."}
event: progress
data: {"stage": "synthesizing", "message": "Structuring skill content..."}
event: progress
data: {"stage": "validating", "message": "Running 8 validation checks..."}
event: complete
data: {"skill_id": "sk_xyz789", "validation": {"errors": 0, "warnings": 1}}GET /api/skills
List all skills in your library.
Response
{
"skills": [
{
"id": "sk_xyz789",
"name": "css-layout-patterns",
"description": "Modern CSS layout patterns using flexbox and grid",
"category": "coding",
"word_count": 3421,
"is_public": false,
"created_at": "2025-12-15T10:30:00Z",
"updated_at": "2025-12-15T10:30:00Z"
}
]
}GET /api/skills/:id
Get a specific skill by ID, including the full markdown content.
Response
{
"id": "sk_xyz789",
"name": "css-layout-patterns",
"description": "Modern CSS layout patterns using flexbox and grid",
"category": "coding",
"content": "---\nname: css-layout-patterns\n...full markdown...",
"word_count": 3421,
"is_public": false,
"validation": { "errors": 0, "warnings": 1, "checks": [...] },
"created_at": "2025-12-15T10:30:00Z",
"updated_at": "2025-12-15T10:30:00Z"
}PUT /api/skills/:id
Update a skill's content. Triggers re-validation.
Request
{
"content": "---\nname: css-layout-patterns\n...updated markdown..."
}Response
{
"id": "sk_xyz789",
"word_count": 3500,
"validation": { "errors": 0, "warnings": 0, "checks": [...] },
"updated_at": "2025-12-16T08:00:00Z"
}DELETE /api/skills/:id
Permanently delete a skill.
Response
(empty body)GET /api/skills/:id/download
Download the skill as a file. Accepts a format query parameter.
| Parameter | Values | Description |
|---|---|---|
format | md (default), zip | md returns the SKILL.md file. zip returns the full directory as a zip archive. |
# Download as markdown
curl -O -J https://smdg.app/api/skills/sk_xyz789/download?format=md \
-H "Authorization: Bearer smdg_sk_..."
# Download as zip
curl -O -J https://smdg.app/api/skills/sk_xyz789/download?format=zip \
-H "Authorization: Bearer smdg_sk_..."POST /api/skills/:id/share
Toggle the public visibility of a skill.
Request
{
"is_public": true
}Response
{
"is_public": true,
"share_url": "https://smdg.app/s/sk_xyz789"
}POST /api/skills/:id/duplicate
Create a copy of a skill in your library. Works on your own skills and public skills from other users.
Response
{
"id": "sk_new123",
"name": "css-layout-patterns-copy",
"is_public": false
}POST /api/skills/:id/regenerate
Re-run the generation pipeline on the original sources. Costs 1 credit. Returns an SSE stream like POST /api/generate.
GET /api/credits
Check your current credit balance and plan information.
Response
{
"credits": 12,
"plan": "pro_pack",
"is_unlimited": false
}POST /api/checkout
Create a Stripe checkout session for purchasing credits or subscribing.
Request
{
"plan": "pro_pack"
}Valid plan values: starter, pro_pack, unlimited.
Response
{
"checkout_url": "https://checkout.stripe.com/c/pay/..."
}