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

FieldTypeRequiredDescription
`name`stringYesAsset name
`description`stringNoAsset description
`type`stringYes`character` or `object`
`voice_id`stringNoVoice 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

ParameterTypeDescription
`type`stringFilter 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.

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

FieldTypeRequiredDescription
`asset_id`stringYesAsset ID to link
`is_speaker`booleanNoWhether this is a speaker (default: false)
`scene_id`stringNoSpecific 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

TypeDescription
`character`AI voice/character that can narrate videos and appear in scenes
`object`Prop or image that can appear in videos
Need the raw text for your AI agent? View MDX ยท Full spec at /llms.txt