{"openapi":"3.2.0","info":{"title":"Captioner Workflow","version":"1.0.0","description":"Cloudflare-native Flue workflow for generating corrected YouTube SRT captions from short-term R2 audio storage, with provider adapters for transcription and terminology audit."},"servers":[{"url":"https://caption.chan.dev"}],"security":[{"bearerAuth":[]}],"paths":{"/":{"get":{"operationId":"getCaptionerServiceDiscovery","summary":"Get the agent-facing service discovery document","description":"Returns semantic HTML by default, or Markdown when requested with Accept: text/markdown. The document includes agent instructions, endpoint links, media policy, example requests, terminology pack discovery, and a pointer to the canonical OpenAPI document.","security":[],"responses":{"200":{"description":"Agent-facing service discovery document","headers":{"Link":{"schema":{"type":"string"},"description":"RFC 8288 discovery links for API catalog, OpenAPI, auth.md, MCP Server Card, and agent skills."},"x-markdown-tokens":{"schema":{"type":"string"},"description":"Present on text/markdown responses with an approximate token count."}},"content":{"text/html":{"schema":{"type":"string"}},"text/markdown":{"schema":{"type":"string"}}}}}}},"/robots.txt":{"get":{"operationId":"getRobotsTxt","summary":"Get robots.txt with sitemap discovery","security":[],"responses":{"200":{"description":"robots.txt","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/sitemap.xml":{"get":{"operationId":"getSitemapXml","summary":"Get XML sitemap for public discovery resources","security":[],"responses":{"200":{"description":"XML sitemap","content":{"application/xml":{"schema":{"type":"string"}}}}}}},"/health":{"get":{"operationId":"getHealth","summary":"Get service health","security":[],"responses":{"200":{"description":"Health status","content":{"application/json":{"schema":{"type":"object","required":["ok"],"additionalProperties":false,"properties":{"ok":{"type":"boolean"}}}}}}}}},"/auth.md":{"get":{"operationId":"getCaptionerAuthMarkdown","summary":"Get the agent-facing auth.md document","description":"Returns the user-claimed email-required agent registration flow for WorkOS API key credentials.","security":[],"responses":{"200":{"description":"Agent-facing auth.md document","content":{"text/markdown":{"schema":{"type":"string"}}}}}}},"/.well-known/api-catalog":{"get":{"operationId":"getApiCatalog","summary":"Get the RFC 9727 API catalog","description":"Returns a linkset that advertises the Captioner OpenAPI description, service documentation, auth.md, and health endpoint.","security":[],"responses":{"200":{"description":"API catalog linkset","content":{"application/linkset+json":{"schema":{"type":"object","required":["linkset"],"additionalProperties":true,"properties":{"linkset":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}}}}},"/.well-known/oauth-protected-resource":{"get":{"operationId":"getOAuthProtectedResourceMetadata","summary":"Get protected resource metadata","description":"Advertises the Captioner resource, supported scopes, bearer method, and agent auth metadata.","security":[],"responses":{"200":{"description":"OAuth protected resource metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProtectedResourceMetadata"}}}}}}},"/.well-known/oauth-authorization-server":{"get":{"operationId":"getOAuthAuthorizationServerMetadata","summary":"Get agent authorization server metadata","description":"Advertises the agent registration and claim-completion endpoints for Captioner.","security":[],"responses":{"200":{"description":"Agent authorization server metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizationServerMetadata"}}}}}}},"/.well-known/mcp/server-card.json":{"get":{"operationId":"getMcpServerCard","summary":"Get the MCP Server Card","description":"Advertises Captioner MCP-style discovery metadata and public resources.","security":[],"responses":{"200":{"description":"MCP Server Card","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/.well-known/agent-skills/index.json":{"get":{"operationId":"getAgentSkillsIndex","summary":"Get the agent skills discovery index","description":"Returns the Agent Skills Discovery RFC v0.2.0 index for the Captioner SKILL.md artifact.","security":[],"responses":{"200":{"description":"Agent skills discovery index","content":{"application/json":{"schema":{"type":"object","required":["$schema","skills"],"additionalProperties":false,"properties":{"$schema":{"type":"string"},"skills":{"type":"array","items":{"type":"object","required":["name","type","description","url","digest"],"additionalProperties":false,"properties":{"name":{"type":"string"},"type":{"type":"string","enum":["skill-md","archive"]},"description":{"type":"string"},"url":{"type":"string","format":"uri"},"digest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"}}}}}}}}}}}},"/agent/auth":{"post":{"operationId":"startAgentAuth","summary":"Start agent credential registration","description":"Starts the user-claimed email-required flow. Captioner sends a WorkOS Magic Auth code and returns a claim token.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAuthRequest"}}}},"responses":{"200":{"description":"Claim token issued and Magic Auth code sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAuthStarted"}}}},"400":{"description":"Invalid registration request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Registration rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/agent/auth/claim":{"post":{"operationId":"claimAgentAuth","summary":"Unsupported generic claim endpoint","description":"Captioner supports the email-required claim flow, so agents should complete with /agent/auth/claim/complete.","security":[],"responses":{"400":{"description":"Generic claim endpoint is not supported","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/agent/auth/claim/complete":{"post":{"operationId":"completeAgentAuthClaim","summary":"Complete agent credential claim","description":"Verifies the WorkOS Magic Auth code and returns a WorkOS organization-scoped API key exactly once.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAuthCompleteRequest"}}}},"responses":{"200":{"description":"WorkOS API key issued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAuthCompleted"}}}},"400":{"description":"Invalid claim completion request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid claim token or Magic Auth code","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Claim token has already been used","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"Claim token expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many claim attempts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/audio/{key}":{"put":{"operationId":"putAudioObject","summary":"Store an audio object in short-term R2 storage","description":"This endpoint accepts MP3 audio only, up to 100 MiB. Upload keys must end in .mp3 and requests should use Content-Type audio/mpeg. Non-MP3 uploads return 415 with a local ffmpeg extraction recommendation; oversized uploads return 413. Requires a WorkOS API key with the Captioner scope captioner:audio:upload.","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"audio/mpeg":{"schema":{"type":"string","contentMediaType":"audio/mpeg","contentEncoding":"binary","maxLength":104857600}}}},"responses":{"200":{"description":"Object stored","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AudioObjectReceipt"}}}},"401":{"description":"Missing or invalid WorkOS API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"WorkOS API key is missing the Captioner scope captioner:audio:upload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"MP3 upload exceeds the maximum accepted size","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Mp3TooLargeError"}}}},"415":{"description":"Only MP3 audio is accepted; convert locally before upload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Mp3RequiredError"}}}}}}},"/terminology/packs":{"get":{"operationId":"listTerminologyPacks","summary":"List terminology packs that can be included in captioner payloads","description":"Returns valid term pack IDs and lightweight metadata. Use these IDs in payload.terminology.packs.","security":[],"responses":{"200":{"description":"Available terminology packs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TermPackList"}}}}}}},"/skills/captioner/SKILL.md":{"get":{"operationId":"getCaptionerAgentSkill","summary":"Get the minimal agent skill for routing local media through captioner","description":"Returns a small SKILL.md that tells agents to use the service root and OpenAPI document as the live discovery surfaces.","security":[],"responses":{"200":{"description":"Captioner agent skill","content":{"text/markdown":{"schema":{"type":"string"}}}}}}},"/workflows/captioner":{"post":{"operationId":"runCaptionerWorkflow","summary":"Start the captioner workflow","description":"Requires a WorkOS API key with the Captioner scope captioner:caption:run.","parameters":[{"name":"wait","in":"query","required":false,"schema":{"type":"string","enum":["result"]},"description":"Use wait=result to receive the completed JSON result in the response."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaptionerPayload"}}}},"responses":{"200":{"description":"Workflow result when wait=result is used. The result can be completed, blocked by moderation, or failed with structured follow-up suggestions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowResultEnvelope"}}}},"202":{"description":"Accepted workflow run","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowAccepted"}}}},"401":{"description":"Missing or invalid WorkOS API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"WorkOS API key is missing the Captioner scope captioner:caption:run","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"WorkOS API Key. Discover registration through /auth.md."}},"schemas":{"ErrorResponse":{"type":"object","required":["error"],"additionalProperties":false,"properties":{"error":{"type":"object","required":["code","message"],"additionalProperties":false,"properties":{"code":{"type":"string"},"message":{"type":"string"},"workos":{"type":"object","required":["status","code"],"additionalProperties":false,"properties":{"status":{"type":"integer"},"code":{"type":"string"},"request":{"type":"object","required":["method","path"],"additionalProperties":false,"properties":{"method":{"type":"string"},"path":{"type":"string"}}}}}}}}},"ProtectedResourceMetadata":{"type":"object","required":["resource","authorization_servers","scopes_supported","bearer_methods_supported","agent_auth"],"additionalProperties":true,"properties":{"resource":{"type":"string"},"resource_name":{"type":"string"},"resource_documentation":{"type":"string"},"authorization_servers":{"type":"array","items":{"type":"string"}},"scopes_supported":{"type":"array","items":{"$ref":"#/components/schemas/CaptionerScope"}},"bearer_methods_supported":{"type":"array","items":{"type":"string"}},"agent_auth":{"$ref":"#/components/schemas/AgentAuthMetadata"}}},"AuthorizationServerMetadata":{"type":"object","required":["issuer","agent_auth"],"additionalProperties":true,"properties":{"issuer":{"type":"string"},"scopes_supported":{"type":"array","items":{"$ref":"#/components/schemas/CaptionerScope"}},"agent_auth":{"$ref":"#/components/schemas/AgentAuthMetadata"}}},"AgentAuthMetadata":{"type":"object","required":["skill","auth_md","register_uri","claim_uri","claim_complete_uri","flows_supported","identity_types_supported","credential_types_supported","identity_assertion","events_supported","organization_scoped","credential_storage"],"additionalProperties":true,"properties":{"skill":{"type":"string"},"auth_md":{"type":"string"},"register_uri":{"type":"string"},"claim_uri":{"type":"string"},"claim_complete_uri":{"type":"string"},"flows_supported":{"type":"array","items":{"type":"string"}},"identity_types_supported":{"type":"array","items":{"type":"string"}},"assertion_types_supported":{"type":"array","items":{"type":"string"}},"credential_types_supported":{"type":"array","items":{"type":"string"}},"identity_assertion":{"type":"object","required":["assertion_types_supported","credential_types_supported"],"additionalProperties":false,"properties":{"assertion_types_supported":{"type":"array","items":{"type":"string"}},"credential_types_supported":{"type":"array","items":{"type":"string"}}}},"unsupported_identity_types":{"type":"array","items":{"type":"string"}},"unsupported_assertion_types":{"type":"array","items":{"type":"string"}},"unsupported_credential_types":{"type":"array","items":{"type":"string"}},"events_supported":{"type":"array","items":{"type":"string"}},"credential_issuer":{"type":"string"},"credential_owner":{"type":"string"},"organization_scoped":{"type":"boolean"},"organization_strategy":{"type":"object","additionalProperties":true,"properties":{"personal":{"type":"string"},"team_domains":{"type":"array","items":{"type":"string"}}}},"credential_storage":{"type":"object","required":["order","consent","prompt","env_var","macos_keychain"],"additionalProperties":true,"properties":{"order":{"type":"array","items":{"type":"string"}},"consent":{"type":"string"},"prompt":{"type":"string"},"env_var":{"type":"string"},"macos_keychain":{"type":"object","required":["service","account","store_command","find_by_email_command","find_service_command","delete_command"],"additionalProperties":false,"properties":{"service":{"type":"string"},"account":{"type":"string"},"store_command":{"type":"string"},"find_by_email_command":{"type":"string"},"find_service_command":{"type":"string"},"delete_command":{"type":"string"}}}}},"workos_authkit_issuer":{"type":"string"}}},"CaptionerScope":{"type":"string","enum":["captioner:audio:upload","captioner:caption:run","captioner:terminology:read"]},"AgentAuthRequest":{"type":"object","required":["type","assertion_type","assertion","requested_credential_type"],"additionalProperties":true,"properties":{"type":{"type":"string","const":"identity_assertion"},"assertion_type":{"type":"string","const":"verified_email"},"assertion":{"type":"string","format":"email"},"requested_credential_type":{"type":"string","const":"api_key"},"requested_scopes":{"type":"array","items":{"$ref":"#/components/schemas/CaptionerScope"}}}},"AgentAuthStarted":{"type":"object","required":["registration_id","registration_type","status","flow","credential_type","claim_token","claim_token_expires","claim_token_expires_at","claim_complete_url","delivery","requested_scopes","post_claim_scopes"],"additionalProperties":false,"properties":{"registration_id":{"type":"string"},"registration_type":{"type":"string","const":"email-verification"},"status":{"type":"string","const":"claim_required"},"flow":{"type":"string","const":"user-claimed-email-required"},"credential_type":{"type":"string","const":"api_key"},"claim_token":{"type":"string"},"claim_token_expires":{"type":"string","format":"date-time"},"claim_token_expires_at":{"type":"string","format":"date-time"},"claim_url":{"type":"string"},"claim_complete_url":{"type":"string"},"delivery":{"type":"object","required":["method","email"],"additionalProperties":false,"properties":{"method":{"type":"string","const":"workos_magic_auth_email"},"email":{"type":"string"}}},"requested_scopes":{"type":"array","items":{"$ref":"#/components/schemas/CaptionerScope"}},"post_claim_scopes":{"type":"array","items":{"$ref":"#/components/schemas/CaptionerScope"}}}},"AgentAuthCompleteRequest":{"type":"object","required":["claim_token"],"additionalProperties":true,"properties":{"claim_token":{"type":"string"},"otp":{"type":"string"},"code":{"type":"string"}}},"AgentAuthCompleted":{"type":"object","required":["registration_id","registration_type","status","credential_type","credential","credential_expires","api_key","token_type","scopes","organization_id","workspace","api_key_metadata"],"additionalProperties":false,"properties":{"registration_id":{"type":"string"},"registration_type":{"type":"string","const":"email-verification"},"status":{"type":"string","const":"claimed"},"credential_type":{"type":"string","const":"api_key"},"credential":{"type":"string"},"credential_expires":{"type":"null"},"api_key":{"type":"string"},"token_type":{"type":"string","const":"Bearer"},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/CaptionerScope"}},"organization_id":{"type":"string"},"workspace":{"type":"object","required":["kind","external_id"],"additionalProperties":false,"properties":{"kind":{"type":"string","enum":["personal","team"]},"external_id":{"type":"string"}}},"api_key_metadata":{"type":"object","required":["id","owner"],"additionalProperties":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"owner":{"type":"object","additionalProperties":true},"obfuscated_value":{"type":"string"}}}}},"Mp3RequiredError":{"type":"object","required":["error"],"additionalProperties":false,"properties":{"error":{"type":"object","required":["code","message","required","recommendation"],"additionalProperties":false,"properties":{"code":{"type":"string","const":"mp3_required"},"message":{"type":"string"},"required":{"type":"object","required":["extension","mediaType"],"additionalProperties":false,"properties":{"extension":{"type":"string","const":"mp3"},"mediaType":{"type":"string","const":"audio/mpeg"}}},"recommendation":{"$ref":"#/components/schemas/VideoExtractionRecommendation"}}}}},"Mp3TooLargeError":{"type":"object","required":["error"],"additionalProperties":false,"properties":{"error":{"type":"object","required":["code","message","maxBytes","maxSize","recommendation"],"additionalProperties":false,"properties":{"code":{"type":"string","const":"upload_too_large"},"message":{"type":"string"},"maxBytes":{"type":"integer","const":104857600},"maxSize":{"type":"string","const":"100 MiB"},"recommendation":{"$ref":"#/components/schemas/VideoExtractionRecommendation"}}}}},"VideoExtractionRecommendation":{"type":"object","required":["policy","message","recommendedAudio","command","fallbackCommand","notes"],"additionalProperties":false,"properties":{"policy":{"type":"string","const":"mp3-only"},"message":{"type":"string"},"recommendedAudio":{"type":"object","required":["container","codec","channels","sampleRateHz","bitrate","rationale"],"additionalProperties":false,"properties":{"container":{"type":"string","const":"mp3"},"codec":{"type":"string","const":"mp3"},"channels":{"type":"integer","const":1},"sampleRateHz":{"type":"integer","const":16000},"bitrate":{"type":"string","const":"32k"},"rationale":{"type":"string"}}},"command":{"type":"string","const":"ffmpeg -i input.mp4 -map 0:a:0 -vn -ac 1 -ar 16000 -c:a libmp3lame -b:a 32k output.mp3"},"fallbackCommand":{"type":"string","const":"ffmpeg -i input.mp4 -map 0:a:0 -vn -ac 1 -ar 16000 -c:a libmp3lame -b:a 48k output.mp3"},"notes":{"type":"array","items":{"type":"string"}}}},"AudioObjectReceipt":{"type":"object","required":["ok","key"],"additionalProperties":false,"properties":{"ok":{"type":"boolean"},"key":{"type":"string"},"size":{"type":"integer","minimum":0},"mediaType":{"type":"string"}}},"CaptionerPayload":{"type":"object","required":["audio"],"additionalProperties":false,"properties":{"audio":{"type":"object","required":["key"],"additionalProperties":false,"properties":{"key":{"type":"string","pattern":"\\.mp3$","description":"MP3 object key in the captioner-audio bucket. Must end in .mp3."},"filename":{"type":"string"},"mediaType":{"type":"string","const":"audio/mpeg"}}},"topic":{"type":"string"},"glossary":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"language":{"type":"string","default":"en"},"transcription":{"type":"object","additionalProperties":false,"properties":{"provider":{"type":"string","enum":["cloudflare","deepgram","xai"],"default":"cloudflare"},"model":{"type":"string","default":"@cf/openai/whisper-large-v3-turbo","description":"Provider-specific transcription model override. The default provider is Cloudflare using CAPTIONER_TRANSCRIPTION_MODEL or the Cloudflare Whisper default; Deepgram defaults to nova-3 and xAI defaults to grok-stt when selected."},"keyterms":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"includeRawResponse":{"type":"boolean","default":false},"chunkBytes":{"type":"integer","minimum":262144,"maximum":5242880,"default":1048576}}},"terminology":{"type":"object","additionalProperties":false,"properties":{"packs":{"description":"Term pack IDs to force into the run. If omitted, matching packs are selected from topic, filename, glossary, and keyterms.","oneOf":[{"$ref":"#/components/schemas/TermPackId"},{"type":"array","items":{"$ref":"#/components/schemas/TermPackId"}}]},"include":{"description":"Additional terms to inject into ASR keyterms and audit context.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"exclude":{"description":"Terms to remove from compiled ASR keyterms and audit context.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"maxKeyterms":{"type":"integer","minimum":1,"maximum":100,"default":100,"description":"Maximum ASR keyterms to inject after ranking explicit terms and selected packs."}}},"storage":{"type":"object","additionalProperties":false,"properties":{"retainSourceAudio":{"type":"boolean","default":false,"description":"Set true to keep the source R2 audio object for reruns or debugging. By default, source audio is deleted as soon as transcription has consumed it, and deletion is retried if the workflow fails."}}},"audit":{"type":"object","additionalProperties":false,"properties":{"mode":{"type":"string","enum":["publishable","fast","experimental"],"default":"publishable","description":"Audit preset. publishable uses Anthropic Sonnet for semantic correctness, fast uses Anthropic Haiku for preview cleanup, and experimental uses OpenAI for fast semantic comparison. Explicit provider or model fields override the preset."},"provider":{"type":"string","enum":["cloudflare","anthropic","openai","none"],"default":"anthropic"},"enabled":{"type":"boolean","default":true},"model":{"type":"string","default":"@cf/zai-org/glm-4.7-flash","description":"Provider-specific audit model override. Defaults are Cloudflare @cf/zai-org/glm-4.7-flash, Anthropic claude-sonnet-4-6, and OpenAI gpt-5.4-mini. Use claude-haiku-4-5-20251001 to compare Anthropic Haiku against the default Sonnet audit."},"minConfidence":{"type":"number","minimum":0,"maximum":1,"default":0.85}}},"captions":{"type":"object","additionalProperties":false,"properties":{"maxLineChars":{"type":"integer","minimum":24,"maximum":60,"default":42},"maxLines":{"type":"integer","minimum":1,"maximum":3,"default":2},"maxDuration":{"type":"number","minimum":2,"maximum":10,"default":6},"minDuration":{"type":"number","minimum":0.2,"maximum":2,"default":0.8}}}}},"TermPackSummary":{"type":"object","required":["id","title","triggers","relatedPackIds","termCount"],"additionalProperties":false,"properties":{"id":{"$ref":"#/components/schemas/TermPackId"},"title":{"type":"string"},"description":{"type":"string"},"triggers":{"type":"array","items":{"type":"string"}},"relatedPackIds":{"type":"array","items":{"$ref":"#/components/schemas/TermPackId"}},"termCount":{"type":"integer","minimum":0}}},"TermPackList":{"type":"object","required":["packs","includeWith","example"],"additionalProperties":false,"properties":{"packs":{"type":"array","items":{"$ref":"#/components/schemas/TermPackSummary"}},"includeWith":{"type":"string","const":"payload.terminology.packs"},"example":{"type":"object","required":["terminology"],"additionalProperties":false,"properties":{"terminology":{"type":"object","required":["packs"],"additionalProperties":false,"properties":{"packs":{"type":"array","items":{"$ref":"#/components/schemas/TermPackId"}}}}}}}},"TermPackId":{"type":"string","enum":["events/mcp-night","protocols/mcp","domains/ai-agents","domains/b2b-saas","vendors/cloudflare","vendors/workos","identity-auth"]},"CompiledTerminology":{"type":"object","required":["requestedPacks","selectedPacks","injectedKeyterms","auditTerms","omittedKeyterms","explicitTerms","availablePacks"],"additionalProperties":false,"properties":{"requestedPacks":{"type":"array","items":{"$ref":"#/components/schemas/TermPackId"}},"selectedPacks":{"type":"array","items":{"$ref":"#/components/schemas/TermPackId"}},"injectedKeyterms":{"type":"array","items":{"type":"string"}},"auditTerms":{"type":"array","items":{"type":"string"}},"omittedKeyterms":{"type":"array","items":{"type":"string"}},"explicitTerms":{"type":"array","items":{"type":"string"}},"availablePacks":{"type":"array","items":{"$ref":"#/components/schemas/TermPackSummary"}}}},"TermObservation":{"type":"object","required":["surface","category","source","action"],"additionalProperties":false,"properties":{"surface":{"type":"string"},"suggested":{"type":"string"},"canonical":{"type":"string"},"category":{"type":"string","enum":["company_name","product_name","project_name","person_name","technical_term","acronym","capitalization","spacing_punctuation","other"]},"source":{"type":"string","enum":["audit_accepted","audit_needs_review","audit_rejected"]},"confidence":{"type":"number","minimum":0,"maximum":1},"action":{"type":"string","enum":["add_mishear","review","ignore"]},"correctionId":{"type":"string"},"packHints":{"type":"array","items":{"type":"string"}},"reason":{"type":"string"}}},"SourceAudioRetention":{"type":"object","required":["key","policy","status","cleanupPhase"],"additionalProperties":false,"properties":{"key":{"type":"string"},"policy":{"type":"string","enum":["delete_after_use","retain"]},"status":{"type":"string","enum":["deleted","retained","skipped","failed"]},"cleanupPhase":{"type":"string","enum":["after_transcription","success","failure","moderation_blocked"]},"reason":{"type":"string"},"error":{"type":"string"}}},"ContentModerationSummary":{"type":"object","required":["source","model","decision","severity","reason","chunksChecked"],"additionalProperties":false,"properties":{"source":{"type":"string","const":"audio_transcript"},"model":{"type":"string"},"decision":{"type":"string","enum":["allow","block"]},"severity":{"type":"string","enum":["none","medium","high"]},"reason":{"type":"string","enum":["safe","empty_transcript","content_policy_violation"]},"chunksChecked":{"type":"integer","minimum":0},"flaggedChunk":{"type":"object","required":["index"],"additionalProperties":false,"properties":{"index":{"type":"integer","minimum":0},"start":{"type":"number","minimum":0},"end":{"type":"number","minimum":0}}},"eventLog":{"$ref":"#/components/schemas/ContentModerationLogResult"}}},"ContentModerationLogResult":{"type":"object","required":["status"],"additionalProperties":false,"properties":{"status":{"type":"string","enum":["stored","skipped","failed"]},"id":{"type":"string"},"reason":{"type":"string"},"error":{"type":"string"}}},"WorkflowAccepted":{"type":"object","required":["status","runId"],"properties":{"status":{"type":"string","enum":["accepted"]},"runId":{"type":"string"}}},"WorkflowResultEnvelope":{"type":"object","required":["result","_meta"],"additionalProperties":false,"properties":{"result":{"oneOf":[{"$ref":"#/components/schemas/CaptionerResult"},{"$ref":"#/components/schemas/CaptionerBlockedResult"},{"$ref":"#/components/schemas/CaptionerFailedResult"}]},"_meta":{"type":"object","required":["runId"],"additionalProperties":true,"properties":{"runId":{"type":"string"}}}}},"CaptionerResult":{"type":"object","required":["openapi","version","id","status","input","metadata","transcript","audit","captions","quality"],"properties":{"openapi":{"type":"string","const":"3.2.0"},"version":{"type":"string","const":"1.0"},"id":{"type":"string"},"status":{"type":"string","const":"completed"},"input":{"type":"object"},"metadata":{"type":"object","properties":{"storage":{"type":"object","required":["sourceAudio"],"additionalProperties":false,"properties":{"sourceAudio":{"$ref":"#/components/schemas/SourceAudioRetention"}}},"moderation":{"$ref":"#/components/schemas/ContentModerationSummary"},"terminology":{"type":"object","required":["packs","observations"],"properties":{"packs":{"$ref":"#/components/schemas/CompiledTerminology"},"observations":{"type":"array","items":{"$ref":"#/components/schemas/TermObservation"}}}}}},"transcript":{"type":"object","required":["text","metadata","words","utterances","paragraphs"],"properties":{"text":{"type":"string","description":"Corrected plain transcript text for direct reading, search, and notes."},"metadata":{"type":"object"},"words":{"type":"array","items":{"type":"object"}},"utterances":{"type":"array","items":{"type":"object"}},"paragraphs":{"type":"array","items":{"type":"object"}}}},"audit":{"type":"object"},"captions":{"type":"object","description":"Final caption output. Cue text is normalized from punctuated/capitalized transcript tokens and may differ from raw transcript word fields.","required":["format","srt","cues","settings"],"properties":{"format":{"type":"string","const":"srt"},"srt":{"type":"string"},"cues":{"type":"array","items":{"$ref":"#/components/schemas/CaptionCue"}},"settings":{"type":"object"}}},"quality":{"type":"object","required":["captions"],"properties":{"captions":{"$ref":"#/components/schemas/CaptionQuality"}}},"raw":{"type":"object"}}},"CaptionerBlockedResult":{"type":"object","required":["openapi","version","id","status","input","metadata"],"additionalProperties":false,"properties":{"openapi":{"type":"string","const":"3.2.0"},"version":{"type":"string","const":"1.0"},"id":{"type":"string"},"status":{"type":"string","const":"blocked"},"input":{"type":"object"},"metadata":{"type":"object","required":["generatedAt","duration","counts","models","timingsMs","storage","moderation"],"additionalProperties":false,"properties":{"generatedAt":{"type":"string","format":"date-time"},"duration":{"type":"number","minimum":0},"counts":{"type":"object","required":["words","utterances","paragraphs"],"additionalProperties":false,"properties":{"words":{"type":"integer","minimum":0},"utterances":{"type":"integer","minimum":0},"paragraphs":{"type":"integer","minimum":0}}},"models":{"type":"object","required":["transcription","moderation"],"additionalProperties":false,"properties":{"transcription":{"type":"object","additionalProperties":true},"moderation":{"type":"object","required":["provider","name"],"additionalProperties":false,"properties":{"provider":{"type":"string","const":"cloudflare"},"name":{"type":"string"}}}}},"timingsMs":{"type":"object","required":["transcription","moderation","total"],"additionalProperties":false,"properties":{"transcription":{"type":"number","minimum":0},"moderation":{"type":"number","minimum":0},"total":{"type":"number","minimum":0}}},"storage":{"type":"object","required":["sourceAudio"],"additionalProperties":false,"properties":{"sourceAudio":{"$ref":"#/components/schemas/SourceAudioRetention"}}},"moderation":{"$ref":"#/components/schemas/ContentModerationSummary"}}}}},"CaptionerFailedResult":{"type":"object","required":["openapi","version","id","status","input","error","metadata"],"additionalProperties":false,"properties":{"openapi":{"type":"string","const":"3.2.0"},"version":{"type":"string","const":"1.0"},"id":{"type":"string"},"status":{"type":"string","const":"failed"},"input":{"type":"object","required":["topic","glossary","language"],"additionalProperties":true,"properties":{"source":{"type":"object","additionalProperties":true},"topic":{"type":"string"},"glossary":{"type":"array","items":{"type":"string"}},"language":{"type":"string"}}},"error":{"$ref":"#/components/schemas/CaptionerWorkflowError"},"metadata":{"type":"object","required":["generatedAt","timingsMs"],"additionalProperties":true,"properties":{"generatedAt":{"type":"string","format":"date-time"},"duration":{"type":"number","minimum":0},"lastSuccessfulStage":{"$ref":"#/components/schemas/CaptionerStage"},"counts":{"type":"object","additionalProperties":true},"models":{"type":"object","additionalProperties":true},"timingsMs":{"type":"object","additionalProperties":{"type":"number","minimum":0}},"storage":{"type":"object","additionalProperties":false,"properties":{"sourceAudio":{"$ref":"#/components/schemas/SourceAudioRetention"}}},"moderation":{"$ref":"#/components/schemas/ContentModerationSummary"},"terminology":{"type":"object","additionalProperties":true,"properties":{"packs":{"$ref":"#/components/schemas/CompiledTerminology"},"observations":{"type":"array","items":{"$ref":"#/components/schemas/TermObservation"}}}}}},"raw":{"type":"object"}}},"CaptionerWorkflowError":{"type":"object","required":["code","stage","message","retryable","suggestions"],"additionalProperties":false,"properties":{"code":{"type":"string"},"stage":{"$ref":"#/components/schemas/CaptionerStage"},"message":{"type":"string"},"retryable":{"type":"boolean"},"runId":{"type":"string"},"provider":{"type":"string"},"model":{"type":"string"},"suggestions":{"type":"array","items":{"$ref":"#/components/schemas/CaptionerErrorSuggestion"}},"debug":{"type":"object","description":"Compact diagnostic metadata for agents and maintainers. Does not include raw provider payloads unless requested through transcription.includeRawResponse.","additionalProperties":true}}},"CaptionerErrorSuggestion":{"type":"object","required":["label"],"additionalProperties":false,"properties":{"label":{"type":"string"},"description":{"type":"string"},"payloadPatch":{"type":"object","additionalProperties":true}}},"CaptionerStage":{"type":"string","enum":["payload","transcription","moderation","terminology_audit","correction","captioning","storage","workflow"]},"CaptionCue":{"type":"object","required":["index","start","end","startTime","endTime","text","lines"],"additionalProperties":false,"properties":{"index":{"type":"integer","minimum":1},"start":{"type":"number","minimum":0},"end":{"type":"number","minimum":0},"startTime":{"type":"string","pattern":"^\\d\\d:\\d\\d:\\d\\d,\\d\\d\\d$"},"endTime":{"type":"string","pattern":"^\\d\\d:\\d\\d:\\d\\d,\\d\\d\\d$"},"text":{"type":"string"},"lines":{"type":"array","items":{"type":"string"}}}},"CaptionQuality":{"type":"object","required":["score","summary","warnings","cues"],"properties":{"score":{"type":"number","minimum":0,"maximum":1},"summary":{"type":"object","required":["cueCount","warningCount","maxCharsPerSecond","maxWordsPerSecond","maxLineLength"],"properties":{"cueCount":{"type":"integer","minimum":0},"warningCount":{"type":"integer","minimum":0},"maxCharsPerSecond":{"type":"number","minimum":0},"maxWordsPerSecond":{"type":"number","minimum":0},"maxLineLength":{"type":"integer","minimum":0}}},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/CaptionQualityWarning"}},"cues":{"type":"array","items":{"$ref":"#/components/schemas/CaptionCueQuality"}}}},"CaptionQualityWarning":{"type":"object","required":["cue","flag","severity","message"],"properties":{"cue":{"type":"integer","minimum":1},"flag":{"$ref":"#/components/schemas/CaptionQualityFlag"},"severity":{"type":"string","enum":["info","warning"]},"message":{"type":"string"}}},"CaptionCueQuality":{"type":"object","required":["cue","duration","chars","words","charsPerSecond","wordsPerSecond","lineCount","lineLengths","flags"],"properties":{"cue":{"type":"integer","minimum":1},"duration":{"type":"number","minimum":0},"chars":{"type":"integer","minimum":0},"words":{"type":"integer","minimum":0},"charsPerSecond":{"type":"number","minimum":0},"wordsPerSecond":{"type":"number","minimum":0},"lineCount":{"type":"integer","minimum":0},"lineLengths":{"type":"array","items":{"type":"integer","minimum":0}},"flags":{"type":"array","items":{"$ref":"#/components/schemas/CaptionQualityFlag"}}}},"CaptionQualityFlag":{"type":"string","enum":["duration_below_minimum","duration_above_maximum","line_count_above_maximum","line_length_above_maximum","reading_speed_high","dangling_line_break"]}}}}