gateway ======= routes prompts, media transcription, and media downloads through upstream provider apis ROUTES: Method | Path | Description ------ | --------------------- | ----------------------- POST | /api/message | generate text POST | /api/transcribe | transcribe media POST | /api/download | download media GET | /api/download/history | download history GET | /api | service metadata GET | /api/health | combined service health GET | / | usage reference POST /api/message ================= curl -X POST http://localhost:9990/api/message \ -H "Content-Type: application/json" \ -d '{ "id": 1, "query": "Summarize the current release notes.", "provider": "openai", "conversationId": "release-notes", "model": "gpt-5.5", "system": "Be concise.", "effort": "low" }' /api/message only accepts application/json send audio and video uploads or media URLs to /api/transcribe provider values are openai, gemini, fireworks, openrouter, or cerebras effort values are none, minimal, low, medium, high, or xhigh conversationId defaults to String(id) and is scoped by provider model defaults to the selected provider's configured model system defaults to the selected provider's configured system prompt, if set system is stored only when the conversation is first created when Exa is configured the selected model receives an exa_search tool REQUEST FIELDS: Field | Type | Default -------------- | ------ | ------------------ id | number | - query | string | - provider | string | "openai" conversationId | string | "String(id)" model | string | "provider default" system | string | "provider prompt" effort | string | null EXAMPLE RESPONSE: Returns the generated provider response as text/plain. ERROR RESPONSE: Error: Invalid request body. POST /api/transcribe ==================== curl -X POST http://localhost:9990/api/transcribe \ -F "file=@./meeting.m4a" \ -F "provider=cohere" \ -F "model=cohere-transcribe-03-2026" \ -F "language=en" \ -F "temperature=0" curl -X POST http://localhost:9990/api/transcribe \ -F "file=@./meeting.m4a" \ -F "provider=openrouter" \ -F "model=nvidia/parakeet-tdt-0.6b-v3" \ -F "language=en" curl -X POST http://localhost:9990/api/transcribe \ -H "Content-Type: application/json" \ -d '{ "url": "https://www.tiktok.com/@user/video/1234567890", "provider": "cohere", "language": "en", "proxy": false, "audioQuality": "best" }' curl -X POST http://localhost:9990/api/transcribe \ -F "url=https://www.youtube.com/watch?v=dQw4w9WgXcQ" \ -F "provider=cohere" \ -F "language=en" \ -F "proxy=false" accepts multipart/form-data with a file or url field, or application/json with a url field provide either file or url, not both url requests download audio with yt-dlp using the same proxy rules as /api/download provider values are cohere or openrouter cohere model defaults to "cohere-transcribe-03-2026" openrouter model defaults to "nvidia/parakeet-tdt-0.6b-v3" language values are ar, de, el, en, es, fr, it, ja, ko, nl, pl, pt, vi, or zh supported cohere passthrough audio extensions are flac, mp3, mpeg, mpga, ogg, and wav video uploads and unsupported audio formats are transcoded to mono mp3 before transcription media that cannot fit the 25 MB practical limit after compression returns 413 REQUEST FIELDS: Field | Type | Default ------------ | ------- | ---------------- file | File | - url | string | - provider | string | "cohere" model | string | provider default language | string | "en" temperature | number | null proxy | boolean | false audioQuality | string | "best" EXAMPLE RESPONSE: Returns the completed transcript as text/plain. ERROR RESPONSE: Error: Missing media input. Upload an audio or video file in the file field, or pass a media URL in the url field. POST /api/download ================== curl -X POST http://localhost:9990/api/download \ -H "Content-Type: application/json" \ -d '{ "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "mode": "both", "quality": "1080p", "audioQuality": "best", "iosCompatible": true, "proxy": false, "playlist": false }' \ --output download.mp4 /api/download only accepts application/json mode values are both, audio, or video quality only applies when mode is "both" and accepts best, 2160p, 1440p, 1080p, 720p, 480p, or 360p audioQuality only applies when mode is "audio" and accepts best, high, medium, low, lowest, or a raw bitrate like "128K" when playlist is true, the URL must be a playlist and the response is a .zip file proxy uses PROXY_URL when configured; FORCE_PROXY_SERVICES can force proxy use by service force-proxy service values are youtube, tiktok, instagram, twitter, reddit, facebook, dailymotion, vimeo, soundcloud, or twitch iosCompatible transcodes single video+audio MP4 downloads to H.264/AAC when needed REQUEST FIELDS: Field | Type | Default ------------- | ------- | ------- url | string | - mode | string | "both" quality | string | "best" audioQuality | string | "best" iosCompatible | boolean | true proxy | boolean | false playlist | boolean | false EXAMPLE RESPONSE: Streams an MP3, MP4, or ZIP file with Content-Disposition: attachment and Proxy-Used response headers. ERROR RESPONSE: Error: Missing 'url' in request body GET /api/download/history ========================= curl -G http://localhost:9990/api/download/history \ --data-urlencode "limit=25" \ --data-urlencode "offset=0" history requires DATABASE_URL; without it the route returns 501 limit is capped at 200 REQUEST FIELDS: Field | Type | Default ------ | ------ | ------- limit | number | 50 offset | number | 0 EXAMPLE RESPONSE: "history": [ { "id": 42, "created_at": "2026-05-22T10:30:00.000Z", "request_id": "018fabc12345", "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "service": "youtube", "quality": "best", "mode": "both", "audio_quality": "best", "audio_only": false, "video_only": false, "ios_compatible": true, "proxied": false, "proxy_forced": false, "is_playlist": false, "item_count": null, "output_filename": "download.mp4", "output_bytes": 12345678, "status": "success", "error": null } ], "limit": 25, "offset": 0 ERROR RESPONSE: Error: Download history is not available (DATABASE_URL not configured)