{"openapi":"3.1.0","info":{"title":"Alive Photos API","description":"Still photo → living loop package the customer **owns**.\n\n1. Get a key via claim session (`/api/v1/agent/sessions`) or dashboard.\n2. `POST /api/v1/jobs` with the still.\n3. Poll until `ready`, optionally revise/select best attempt.\n4. Download ZIP and host files on the customer's CDN — we are not a public host.\n\nHuman guide: `/app` · Agent guide: `/agents.md` · Skill: see repo `.grok/skills/alive-photos/SKILL.md`.","contact":{"name":"Alive Photos","url":"https://alivephotos.app/"},"version":"0.2.0"},"paths":{"/":{"get":{"summary":"Home","operationId":"home__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/app":{"get":{"summary":"App Dashboard","operationId":"app_dashboard_app_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/login":{"get":{"summary":"Login Page","operationId":"login_page_login_get","parameters":[{"name":"next","in":"query","required":false,"schema":{"type":"string","default":"/app","title":"Next"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Login","operationId":"login_login_post","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_login_login_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/signup":{"get":{"summary":"Signup Page","operationId":"signup_page_signup_get","parameters":[{"name":"next","in":"query","required":false,"schema":{"type":"string","default":"/app","title":"Next"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Signup","operationId":"signup_signup_post","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_signup_signup_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/logout":{"post":{"summary":"Logout","operationId":"logout_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/app/cast":{"post":{"summary":"App Cast","operationId":"app_cast_app_cast_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_app_cast_app_cast_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/jobs/{job_id}":{"get":{"summary":"Job Page","operationId":"job_page_app_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/jobs/{job_id}/select/{attempt_n}":{"post":{"summary":"App Select Attempt","operationId":"app_select_attempt_app_jobs__job_id__select__attempt_n__post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"attempt_n","in":"path","required":true,"schema":{"type":"integer","title":"Attempt N"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/jobs/{job_id}/status":{"get":{"summary":"Job Status Json","description":"Lightweight poll endpoint for the job page (session auth, no full reload).","operationId":"job_status_json_app_jobs__job_id__status_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/jobs/{job_id}/revise":{"post":{"summary":"App Revise","operationId":"app_revise_app_jobs__job_id__revise_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_app_revise_app_jobs__job_id__revise_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/jobs/{job_id}/refund":{"post":{"summary":"App Refund","operationId":"app_refund_app_jobs__job_id__refund_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/jobs/{job_id}/download":{"get":{"summary":"App Download Zip","operationId":"app_download_zip_app_jobs__job_id__download_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/keys":{"post":{"summary":"Create Key","operationId":"create_key_app_keys_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_create_key_app_keys_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/keys/{key_id}/revoke":{"post":{"summary":"Revoke Key","operationId":"revoke_key_app_keys__key_id__revoke_post","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/billing":{"get":{"summary":"Billing Page","operationId":"billing_page_app_billing_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/app/checkout/{pack_id}":{"get":{"summary":"Checkout","operationId":"checkout_app_checkout__pack_id__get","parameters":[{"name":"pack_id","in":"path","required":true,"schema":{"type":"string","title":"Pack Id"}},{"name":"agent_session","in":"query","required":false,"schema":{"type":"string","default":"","title":"Agent Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Checkout","operationId":"checkout_app_checkout__pack_id__post","parameters":[{"name":"pack_id","in":"path","required":true,"schema":{"type":"string","title":"Pack Id"}},{"name":"agent_session","in":"query","required":false,"schema":{"type":"string","default":"","title":"Agent Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/app/billing/success":{"get":{"summary":"Billing Success","operationId":"billing_success_app_billing_success_get","parameters":[{"name":"token","in":"query","required":false,"schema":{"type":"string","default":"","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs":{"post":{"tags":["jobs"],"summary":"Create cast job","operationId":"createJob","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_createJob"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"402":{"description":"Insufficient credits"},"403":{"description":"Moderation blocked"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["jobs"],"summary":"List jobs","operationId":"listJobs","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}":{"get":{"tags":["jobs"],"summary":"Get job status","operationId":"getJob","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/revise":{"post":{"tags":["jobs"],"summary":"Revise job (included attempts)","operationId":"reviseJob","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_reviseJob"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/refund":{"post":{"tags":["jobs"],"summary":"Request refund","operationId":"refundJob","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/select/{attempt_n}":{"post":{"tags":["jobs"],"summary":"Select best attempt","description":"Pick which revise attempt is the canonical package for download.","operationId":"selectJobAttempt","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"attempt_n","in":"path","required":true,"schema":{"type":"integer","title":"Attempt N"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/download":{"get":{"tags":["jobs"],"summary":"Download ZIP package","operationId":"downloadJobZip","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"t","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"T"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/files/{kind}":{"get":{"tags":["jobs"],"summary":"Download single artifact file","operationId":"downloadJobFile","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"kind","in":"path","required":true,"schema":{"type":"string","title":"Kind"}},{"name":"t","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"T"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/me":{"get":{"tags":["account"],"summary":"Account balance and pricing","operationId":"getMe","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"tags":["meta"],"summary":"Liveness and feature flags","operationId":"health","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/agent/sessions":{"post":{"tags":["agent"],"summary":"Start agent claim session","description":"Start an agent bootstrap session (no prior API key required).\n\nBody JSON (all optional):\n  { \"pack_id\": \"starter\", \"label\": \"codex\" }\n\nReturns claim_url for the human + poll_secret for the agent.\nAgent polls GET /api/v1/agent/sessions/{id} with the poll secret until ready,\nthen receives the API key once.","operationId":"createAgentSession","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/agent/sessions/{session_id}":{"get":{"tags":["agent"],"summary":"Poll claim session (receive API key once)","operationId":"pollAgentSession","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"secret","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Secret"}},{"name":"x-agent-session-secret","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Agent-Session-Secret"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/claim/{session_id}":{"get":{"summary":"Claim Page","operationId":"claim_page_claim__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/claim/{session_id}/authorize":{"post":{"summary":"Claim Authorize","description":"Human authorizes agent: attach user, optionally require pack, mint API key.","operationId":"claim_authorize_claim__session_id__authorize_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents.md":{"get":{"tags":["meta"],"summary":"Full agent guide (markdown)","description":"Agent-oriented instructions (plain markdown).","operationId":"agentsGuide","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/skill.md":{"get":{"tags":["meta"],"summary":"Compact agent skill (markdown)","description":"Short skill for coding agents — points at /agents.md for full detail.","operationId":"agentSkill","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"Body_app_cast_app_cast_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"title":{"type":"string","title":"Title","default":""},"prompt":{"type":"string","title":"Prompt","default":""},"duration":{"type":"integer","title":"Duration","default":6},"resolution":{"type":"string","title":"Resolution","default":""}},"type":"object","required":["file"],"title":"Body_app_cast_app_cast_post"},"Body_app_revise_app_jobs__job_id__revise_post":{"properties":{"prompt":{"type":"string","title":"Prompt","default":""},"duration":{"type":"integer","title":"Duration","default":0},"resolution":{"type":"string","title":"Resolution","default":""}},"type":"object","title":"Body_app_revise_app_jobs__job_id__revise_post"},"Body_createJob":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"title":{"type":"string","title":"Title","default":""},"prompt":{"type":"string","title":"Prompt","default":""},"duration":{"type":"integer","title":"Duration","default":6},"resolution":{"type":"string","title":"Resolution","default":""}},"type":"object","required":["file"],"title":"Body_createJob"},"Body_create_key_app_keys_post":{"properties":{"label":{"type":"string","title":"Label","default":"default"}},"type":"object","title":"Body_create_key_app_keys_post"},"Body_login_login_post":{"properties":{"email":{"type":"string","title":"Email"},"password":{"type":"string","title":"Password"},"next":{"type":"string","title":"Next","default":"/app"}},"type":"object","required":["email","password"],"title":"Body_login_login_post"},"Body_reviseJob":{"properties":{"prompt":{"type":"string","title":"Prompt","default":""},"duration":{"type":"integer","title":"Duration","default":0},"resolution":{"type":"string","title":"Resolution","default":""}},"type":"object","title":"Body_reviseJob"},"Body_signup_signup_post":{"properties":{"email":{"type":"string","title":"Email"},"password":{"type":"string","title":"Password"},"next":{"type":"string","title":"Next","default":"/app"}},"type":"object","required":["email","password"],"title":"Body_signup_signup_post"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"tags":[{"name":"agent","description":"Bootstrap without an API key: claim session → human authorize/pay → key once."},{"name":"jobs","description":"Cast stills, poll status, revise, pick best attempt, download ZIP."},{"name":"account","description":"Balance, packs, pricing, refund caps."},{"name":"meta","description":"Health and agent documentation."}]}