API Docs

AI image effects and video face detection over a simple HTTP API.

Base URL: https://myselfie.app/v1

Authentication

All API requests are authenticated with an API key in the x-api-key header.

x-api-key: msa_your_key_here

Get a key: sign in to the Studio โ†’ API keys โ†’ Create key. The key is shown once โ€” store it securely. You can revoke keys anytime.

Requests without a valid key return 401.

Credits

API usage draws from the same credit balance as the app: a number of free effects per day, then paid credits. When you're out, endpoints that consume credits return 402 { "error": "no_credits" }. Failed jobs are automatically refunded.

Image effects

Apply an AI effect to an image. Processing is asynchronous: submit a job, then poll for the result.

POST/v1/images

Body (JSON):

FieldTypeDescription
effectstringEffect id (see list below)
imagestringPublic https:// image URL, or a data:image/...;base64, URI
curl -X POST https://myselfie.app/v1/images \
  -H "x-api-key: $KEY" -H "content-type: application/json" \
  -d '{"effect":"anime","image":"https://example.com/selfie.jpg"}'

# => { "jobId": "7a6f694a-..." }   (HTTP 202)

GET/v1/images/{jobId}

curl https://myselfie.app/v1/images/7a6f694a-... -H "x-api-key: $KEY"

# processing: { "status": "processing" }
# done:       { "status": "done", "url": "https://...signed...png",
#               "download": "https://...", "credits": { "freeRemaining": 2, "credits": 0 } }
# failed:     { "status": "error", "credits": {...} }   (not charged)

url is a temporary (1-hour) signed link to the watermarked PNG.

Effect ids

olderyoungersmile animeoilcyberpunk sketchcartoon3dvangogh popartvintagesuperhero beardheadshotwatercolor restoreupscalenobg

Video face detection

Detect when faces appear in a video. Rekognition-backed and asynchronous; jobs run at roughly 2โ€“3ร— the clip length. Video must be H.264 (MP4 or MOV).

POST/v1/videos/uploads

Get a one-hour presigned URL to upload your video, then PUT the file to it.

# 1. get an upload URL
curl -X POST https://myselfie.app/v1/videos/uploads \
  -H "x-api-key: $KEY" -H "content-type: application/json" \
  -d '{"contentType":"video/mp4"}'
# => { "uploadUrl": "https://...", "key": "videos/.../uuid.mp4" }

# 2. upload the file
curl -X PUT "$UPLOAD_URL" -H "content-type: video/mp4" --data-binary @video.mp4

POST/v1/videos

curl -X POST https://myselfie.app/v1/videos \
  -H "x-api-key: $KEY" -H "content-type: application/json" \
  -d '{"key":"videos/.../uuid.mp4"}'
# => { "jobId": "adcb7058..." }   (HTTP 202)

GET/v1/videos/{jobId}

curl https://myselfie.app/v1/videos/adcb7058... -H "x-api-key: $KEY"

# processing: { "status": "IN_PROGRESS" }
# done: {
#   "status": "SUCCEEDED", "durationMs": 89075, "sampleCount": 203,
#   "samples": [
#     { "t": 0,   "faces": [ { "w":0.21,"h":0.17,"l":0.41,"t":0.37,"conf":99.99 } ] },
#     { "t": 504, "faces": [ { ... } ] }
#   ]
# }

Each sample is a timestamp (t, milliseconds) with the face bounding boxes detected at that moment (normalized 0โ€“1: left, top, width, height, plus confidence). Group nearby boxes to build a per-face timeline.

Errors

StatusMeaning
401Missing or invalid API key
402Out of free effects and credits
400Bad request (missing/invalid fields)
404Unknown route or job