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.

Base URLhttps://selfielabstudio.com/api/
developers hub

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_key
X-API-Key: sl_your_api_key

Error Codes

401Invalid or missing API key.
402Insufficient credits for this operation.
403Feature requires a higher subscription tier.

Credit Costs

Image Generation

ProviderSlugCreditsNotes
Gemini (Nano Banana Pro)gemini3Subscribers: 2 credits. 4K: doubled.
Gemini Nano (Nano Banana Fast)gemini-nano1
GPT Image 1.5gpt-image-1.52
GPT Image 2gpt-image-224K: 4 credits
Seedream 4.5seedream-4.524K: 4 credits.
Flux 2 Profal-flux-2-pro2
Flux 2 Maxfal-flux-2-max4
Grok Imaginegrok-image2
Grok Imagine Progrok-image-pro4
Kling Image v3kling-image-v324K: 4 credits.

Video Generation

ProviderCreditsNotes
Veo 3.12/secPremium: 4/sec.
Sora 22/secPremium: 4/sec.
Pika 2.22/secPremium: 4/sec.
Seedance2/secPremium: 4/sec.
Wan 2.52/secPremium: 4/sec.
Grok Video1/secPremium: 4/sec.
Kling Motion1/secPremium: 4/sec.
Kling Avatar1/secPremium: 4/sec.

Other

FeatureCreditsNotes
Music (≤15s)2+3 per additional 30s segment.
Slideshow (Grok Image)3Flat rate: 3 (1-6 slides) or 6 (7-10). Other providers: per-image cost × slides.
3D Model4
Realism Enhancement1

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

NameTypeRequiredDescription
includeRecentbooleannoInclude 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

NameTypeRequiredDescription
namestringyesA 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

NameTypeRequiredDescription
keyIdstringyesThe 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

NameTypeRequiredDescription
limitnumbernoNumber of characters to return (default 50).
offsetnumbernoOffset 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

NameTypeRequiredDescription
namestringyesDisplay name for the character.
referenceUrlstringnoURL of the reference face image. Required if referenceImage is not provided.
referenceImagestringnoBase64 data URI (e.g. "data:image/jpeg;base64,..."). Max 10 MB decoded. Supported: jpeg, png, webp, gif. Required if referenceUrl is not provided.
descriptionstringnoOptional description of the character.
hairColorstringnoHair color.
hairStylestringnoHair 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

NameTypeRequiredDescription
idstringyesCharacter 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

NameTypeRequiredDescription
namestringnoNew display name.
referenceUrlstringnoNew reference image URL.
referenceImagestringnoNew reference image as base64 data URI (e.g. "data:image/jpeg;base64,..."). Max 10 MB.
descriptionstringnoUpdated description.
hairColorstringnoHair color.
hairStylestringnoHair style.
notesstringnoFree-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

NameTypeRequiredDescription
idstringyesCharacter 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.

Cost: 1-3 credits (see pricing table, 4K doubles cost)

Request Body

NameTypeRequiredDescription
formDataCharacterFormDatayesStructured form data with subject, photography, background, accessories, and composition fields.
referenceImagestringnoBase64-encoded reference image for face consistency.
simplePromptstringnoDirect text prompt (bypasses structured form data).
numImagesnumbernoNumber of images to generate (1-6, default 1).
enable4KbooleannoEnable 4K resolution (gemini, seedream-4.5, kling-image-v3 only). Doubles credit cost.

Available Providers

SlugProviderCredits4K
geminiGemini (Nano Banana Pro)3 (subscribers: 2)yes
gemini-nanoGemini Nano (Nano Banana Fast)1
gpt-image-1.5GPT Image 1.52
gpt-image-2GPT Image 22yes
seedream-4.5Seedream 4.52yes
fal-flux-2-proFlux 2 Pro2
fal-flux-2-maxFlux 2 Max4
grok-imageGrok Imagine2
grok-image-proGrok Imagine Pro4
kling-image-v3Kling Image v32yes

*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.

Cost: 1-2 credits/sec (premium: 4/sec)

Request Body

NameTypeRequiredDescription
imageIdstringnoID of a previously generated image. Required if uploadedImageUrl is not provided.
uploadedImageUrlstringnoURL of an uploaded image. Required if imageId is not provided.
imageUrlstringnoAlias for uploadedImageUrl. Accepts any image URL (e.g. from a completed image job's imageUrl). If both are provided, uploadedImageUrl takes precedence.
promptstringyesMotion/action prompt for the video.
aspectRatiostringyesVideo aspect ratio: "9:16" or "16:9".
providerstringnoVideo provider slug (see table below). Default: seedance.
isPremiumbooleannoUse premium quality variant (4 credits/sec).
durationnumbernoOutput duration in seconds. Ranges: seedance 4-12, grok-video 1-15, kling-motion 5-30.
skipEnhancementbooleannoSkip automatic prompt enhancement (default: false).
referenceVideoUrlstringnoURL of a reference video to copy motion from. Required for kling-motion provider.

Available Providers

SlugProviderCreditsPremium
veo-3.1Veo 3.12/sec4/sec
soraSora 22/sec4/sec
seedanceSeedance2/sec4/sec
wanWan 2.52/sec4/sec
grok-videoGrok Video1/sec4/sec
kling-motionKling Motion1/sec4/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.

Cost: 1-2 credits/sec (premium: 4/sec)

Request Body

NameTypeRequiredDescription
imageIdstringnoID of a previously generated image. Required if uploadedImageUrl is not provided.
uploadedImageUrlstringnoURL of an uploaded image. Required if imageId is not provided.
imageUrlstringnoAlias for uploadedImageUrl. Accepts any image URL (e.g. from a completed image job's imageUrl). If both are provided, uploadedImageUrl takes precedence.
promptstringyesScene/motion prompt for the avatar video.
dialoguestringnoDialogue text for the avatar to speak. Duration is estimated from text length (~150 chars = 10 seconds).
aspectRatiostringyesVideo aspect ratio: "9:16" or "16:9".
providerstringyesAvatar provider: "kling-avatar", "creatify-aurora", or "veed-fabric".
isPremiumbooleannoUse premium quality variant (4 credits/sec).
voiceIdstringnoVoice ID from ElevenLabs or Fish Audio for text-to-speech on the dialogue.
voiceProviderstringnoVoice service provider: "elevenlabs" or "fish-audio".
voiceAudioUrlstringnoURL of pre-generated voice audio to use instead of TTS.
s2sAudioUrlstringnoURL of speech-to-speech audio for voice replacement.
s2sDurationnumbernoDuration of S2S audio in seconds (for credit calculation).
skipEnhancementbooleannoSkip automatic prompt enhancement (default: false).

Available Providers

SlugProviderCreditsPremium
kling-avatarKling Avatar1/sec4/sec
creatify-auroraCreatify Aurora2/sec4/sec
veed-fabricVEED Fabric2/sec4/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.

Cost: Free

*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.

Cost: Processing (image free; video uses fal ffmpeg)

Request Body

NameTypeRequiredDescription
textstringyesCaption text (1–120 chars).
imageUrlstringnoImage URL to caption (required if videoUrl omitted).
videoUrlstringnoVideo URL to caption (required if imageUrl omitted).
positionstringno"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

NameTypeRequiredDescription
videoUrlsstring[]yesArray 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

NameTypeRequiredDescription
videoUrlstringyesSource video HTTPS URL.
startTimenumberyesStart seconds (≥ 0).
endTimenumberyesEnd 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

NameTypeRequiredDescription
videoUrlstringyesSource 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.

Cost: Vision call (no image generation credits)

Request Body

NameTypeRequiredDescription
imageUrlstringyesImage 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.

Cost: 2 credits

Request Body

NameTypeRequiredDescription
imageUrlstringyesSource 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

NameTypeRequiredDescription
includeRecentbooleannoWhen 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

NameTypeRequiredDescription
imageTypestringnoFilter by type: "image" or "video" (default: all).
showAllbooleannoReturn 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

NameTypeRequiredDescription
idstringyesThe 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.

Cost: Depends on provider. Grok Image: 3 credits (1-6 slides) / 6 credits (7-10). Others: per-image cost × slide count.

Request Body

NameTypeRequiredDescription
topicstringyesThe topic or title for the slideshow.
characterIdstringnoCharacter ID to use as the face in slideshow images.
hookTypestringnoHook 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.
slideCountnumbernoNumber of slides to generate (1-10). Defaults to the hook type's default if hookType is set, otherwise 6.
imageProviderstringnoImage 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".
productNamestringnoProduct or app name to subtly mention in slide content and CTA.
productDescriptionstringnoDescription of the product/app. Helps AI write accurate, specific copy when mentioning it.
slidesSlide[]noPre-defined slides array. Length must not exceed slideCount. See slides[] object below.
textStyleTextStylenoText 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.
NameTypeDescription
textstringText content displayed on the slide.
imagePromptstringPrompt used to generate the slide background image.
textStyleAll fields are optional and merge with sensible defaults.
NameTypeDefaultDescription
positionstring"bottom""bottom", "top", or "center".
fontSizenumber56Font size in pixels.
fontFamilystring"impact"Font family name.
textColorstring"#FFFFFF"Text color hex.
strokeColorstring"#000000"Text stroke color hex.
strokeWidthnumber3Stroke width in pixels.
bgBarOpacitynumber0.5Background bar opacity (0-1).
bgBarColorstring"#000000"Background bar color hex.
bgBarModestring"full"Background bar mode.
textAlignstring"center"Text alignment.
maxCharsPerLinenumber20Max characters per line before wrapping.
textTransformstring"uppercase""uppercase", "lowercase", or "none".
letterSpacingnumber0Letter spacing in pixels.
verticalOffsetnumber0Vertical offset in pixels.
watermarkbooleantrueShow 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

NameTypeRequiredDescription
idstringyesSlideshow 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.

NameSlugDescription
Story Arcstory-arcClassic 6-slide emotional journey: hook → problem → discovery → transformation → CTA. The default narrative format.
Before/Afterbefore-afterQuick 4-slide transformation format: show the problem, then the dramatic result.
Get Ready With Megrwm5-slide GRWM format: walk through a routine step by step with personality.
POV Storypov-story5-slide immersive POV format: pull the viewer into a first-person experience.
Tutorialtutorial6-slide how-to format: teach something step by step with a clear result.
Listiclelisticle6-slide list format: present multiple items, tips, or examples with visual variety.
Day in My Lifeday-in-my-life6-slide day-in-my-life format: walk through a day with varied perspectives.
Hot Takehot-takeQuick 4-slide opinion format: state a bold take, back it up, close strong.
Product Unboxingproduct-unboxing5-slide unboxing format: build anticipation, reveal the product, show the reaction.
Outfit Checkoutfit-check5-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.

Cost: 2 credits (≤15s), 5 credits (30s), +3 per additional 30s

Request Body

NameTypeRequiredDescription
promptstringyesDescription of the music style/mood (e.g. "upbeat lo-fi hip hop").
durationnumberyesDuration in milliseconds (max 300000 = 5 min).
presetstringnoOptional 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.

Cost: Free

Request Body

NameTypeRequiredDescription
videoIdstringyesID of a completed generated video.
musicIdstringyesID 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"}'

library

no items found