Assets API
Manage custom assets like speakers (voices) and images that can be used in your videos.
Create Asset
POST /assets
Create a new asset (speaker or image).
bash
curl -X POST https://api.sketchpen.app/api/v1/assets \
-H "X-Api-Key: sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"name": "My Speaker",
"description": "Custom speaker for tutorials",
"type": "character",
"voice_id": "21m00Tcm4TlvDq8ikWAM"
}'Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| `name` | string | Yes | Asset name |
| `description` | string | No | Asset description |
| `type` | string | Yes | `character` or `object` |
| `voice_id` | string | No | Voice ID (required for character type) |
Response
json
{
"id": "uuid",
"user_id": "uuid",
"name": "My Speaker",
"description": "Custom speaker for tutorials",
"type": "character",
"voice_id": "21m00Tcm4TlvDq8ikWAM",
"image_url": null,
"created_at": "2024-01-01T00:00:00Z"
}List Assets
GET /assets
bash
curl https://api.sketchpen.app/api/v1/assets \ -H "X-Api-Key: sk_live_..."
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| `type` | string | Filter by type: `character` or `object` |
Response
json
[
{
"id": "uuid",
"name": "My Speaker",
"description": "Custom speaker",
"type": "character",
"voice_id": "21m00Tcm4TlvDq8ikWAM",
"image_url": null,
"created_at": "2024-01-01T00:00:00Z"
}
]Upload Asset Image
POST /assets/{id}/image
Upload an image for an asset.
bash
curl -X POST https://api.sketchpen.app/api/v1/assets/uuid/image \ -H "X-Api-Key: sk_live_..." \ -F "file=@image.png"
Response:
json
{
"id": "uuid",
"name": "My Speaker",
"image_url": "https://bucket.s3.region.amazonaws.com/key?X-Amz-Algorithm=...",
"created_at": "2024-01-01T00:00:00Z"
}โน๏ธ Image URLs
The image_url is a presigned S3 URL (valid for 7 days) or CDN URL if configured.
Link Asset to Video
POST /assets/videos/{video_id}/refs
Link an asset to a video for use in scenes.
bash
curl -X POST https://api.sketchpen.app/api/v1/assets/videos/uuid/refs \
-H "X-Api-Key: sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"asset_id": "uuid",
"is_speaker": true,
"scene_id": "scene_uuid"
}'Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| `asset_id` | string | Yes | Asset ID to link |
| `is_speaker` | boolean | No | Whether this is a speaker (default: false) |
| `scene_id` | string | No | Specific scene to use in |
Delete Asset
DELETE /assets/{id}
bash
curl -X DELETE https://api.sketchpen.app/api/v1/assets/uuid \ -H "X-Api-Key: sk_live_..."
Returns 204 No Content on success.
Asset Types
| Type | Description |
|---|---|
| `character` | AI voice/character that can narrate videos and appear in scenes |
| `object` | Prop or image that can appear in videos |