Documentation Index
Fetch the complete documentation index at: https://mintlify.com/mohameodo/nano/llms.txt
Use this file to discover all available pages before exploring further.
/api/proxy is the core of nano’s streaming infrastructure. It fetches remote URLs from the server, rewrites HLS playlist segment paths so they also pass through the proxy, and strips restrictive response headers (such as Content-Security-Policy and X-Frame-Options) that would otherwise prevent the browser from playing the stream. Every URL returned by /api/scrape is already wrapped in a proxy URL — you do not need to proxy them again yourself.
Two Request Modes
The proxy supports two calling conventions depending on the use case.Data Mode (base64-encoded)
This is the mode nano uses internally for all stream and segment requests. Thedata parameter is a base64-encoded JSON payload containing the target URL and any custom headers required to fetch it (e.g. Referer, Origin).
Base64-encoded JSON object with the following shape:
Hint that this request is for an HLS media segment (
.ts, .m4s, .aac) rather than a playlist. When true, the response is cached with Cache-Control: public, max-age=600, immutable. The proxy also infers this automatically from the target URL’s extension.Simple Mode
For straightforward proxy needs such as subtitle fetching, you can pass the target URL directly as a query parameter.The full target URL to fetch.
Value to send as the
Referer request header to the target server.Value to send as the
Origin request header to the target server.Custom
User-Agent string. Defaults to a standard Chrome user-agent string.M3U8 Playlist Rewriting
When the proxy detects that the fetched content is an HLS playlist (by URL extension,Content-Type, or body inspection for #EXTM3U), it rewrites every segment and nested playlist URL in the file so that they also route through /api/proxy. This ensures the entire multi-level HLS stream plays without CORS issues — the browser only ever talks to your nano origin.
Relative segment URLs are resolved against the playlist’s base path before being encoded. For example, a line like:
#EXT-X-KEY and other tags are similarly rewritten.
SRT to WebVTT Conversion
When the target URL ends in.srt, the proxy automatically converts the subtitle content to WebVTT format before returning it. The Content-Type is set to text/vtt. This allows browsers to consume SRT subtitles natively without a client-side conversion step.
Response Headers
The proxy sets the following headers on all responses:| Header | Value |
|---|---|
Access-Control-Allow-Origin | * |
Access-Control-Allow-Methods | GET, POST, HEAD, OPTIONS |
Access-Control-Allow-Headers | * |
Access-Control-Expose-Headers | Content-Length, Content-Range, Content-Type, X-Proxy-Set-Cookie |
Cache-Control (playlist) | public, max-age=3 |
Cache-Control (segment) | public, max-age=600, immutable |
Content-Security-PolicyX-Frame-OptionsContent-EncodingTransfer-Encoding
HEAD and OPTIONS
HEAD requests are handled identically to GET (the same handler is reused). OPTIONS requests return a 204 No Content CORS preflight response with a 24-hour Access-Control-Max-Age.