API Reference
Programmatic access to image generation, video creation, agent media tools (canvas parity), characters, and more. Available to Pro and Studio subscribers. Prefer MCP or CLI for agent workflows.
https://selfielabstudio.com/api/Authentication
API keys are available to Pro and Studio subscribers. Create keys in your account settings. Keys start with sl_.
Supported Header Formats
Authorization: Bearer sl_your_api_keyX-API-Key: sl_your_api_keyError Codes
401Invalid or missing API key.402Insufficient credits for this operation.403Feature requires a higher subscription tier.Credit Costs
Image Generation
| Provider | Slug | Credits | Notes |
|---|---|---|---|
| Gemini (Nano Banana Pro) | gemini | 3 | Subscribers: 2 credits. 4K: doubled. |
| Gemini Nano (Nano Banana Fast) | gemini-nano | 1 | |
| GPT Image 1.5 | gpt-image-1.5 | 2 | |
| GPT Image 2 | gpt-image-2 | 2 | 4K: 4 credits |
| Seedream 4.5 | seedream-4.5 | 2 | 4K: 4 credits. |
| Flux 2 Pro | fal-flux-2-pro | 2 | |
| Flux 2 Max | fal-flux-2-max | 4 | |
| Grok Imagine | grok-image | 2 | |
| Grok Imagine Pro | grok-image-pro | 4 | |
| Kling Image v3 | kling-image-v3 | 2 | 4K: 4 credits. |
Video Generation
| Provider | Credits | Notes |
|---|---|---|
| Veo 3.1 | 2/sec | Premium: 4/sec. |
| Sora 2 | 2/sec | Premium: 4/sec. |
| Pika 2.2 | 2/sec | Premium: 4/sec. |
| Seedance | 2/sec | Premium: 4/sec. |
| Wan 2.5 | 2/sec | Premium: 4/sec. |
| Grok Video | 1/sec | Premium: 4/sec. |
| Kling Motion | 1/sec | Premium: 4/sec. |
| Kling Avatar | 1/sec | Premium: 4/sec. |
Other
| Feature | Credits | Notes |
|---|---|---|
| Music (≤15s) | 2 | +3 per additional 30s segment. |
| Slideshow (Grok Image) | 3 | Flat rate: 3 (1-6 slides) or 6 (7-10). Other providers: per-image cost × slides. |
| 3D Model | 4 | |
| Realism Enhancement | 1 |
Studio subscribers receive a 10% discount on all video generation. Costs may change — check GET /api/user/credits for your current balance.
Credits
Check your credit balance and transaction history.
Returns your current credit balance, subscription tier, and optionally recent transactions.
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| includeRecent | boolean | no | Include recent credit transactions in the response. |
Response
{
"success": true,
"credits": 142,
"tier": "pro",
"maxCredits": 200,
"creditsResetAt": "2026-03-01T00:00:00.000Z"
}Example Request
curl https://selfielabstudio.com/api/user/credits \
-H "Authorization: Bearer sl_your_api_key"API Keys
Manage your API keys programmatically.
List all API keys associated with your account.
Response
{
"success": true,
"keys": [
{
"id": "key_abc123",
"name": "Production",
"prefix": "sl_abc1",
"createdAt": "2026-02-10T12:00:00.000Z",
"lastUsedAt": "2026-02-14T08:30:00.000Z"
}
]
}Example Request
curl https://selfielabstudio.com/api/user/api-keys \
-H "Authorization: Bearer sl_your_api_key"Create a new API key. The full key is only returned once — store it securely.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | yes | A label for this key (e.g. "Production"). |
Response
{
"success": true,
"key": "sl_live_abc123...",
"keyId": "key_abc123"
}Example Request
curl -X POST https://selfielabstudio.com/api/user/api-keys \
-H "Authorization: Bearer sl_your_api_key" \
-H "Content-Type: application/json" \
-d '{"name": "My New Key"}'Revoke an API key. This action cannot be undone.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| keyId | string | yes | The ID of the key to revoke. |
Response
{
"success": true
}Example Request
curl -X DELETE https://selfielabstudio.com/api/user/api-keys \
-H "Authorization: Bearer sl_your_api_key" \
-H "Content-Type: application/json" \
-d '{"keyId": "key_abc123"}'Characters
Manage saved characters (reference faces for consistent image generation).
List your saved characters with pagination.
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| limit | number | no | Number of characters to return (default 50). |
| offset | number | no | Offset for pagination. |
Response
{
"success": true,
"characters": [
{
"id": "char_abc123",
"name": "Alex",
"referenceUrl": "https://selfielab.app/...",
"createdAt": "2026-01-15T10:00:00.000Z"
}
],
"total": 3,
"hasMore": false
}Example Request
curl "https://selfielabstudio.com/api/characters?limit=10" \
-H "Authorization: Bearer sl_your_api_key"Create a new character. Provide the reference image as a URL or inline as a base64 data URI — one of the two is required. The image should clearly show a face.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | yes | Display name for the character. |
| referenceUrl | string | no | URL of the reference face image. Required if referenceImage is not provided. |
| referenceImage | string | no | Base64 data URI (e.g. "data:image/jpeg;base64,..."). Max 10 MB decoded. Supported: jpeg, png, webp, gif. Required if referenceUrl is not provided. |
| description | string | no | Optional description of the character. |
| hairColor | string | no | Hair color. |
| hairStyle | string | no | Hair style. |
*Either referenceUrl or referenceImage is required. If referenceImage is provided, it is uploaded to storage automatically.
*Additional optional fields: age, expression, makeup, topType, topColor, topDetails, bottomType, bottomColor, bottomDetails.
Response
{
"success": true,
"character": {
"id": "char_new123",
"name": "Alex",
"referenceUrl": "https://selfielab.app/references/...",
"createdAt": "2026-02-20T12:00:00.000Z"
}
}Example Request
# With base64 image (single API call)
curl -X POST https://selfielabstudio.com/api/characters \
-H "Authorization: Bearer sl_your_api_key" \
-H "Content-Type: application/json" \
-d '{"name": "Alex", "referenceImage": "data:image/jpeg;base64,/9j/4AAQ..."}'
# With URL
curl -X POST https://selfielabstudio.com/api/characters \
-H "Authorization: Bearer sl_your_api_key" \
-H "Content-Type: application/json" \
-d '{"name": "Alex", "referenceUrl": "https://example.com/face.jpg"}'Get a single character by ID, including recent generated images and videos.
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | yes | Character ID (in the URL path). |
Response
{
"success": true,
"character": {
"id": "char_abc123",
"name": "Alex",
"referenceUrl": "https://selfielab.app/...",
"generatedImages": [
{
"id": "img_abc",
"url": "https://selfielab.app/generated/...",
"prompt": "...",
"createdAt": "2026-02-10T12:00:00.000Z",
"generatedVideos": []
}
],
"generatedVideos": []
},
"editability": {
"canEdit": true
},
"isFromPurchase": false
}Example Request
curl https://selfielabstudio.com/api/characters/char_abc123 \
-H "Authorization: Bearer sl_your_api_key"Update a character. All fields are optional. You can update the reference image via referenceImage (base64) or referenceUrl — the old image is deleted from storage automatically. Characters published to the marketplace or sold cannot be edited.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | no | New display name. |
| referenceUrl | string | no | New reference image URL. |
| referenceImage | string | no | New reference image as base64 data URI (e.g. "data:image/jpeg;base64,..."). Max 10 MB. |
| description | string | no | Updated description. |
| hairColor | string | no | Hair color. |
| hairStyle | string | no | Hair style. |
| notes | string | no | Free-text notes (max 2000 chars). |
*Additional optional fields: age, expression, makeup, topType, topColor, topDetails, bottomType, bottomColor, bottomDetails.
*Returns 403 if the character has been published or sold on the marketplace.
Response
{
"success": true,
"character": {
"id": "char_abc123",
"name": "Alex v2",
"referenceUrl": "https://selfielab.app/references/...",
"updatedAt": "2026-02-20T12:05:00.000Z"
}
}Example Request
curl -X PATCH https://selfielabstudio.com/api/characters/char_abc123 \
-H "Authorization: Bearer sl_your_api_key" \
-H "Content-Type: application/json" \
-d '{"name": "Alex v2", "hairColor": "blonde"}'Delete a character and all its generated images and videos. Storage files are cleaned up. This action is irreversible.
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | yes | Character ID (in the URL path). |
Response
{
"success": true,
"deleted": {
"images": 12,
"videos": 3
}
}Example Request
curl -X DELETE https://selfielabstudio.com/api/characters/char_abc123 \
-H "Authorization: Bearer sl_your_api_key"Image Generation
Generate AI images. All providers share the same request/response format — just swap the provider name in the URL.
Generate images with the specified provider. See the Credit Costs table above for per-provider pricing.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| formData | CharacterFormData | yes | Structured form data with subject, photography, background, accessories, and composition fields. |
| referenceImage | string | no | Base64-encoded reference image for face consistency. |
| simplePrompt | string | no | Direct text prompt (bypasses structured form data). |
| numImages | number | no | Number of images to generate (1-6, default 1). |
| enable4K | boolean | no | Enable 4K resolution (gemini, seedream-4.5, kling-image-v3 only). Doubles credit cost. |
Available Providers
| Slug | Provider | Credits | 4K |
|---|---|---|---|
| gemini | Gemini (Nano Banana Pro) | 3 (subscribers: 2) | yes |
| gemini-nano | Gemini Nano (Nano Banana Fast) | 1 | — |
| gpt-image-1.5 | GPT Image 1.5 | 2 | — |
| gpt-image-2 | GPT Image 2 | 2 | yes |
| seedream-4.5 | Seedream 4.5 | 2 | yes |
| fal-flux-2-pro | Flux 2 Pro | 2 | — |
| fal-flux-2-max | Flux 2 Max | 4 | — |
| grok-image | Grok Imagine | 2 | — |
| grok-image-pro | Grok Imagine Pro | 4 | — |
| kling-image-v3 | Kling Image v3 | 2 | yes |
*Jobs are processed asynchronously. Poll GET /api/user/jobs to check status.
*formData uses structured JSON — not natural language prompts.
*4K doubles the credit cost on supported providers.
Response
{
"success": true,
"jobId": "job_abc123",
"promptUsed": "{...structured JSON...}"
}Example Request
curl -X POST https://selfielabstudio.com/api/generate/gemini \
-H "Authorization: Bearer sl_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"formData": {
"subject": { "description": "young woman", "expression": "smiling" },
"photography": { "shotType": "portrait", "aspectRatio": "3:4" },
"composition": { "photoType": "portrait" }
}
}'Video Generation
Generate AI videos from images. Standard video and avatar (talking head) endpoints share the same route but accept different fields.
Generate a video from a source image. Animates the image with motion based on a text prompt.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| imageId | string | no | ID of a previously generated image. Required if uploadedImageUrl is not provided. |
| uploadedImageUrl | string | no | URL of an uploaded image. Required if imageId is not provided. |
| imageUrl | string | no | Alias for uploadedImageUrl. Accepts any image URL (e.g. from a completed image job's imageUrl). If both are provided, uploadedImageUrl takes precedence. |
| prompt | string | yes | Motion/action prompt for the video. |
| aspectRatio | string | yes | Video aspect ratio: "9:16" or "16:9". |
| provider | string | no | Video provider slug (see table below). Default: seedance. |
| isPremium | boolean | no | Use premium quality variant (4 credits/sec). |
| duration | number | no | Output duration in seconds. Ranges: seedance 4-12, grok-video 1-15, kling-motion 5-30. |
| skipEnhancement | boolean | no | Skip automatic prompt enhancement (default: false). |
| referenceVideoUrl | string | no | URL of a reference video to copy motion from. Required for kling-motion provider. |
Available Providers
| Slug | Provider | Credits | Premium |
|---|---|---|---|
| veo-3.1 | Veo 3.1 | 2/sec | 4/sec |
| sora | Sora 2 | 2/sec | 4/sec |
| seedance | Seedance | 2/sec | 4/sec |
| wan | Wan 2.5 | 2/sec | 4/sec |
| grok-video | Grok Video | 1/sec | 4/sec |
| kling-motion | Kling Motion | 1/sec | 4/sec |
*Either imageId, uploadedImageUrl, or imageUrl is required (except for text-to-video providers).
*imageUrl is an alias for uploadedImageUrl — use it to pass a URL from a completed image job directly.
*kling-motion requires referenceVideoUrl and ignores prompt.
*Studio subscribers get a 10% discount on video generation.
Response
{
"success": true,
"jobId": "vjob_abc123",
"promptUsed": "..."
}Example Request
curl -X POST https://selfielabstudio.com/api/generate/video \
-H "Authorization: Bearer sl_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"imageId": "img_abc123",
"prompt": "gentle hair movement in the wind",
"aspectRatio": "9:16",
"provider": "seedance"
}'Generate a talking-head avatar video with voice and dialogue. Uses the same endpoint as standard video but with avatar-specific providers and voice fields.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| imageId | string | no | ID of a previously generated image. Required if uploadedImageUrl is not provided. |
| uploadedImageUrl | string | no | URL of an uploaded image. Required if imageId is not provided. |
| imageUrl | string | no | Alias for uploadedImageUrl. Accepts any image URL (e.g. from a completed image job's imageUrl). If both are provided, uploadedImageUrl takes precedence. |
| prompt | string | yes | Scene/motion prompt for the avatar video. |
| dialogue | string | no | Dialogue text for the avatar to speak. Duration is estimated from text length (~150 chars = 10 seconds). |
| aspectRatio | string | yes | Video aspect ratio: "9:16" or "16:9". |
| provider | string | yes | Avatar provider: "kling-avatar", "creatify-aurora", or "veed-fabric". |
| isPremium | boolean | no | Use premium quality variant (4 credits/sec). |
| voiceId | string | no | Voice ID from ElevenLabs or Fish Audio for text-to-speech on the dialogue. |
| voiceProvider | string | no | Voice service provider: "elevenlabs" or "fish-audio". |
| voiceAudioUrl | string | no | URL of pre-generated voice audio to use instead of TTS. |
| s2sAudioUrl | string | no | URL of speech-to-speech audio for voice replacement. |
| s2sDuration | number | no | Duration of S2S audio in seconds (for credit calculation). |
| skipEnhancement | boolean | no | Skip automatic prompt enhancement (default: false). |
Available Providers
| Slug | Provider | Credits | Premium |
|---|---|---|---|
| kling-avatar | Kling Avatar | 1/sec | 4/sec |
| creatify-aurora | Creatify Aurora | 2/sec | 4/sec |
| veed-fabric | VEED Fabric | 2/sec | 4/sec |
*Either imageId or uploadedImageUrl is required.
*If dialogue is provided without voiceId, TTS is generated automatically.
*Duration is estimated from dialogue length (~150 characters per 10 seconds).
*Studio subscribers get a 10% discount on video generation.
Response
{
"success": true,
"jobId": "vjob_def456",
"promptUsed": "..."
}Example Request
curl -X POST https://selfielabstudio.com/api/generate/video \
-H "Authorization: Bearer sl_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"imageId": "img_abc123",
"prompt": "person talking to camera",
"dialogue": "Hey everyone, welcome to my channel!",
"aspectRatio": "9:16",
"provider": "kling-avatar",
"voiceId": "voice_abc123",
"voiceProvider": "elevenlabs"
}'Agent Media Tools
Canvas-parity media ops for external agents (MCP/CLI). Same capabilities as the studio canvas agent: overlay text, stitch/trim/mute video, write shot prompts. Auth with your personal sl_ API key.
List all canvas-parity agent tools with API paths, CLI commands, and credit notes. Call this first when discovering SelfieLab capabilities.
*Also see MCP install at /developers/mcp and CLI at /developers/cli.
*Image create/edit use POST /api/generate/{provider}; video uses POST /api/generate/video.
Response
{
"success": true,
"parityToolIds": [
"create_image",
"edit_image",
"remove_background",
"overlay_text",
"create_video",
"stitch_videos",
"trim_video",
"mute_video",
"write_shot_prompt"
],
"toolCount": 11
}Example Request
curl https://selfielabstudio.com/api/agent/tools \
-H "Authorization: Bearer sl_your_api_key"Burn caption text onto an image or video URL (top/center/bottom). Returns a new media URL.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| text | string | yes | Caption text (1–120 chars). |
| imageUrl | string | no | Image URL to caption (required if videoUrl omitted). |
| videoUrl | string | no | Video URL to caption (required if imageUrl omitted). |
| position | string | no | "top" | "center" | "bottom" (default bottom). |
Response
{
"success": true,
"mediaType": "image",
"url": "https://selfielab.app/generated/text-overlay/..."
}Example Request
curl -X POST https://selfielabstudio.com/api/agent/overlay-text \
-H "Authorization: Bearer sl_your_api_key" \
-H "Content-Type: application/json" \
-d '{"text":"hook line","imageUrl":"https://…/img.jpg","position":"bottom"}'Merge 2–5 video URLs into one continuous clip, in order.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| videoUrls | string[] | yes | Array of 2–5 HTTPS video URLs (clip order). |
Response
{
"success": true,
"videoUrl": "https://selfielab.app/videos/stitched/...",
"clipCount": 2
}Example Request
curl -X POST https://selfielabstudio.com/api/agent/stitch-videos \
-H "Authorization: Bearer sl_your_api_key" \
-H "Content-Type: application/json" \
-d '{"videoUrls":["https://…/a.mp4","https://…/b.mp4"]}'Cut a video URL to a [startTime, endTime] range in seconds.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| videoUrl | string | yes | Source video HTTPS URL. |
| startTime | number | yes | Start seconds (≥ 0). |
| endTime | number | yes | End seconds (must be after startTime). |
Response
{
"success": true,
"videoUrl": "https://selfielab.app/videos/trimmed/...",
"startTime": 0,
"endTime": 3
}Example Request
curl -X POST https://selfielabstudio.com/api/agent/trim-video \
-H "Authorization: Bearer sl_your_api_key" \
-H "Content-Type: application/json" \
-d '{"videoUrl":"https://…/a.mp4","startTime":0,"endTime":3}'Remove the audio track from a video URL.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| videoUrl | string | yes | Source video HTTPS URL. |
Response
{
"success": true,
"videoUrl": "https://selfielab.app/videos/muted/..."
}Example Request
curl -X POST https://selfielabstudio.com/api/agent/mute-video \
-H "Authorization: Bearer sl_your_api_key" \
-H "Content-Type: application/json" \
-d '{"videoUrl":"https://…/a.mp4"}'Analyze an image URL and return a reusable shot prompt (pose, setting, framing, lighting, mood). Does not generate an image.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| imageUrl | string | yes | Image HTTPS URL to analyze. |
Response
{
"success": true,
"shotPrompt": "woman seated at a sidewalk cafe, golden hour side light, medium close-up, candid smile…"
}Example Request
curl -X POST https://selfielabstudio.com/api/agent/write-shot-prompt \
-H "Authorization: Bearer sl_your_api_key" \
-H "Content-Type: application/json" \
-d '{"imageUrl":"https://…/img.jpg"}'Remove the background from an image URL; returns a transparent PNG. Same as canvas remove_background.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| imageUrl | string | yes | Source image HTTPS URL. |
Response
{
"success": true,
"imageUrl": "https://selfielab.app/edited/…-nobg.png",
"imageId": "img_…"
}Example Request
curl -X POST https://selfielabstudio.com/api/photo-editor/remove-background \
-H "Authorization: Bearer sl_your_api_key" \
-H "Content-Type: application/json" \
-d '{"imageUrl":"https://…/img.jpg"}'Jobs
Poll the status of your image generation jobs.
Get all active (pending/processing) image generation jobs. Use this to poll for completion. Optionally include recently completed/failed jobs.
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| includeRecent | boolean | no | When true, includes jobs completed or failed in the last 5 minutes in a separate `recentJobs` array with `imageId` and `imageUrl`. |
*Jobs transition through statuses: pending → processing → completed/failed.
*Completed jobs return the image URL. Poll every 2-3 seconds.
*`recentJobs` is only present when `includeRecent=true`. Each entry includes `imageId` and `imageUrl` for use with the video API.
*Alternatively, poll a single job via GET /api/generate/image/{jobId} which returns `imageId` and `imageUrl` on completion.
Response
{
"success": true,
"jobs": [
{
"id": "job_abc123",
"status": "processing",
"progress": "Generating image...",
"prompt": "{...}",
"createdAt": "2026-02-14T12:00:00.000Z"
}
],
"recentJobs": [
{
"id": "job_def456",
"status": "completed",
"imageId": "img_xyz789",
"imageUrl": "https://selfielab.app/generated/...",
"prompt": "{...}",
"error": null,
"createdAt": "2026-02-14T11:58:00.000Z",
"completedAt": "2026-02-14T11:58:30.000Z"
}
],
"subscriptionTier": "pro",
"jobLimit": 3
}Example Request
curl "https://selfielabstudio.com/api/user/jobs?includeRecent=true" \
-H "Authorization: Bearer sl_your_api_key"Images
Retrieve and manage your generated images.
Get your generated images, grouped by character and unassigned.
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| imageType | string | no | Filter by type: "image" or "video" (default: all). |
| showAll | boolean | no | Return all images across characters. |
Response
{
"success": true,
"characters": [
{
"id": "char_abc",
"name": "Alex",
"images": [
{
"id": "img_1",
"url": "https://selfielab.app/..."
}
]
}
],
"unassigned": [
{
"id": "img_2",
"url": "https://selfielab.app/..."
}
]
}Example Request
curl "https://selfielabstudio.com/api/user/images?imageType=image" \
-H "Authorization: Bearer sl_your_api_key"Permanently delete a generated image. This cannot be undone.
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | yes | The ID of the image to delete. |
Response
{
"success": true
}Example Request
curl -X DELETE "https://selfielabstudio.com/api/user/images?id=img_abc123" \
-H "Authorization: Bearer sl_your_api_key"Slideshows
Generate AI-powered slideshow presentations with text overlays and custom styling.
Generate a slideshow from a topic. Optionally provide pre-defined slides, text styling, and a character face. Returns a job ID for polling.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| topic | string | yes | The topic or title for the slideshow. |
| characterId | string | no | Character ID to use as the face in slideshow images. |
| hookType | string | no | Hook type slug (e.g. "story-arc", "listicle", "grwm"). Sets the slideshow format name and default slide count. See the Hook Types table below for available options. |
| slideCount | number | no | Number of slides to generate (1-10). Defaults to the hook type's default if hookType is set, otherwise 6. |
| imageProvider | string | no | Image generation provider. Options: "grok-image" (default), "grok-image-pro", "gemini", "gemini-nano", "gpt-image-1.5", "gpt-image-2", "fal-flux-2-pro", "fal-flux-2-max", "seedream-4.5", "kling-image-v3". |
| productName | string | no | Product or app name to subtly mention in slide content and CTA. |
| productDescription | string | no | Description of the product/app. Helps AI write accurate, specific copy when mentioning it. |
| slides | Slide[] | no | Pre-defined slides array. Length must not exceed slideCount. See slides[] object below. |
| textStyle | TextStyle | no | Text overlay styling object. All fields optional — merges with defaults. See textStyle object below. |
slides[]Each slide in the slides array. If omitted, AI generates slides from the topic.| Name | Type | Description |
|---|---|---|
| text | string | Text content displayed on the slide. |
| imagePrompt | string | Prompt used to generate the slide background image. |
textStyleAll fields are optional and merge with sensible defaults.| Name | Type | Default | Description |
|---|---|---|---|
| position | string | "bottom" | "bottom", "top", or "center". |
| fontSize | number | 56 | Font size in pixels. |
| fontFamily | string | "impact" | Font family name. |
| textColor | string | "#FFFFFF" | Text color hex. |
| strokeColor | string | "#000000" | Text stroke color hex. |
| strokeWidth | number | 3 | Stroke width in pixels. |
| bgBarOpacity | number | 0.5 | Background bar opacity (0-1). |
| bgBarColor | string | "#000000" | Background bar color hex. |
| bgBarMode | string | "full" | Background bar mode. |
| textAlign | string | "center" | Text alignment. |
| maxCharsPerLine | number | 20 | Max characters per line before wrapping. |
| textTransform | string | "uppercase" | "uppercase", "lowercase", or "none". |
| letterSpacing | number | 0 | Letter spacing in pixels. |
| verticalOffset | number | 0 | Vertical offset in pixels. |
| watermark | boolean | true | Show watermark on slides. |
*If slides are omitted, AI generates both text and image prompts from the topic.
*Slides array length must not exceed slideCount.
*Only valid textStyle keys are accepted — unknown keys are rejected.
*hookType sets the slideshow format name and default slide count. Use GET /api/hook-types to list available formats.
Response
{
"success": true,
"id": "ss_abc123",
"creditsCost": 3,
"pollUrl": "/api/slideshows/ss_abc123"
}Example Request
curl -X POST https://selfielabstudio.com/api/slideshows/generate \
-H "Authorization: Bearer sl_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"topic": "Morning Routine",
"hookType": "grwm",
"imageProvider": "grok-image",
"characterId": "char_abc123",
"textStyle": {
"fontSize": 48,
"textColor": "#FFFFFF",
"position": "bottom",
"textTransform": "uppercase"
}
}'Get the status and content of a generated slideshow.
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | yes | Slideshow ID (in the URL path, e.g. /api/slideshows/ss_abc123). |
*Status transitions: pending → processing → completed/failed.
*Poll every 2-3 seconds until status is "completed".
Response
{
"success": true,
"slideshow": {
"id": "ss_abc123",
"status": "completed",
"topic": "Morning Routine",
"slides": [
{
"imageUrl": "https://selfielab.app/...",
"caption": "Wake up early"
},
{
"imageUrl": "https://selfielab.app/...",
"caption": "Make coffee"
}
]
}
}Example Request
curl https://selfielabstudio.com/api/slideshows/ss_abc123 \
-H "Authorization: Bearer sl_your_api_key"Hook Types
Pass one of these slugs as the hookType parameter to set the slideshow format and default slide count. This list is dynamic — new formats can be added without API changes.
| Name | Slug | Description |
|---|---|---|
| Story Arc | story-arc | Classic 6-slide emotional journey: hook → problem → discovery → transformation → CTA. The default narrative format. |
| Before/After | before-after | Quick 4-slide transformation format: show the problem, then the dramatic result. |
| Get Ready With Me | grwm | 5-slide GRWM format: walk through a routine step by step with personality. |
| POV Story | pov-story | 5-slide immersive POV format: pull the viewer into a first-person experience. |
| Tutorial | tutorial | 6-slide how-to format: teach something step by step with a clear result. |
| Listicle | listicle | 6-slide list format: present multiple items, tips, or examples with visual variety. |
| Day in My Life | day-in-my-life | 6-slide day-in-my-life format: walk through a day with varied perspectives. |
| Hot Take | hot-take | Quick 4-slide opinion format: state a bold take, back it up, close strong. |
| Product Unboxing | product-unboxing | 5-slide unboxing format: build anticipation, reveal the product, show the reaction. |
| Outfit Check | outfit-check | 5-slide outfit showcase: present a look from multiple angles with styling details. |
Fetch the latest list programmatically: GET /api/hook-types
Hook Types
List available slideshow formats. Each hook type defines a name and default slide count.
List all active hook types. Use the slug when creating slideshows with a specific format.
*Hook type slugs are used in the hookType parameter when generating slideshows.
Response
{
"success": true,
"hookTypes": [
{
"id": "ht_abc123",
"name": "Before/After",
"slug": "before-after",
"description": "Show a dramatic transformation in 4 slides."
}
]
}Example Request
curl https://selfielabstudio.com/api/hook-types \
-H "Authorization: Bearer sl_your_api_key"Music
Generate AI music tracks using ElevenLabs.
Generate an AI music track. Cost scales with duration.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| prompt | string | yes | Description of the music style/mood (e.g. "upbeat lo-fi hip hop"). |
| duration | number | yes | Duration in milliseconds (max 300000 = 5 min). |
| preset | string | no | Optional preset name for predefined styles. |
Response
{
"success": true,
"jobId": "music_abc123"
}Example Request
curl -X POST https://selfielabstudio.com/api/generate/music \
-H "Authorization: Bearer sl_your_api_key" \
-H "Content-Type: application/json" \
-d '{"prompt": "chill lo-fi beats", "duration": 30000}'Video + Music
Mix generated music tracks into videos.
Mix a generated music track into a video. The music is mixed at 35% volume behind the original video audio. Both the video and music must belong to you and be fully processed. Free — no credits charged.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| videoId | string | yes | ID of a completed generated video. |
| musicId | string | yes | ID of a completed music generation job. |
*Both video and music must be completed (status = completed) before mixing.
*The video must have a URL — still-processing videos will be rejected.
*Returns the URL of the new mixed video uploaded to R2.
Response
{
"success": true,
"videoUrl": "https://selfielab.app/videos/mixed-abc123.mp4"
}Example Request
curl -X POST https://selfielabstudio.com/api/videos/add-music \
-H "Authorization: Bearer sl_your_api_key" \
-H "Content-Type: application/json" \
-d '{"videoId": "vid_abc123", "musicId": "music_abc123"}'