{"openapi":"3.2.0","info":{"title":"TubeRelay API","description":"Stream YouTube videos effortlessly — secure temporary URLs, no file size limits, and seamless server-side processing.","version":"1.0.0"},"servers":[{"url":"https://jojapi.jojapi.net"}],"security":[{"ApiKeyAuth":[]}],"x-agent-commerce":{"catalog_url":"https://jojapi.jojapi.net/_jojapi/agent/plans","discovery_url":"https://jojapi.jojapi.net/.well-known/x402","directory_url":"https://agents.jojapi.net/apis/tuberelay","docs":"https://docs.jojapi.com/consumers/agents"},"paths":{"/info":{"get":{"operationId":"get_info","summary":"/info","description":"Fetch detailed metadata for a YouTube video including title, duration, thumbnail, channel, views, and description.","responses":{"200":{"description":"OK — video metadata returned","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"YouTube video ID"},"title":{"type":"string","description":"Video title"},"duration":{"type":"integer","description":"Duration in seconds"},"duration_string":{"type":"string","description":"Formatted duration (e.g. 3:33)"},"thumbnail":{"type":"string","description":"Video thumbnail URL"},"channel":{"type":"string","description":"Channel name"},"channel_id":{"type":"string","description":"Channel ID"},"views":{"type":"integer","description":"View count"},"views_text":{"type":"string","description":"Formatted view count (e.g. 1.8B views)"},"is_live":{"type":"boolean","description":"Whether the video is a live stream"},"description":{"type":"string","description":"Video description"},"keywords":{"type":"array","items":{"type":"string"},"description":"Video keywords/tags"}}},"examples":{"Example_1":{"value":{"id":"","title":"","duration":0,"duration_string":"","thumbnail":"","channel":"","channel_id":"","views":0,"views_text":"","is_live":true,"description":"","keywords":[]}}}}}},"400":{"description":"Bad request — missing or invalid video_id","content":{"application/json":{"examples":{"Example_1":{"value":{}}}}}},"404":{"description":"Video not found","content":{"application/json":{"examples":{"Example_1":{"value":{}}}}}}},"parameters":[{"name":"video_id","in":"query","description":"YouTube video ID (11-12 characters)","required":true,"schema":{"type":"string"}}]}},"/search":{"get":{"operationId":"get_search","summary":"/search","description":"Search YouTube for videos or resolve a YouTube URL to video metadata. Returns a list of matching videos.","responses":{"200":{"description":"OK — search results returned","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"YouTube video ID"},"title":{"type":"string","description":"Video title"},"url":{"type":"string","description":"YouTube video URL"},"duration":{"type":"integer","description":"Duration in seconds"},"duration_string":{"type":"string","description":"Formatted duration"},"thumbnail":{"type":"string","description":"Video thumbnail URL"},"channel":{"type":"string","description":"Channel name"},"views":{"type":"integer","description":"View count"},"views_text":{"type":"string","description":"Formatted view count"},"is_live":{"type":"boolean","description":"Whether the video is a live stream"},"published":{"type":"string","description":"How long ago the video was published"}}}},"examples":{"Example_1":{"value":[{"id":"","title":"","url":"","duration":0,"duration_string":"","thumbnail":"","channel":"","views":0,"views_text":"","is_live":true,"published":""}]}}}}},"400":{"description":"Bad request — missing query","content":{"application/json":{"examples":{"Example_1":{"value":{}}}}}}},"parameters":[{"name":"query","in":"query","description":"Search text or a YouTube URL","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Maximum results to return (1-50)","required":false,"schema":{"type":"number","example":10,"default":10}}]}},"/stream-url":{"get":{"operationId":"get_stream_url","summary":"/stream-url","description":"Returns a time-limited streaming URL (valid for 5 minutes). The returned URL streams the video directly without exposing your API key.","responses":{"200":{"description":"OK — temporary streaming URL generated","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"Temporary streaming URL (valid for 5 minutes)"},"expires_in":{"type":"integer","description":"Token TTL in seconds"}}},"examples":{"Example_1":{"value":{"url":"","expires_in":300}}}}}},"400":{"description":"Bad request — missing or invalid parameters","content":{"application/json":{"examples":{"Example_1":{"value":{}}}}}},"404":{"description":"Video not found or streaming token expired","content":{"application/json":{"examples":{"Example_1":{"value":{}}}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"examples":{"Example_1":{"value":{}}}}}}},"parameters":[{"name":"quality","in":"query","description":"Quality: best, worst, 128k (audio only), 720p (video)","required":false,"schema":{"type":"string","example":"best","default":"best"}},{"name":"type","in":"query","description":"Stream type: audio or video","required":false,"schema":{"type":"string","enum":["audio","video"],"default":"audio"}},{"name":"video_id","in":"query","description":"YouTube video ID (11-12 characters)","required":true,"schema":{"type":"string"}}]}}},"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-JoJAPI-Key","description":"Your JoJ API key."}}}}