{"openapi":"3.1.0","info":{"title":"Video Moment Finder Public API","description":"Agent-ready REST API for uploading a video, polling processing status, and searching by text. Internal web-only routes are excluded from this schema.","version":"0.2.0"},"paths":{"/api/v1/billing/units/checkout":{"post":{"tags":["v1"],"summary":"V1 Api Billing Checkout","description":"Create checkout session for Developer Pack (JWT-only).","operationId":"v1_api_billing_checkout_api_v1_billing_units_checkout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiCheckoutRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingCheckoutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/billing/units/summary":{"get":{"tags":["v1"],"summary":"V1 Api Billing Summary","description":"Return API unit balance and approximate equivalents.","operationId":"v1_api_billing_summary_api_v1_billing_units_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiBillingSummaryResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/billing/units/usage":{"get":{"tags":["v1"],"summary":"V1 Api Billing Usage","description":"Return recent API usage events.","operationId":"v1_api_billing_usage_api_v1_billing_units_usage_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"api_key_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ApiUsageEventResponse"},"title":"Response V1 Api Billing Usage Api V1 Billing Units Usage Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/keys":{"get":{"tags":["v1"],"summary":"List Api Keys","description":"List the caller's active API keys.","operationId":"list_api_keys_api_v1_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ApiKeyResponse"},"type":"array","title":"Response List Api Keys Api V1 Keys Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["v1"],"summary":"Create Api Key","description":"Create a new API key. The raw key is returned once and never stored.","operationId":"create_api_key_api_v1_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreatedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/keys/{key_id}":{"delete":{"tags":["v1"],"summary":"Revoke Api Key","description":"Revoke an API key (soft delete).","operationId":"revoke_api_key_api_v1_keys__key_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/videos/upload":{"post":{"tags":["v1"],"summary":"V1 Upload Video","operationId":"v1_upload_video_api_v1_videos_upload_post","security":[{"HTTPBearer":[]}],"parameters":[{"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_v1_upload_video_api_v1_videos_upload_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/videos/upload/init":{"post":{"tags":["v1"],"summary":"V1 Init Upload","operationId":"v1_init_upload_api_v1_videos_upload_init_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadInitRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadInitResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/videos/upload/complete":{"post":{"tags":["v1"],"summary":"V1 Complete Upload","operationId":"v1_complete_upload_api_v1_videos_upload_complete_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadCompleteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/videos":{"get":{"tags":["v1"],"summary":"V1 List My Videos","operationId":"v1_list_my_videos_api_v1_videos_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/VideoResponse"},"type":"array","title":"Response V1 List My Videos Api V1 Videos Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/videos/{video_id}":{"get":{"tags":["v1"],"summary":"V1 Get Video","operationId":"v1_get_video_api_v1_videos__video_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"video_id","in":"path","required":true,"schema":{"type":"string","title":"Video Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/videos/{video_id}/search":{"post":{"tags":["v1"],"summary":"V1 Search Video","operationId":"v1_search_video_api_v1_videos__video_id__search_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"video_id","in":"path","required":true,"schema":{"type":"string","title":"Video Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoSearchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoSearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ApiBillingSummaryResponse":{"properties":{"api_units_balance":{"type":"integer","title":"Api Units Balance"},"unit_cost_index_video":{"type":"integer","title":"Unit Cost Index Video"},"unit_cost_text_query":{"type":"integer","title":"Unit Cost Text Query"},"approx_videos":{"type":"integer","title":"Approx Videos"},"approx_queries":{"type":"integer","title":"Approx Queries"}},"type":"object","required":["api_units_balance","unit_cost_index_video","unit_cost_text_query","approx_videos","approx_queries"],"title":"ApiBillingSummaryResponse"},"ApiCheckoutRequest":{"properties":{"plan":{"type":"string","const":"developer","title":"Plan"},"return_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Return Path"}},"type":"object","required":["plan"],"title":"ApiCheckoutRequest"},"ApiKeyCreatedResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"key_prefix":{"type":"string","title":"Key Prefix"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"last_used_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Used At"},"key":{"type":"string","title":"Key"}},"type":"object","required":["id","name","key_prefix","key"],"title":"ApiKeyCreatedResponse"},"ApiKeyResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"key_prefix":{"type":"string","title":"Key Prefix"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"last_used_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Used At"}},"type":"object","required":["id","name","key_prefix"],"title":"ApiKeyResponse"},"ApiUsageEventResponse":{"properties":{"id":{"type":"string","title":"Id"},"api_key_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key Id"},"event_type":{"type":"string","title":"Event Type"},"units":{"type":"integer","title":"Units"},"video_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Video Id"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["id","api_key_id","event_type","units","video_id","created_at"],"title":"ApiUsageEventResponse"},"BillingCheckoutResponse":{"properties":{"provider":{"type":"string","const":"lemonsqueezy","title":"Provider"},"plan":{"type":"string","enum":["starter","pro","developer"],"title":"Plan"},"credits":{"type":"integer","title":"Credits"},"checkout_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Checkout Url"},"test_mode":{"type":"boolean","title":"Test Mode"}},"type":"object","required":["provider","plan","credits","checkout_url","test_mode"],"title":"BillingCheckoutResponse"},"Body_v1_upload_video_api_v1_videos_upload_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_v1_upload_video_api_v1_videos_upload_post"},"CreateApiKeyRequest":{"properties":{"name":{"type":"string","title":"Name","default":""}},"type":"object","title":"CreateApiKeyRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"SearchResult":{"properties":{"timestamp_s":{"type":"number","title":"Timestamp S"},"thumbnail_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Thumbnail Url"},"score":{"type":"number","title":"Score"},"source":{"type":"string","enum":["visual","transcript"],"title":"Source","description":"Retrieval source for this result."},"transcript_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transcript Text"}},"type":"object","required":["timestamp_s","score","source"],"title":"SearchResult"},"UploadCompleteRequest":{"properties":{"video_id":{"type":"string","maxLength":200,"minLength":1,"title":"Video Id"},"filename":{"type":"string","maxLength":200,"minLength":1,"title":"Filename"}},"type":"object","required":["video_id","filename"],"title":"UploadCompleteRequest"},"UploadInitRequest":{"properties":{"filename":{"type":"string","maxLength":200,"minLength":1,"title":"Filename"},"content_type":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Content Type"}},"type":"object","required":["filename"],"title":"UploadInitRequest"},"UploadInitResponse":{"properties":{"video_id":{"type":"string","title":"Video Id"},"key":{"type":"string","title":"Key"},"upload_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Upload Url"},"expires_in":{"type":"integer","title":"Expires In"}},"type":"object","required":["video_id","key","upload_url","expires_in"],"title":"UploadInitResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VideoResponse":{"properties":{"id":{"type":"string","title":"Id"},"youtube_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Youtube Url"},"status":{"type":"string","enum":["queued","processing","ready","failed"],"title":"Status"},"source_type":{"type":"string","enum":["youtube","upload"],"title":"Source Type"},"source_filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Filename"},"source_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Source Url"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"}},"type":"object","required":["id","youtube_url","status","source_type","created_at"],"title":"VideoResponse"},"VideoSearchRequest":{"properties":{"query_text":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Query Text"},"limit":{"type":"integer","maximum":20.0,"minimum":1.0,"title":"Limit","description":"Per-source result cap. Text search can return up to this many visual matches plus this many spoken matches.","default":5}},"type":"object","title":"VideoSearchRequest"},"VideoSearchResponse":{"properties":{"video_id":{"type":"string","title":"Video Id"},"youtube_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Youtube Url"},"source_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Source Url"},"status":{"type":"string","enum":["queued","processing","ready","failed"],"title":"Status"},"results":{"items":{"$ref":"#/components/schemas/SearchResult"},"type":"array","title":"Results"}},"type":"object","required":["video_id","youtube_url","status","results"],"title":"VideoSearchResponse"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}