API Reference
syaOS uses Vercel Serverless Functions with Edge runtime for all backend APIs.
API Request Flow
graph LR
Client[Client App] --> Auth{Auth Check}
Auth -->|Valid| Router[API Router]
Auth -->|Invalid| Error[401 Error]
Router --> Edge[Edge Runtime]
Edge --> Services[External Services]
Services --> AI[AI Providers]
Services --> DB[(Redis/KV)]
Services --> Media[Media APIs]
Edge --> Response[JSON Response]
Response --> Client
Endpoint Documentation
Endpoint Group Description Chat API Main AI chat with streaming and tool calling Song API Music library CRUD, lyrics, furigana, translations Media API Text-to-speech, transcription, YouTube search Chat Rooms API Real-time chat rooms with Pusher/Redis AI Generation APIs Applet generation, IE time-travel, parse-title Utility APIs Link preview, iframe check, share applet, admin
Quick Reference
AI Endpoints
Endpoint Purpose /api/chatMain AI chat with tool calling /api/applet-aiApplet text + image generation /api/ie-generateTime-travel page generation /api/parse-titleMusic metadata extraction
Media Endpoints
Endpoint Purpose /api/song/Song library CRUD /api/song/[id]Individual song operations /api/speechText-to-speech /api/audio-transcribeSpeech-to-text /api/youtube-searchYouTube music search
Communication Endpoints
Endpoint Purpose /api/chat-roomsReal-time chat room management
Utility Endpoints
Endpoint Purpose /api/link-previewURL metadata extraction /api/iframe-checkEmbeddability checking /api/share-appletApplet sharing /api/adminAdmin operations
Endpoint Categories Overview
graph TD
API["/api/*"]
API --> AI[AI Services]
API --> Media[Media Services]
API --> Comm[Communication]
API --> Util[Utilities]
AI --> chat["/chat"]
AI --> applet["/applet-ai"]
AI --> ie["/ie-generate"]
AI --> parse["/parse-title"]
Media --> song["/song/*"]
Media --> speech["/speech"]
Media --> transcribe["/audio-transcribe"]
Media --> yt["/youtube-search"]
Comm --> rooms["/chat-rooms"]
Util --> preview["/link-preview"]
Util --> iframe["/iframe-check"]
Util --> share["/share-applet"]
Util --> admin["/admin"]
Authentication
Authorization: Bearer {token}
X-Username: {username}
Token-based with 90-day expiration.
AI Providers
Provider Models OpenAI gpt-5, gpt-5.1, gpt-5-mini, gpt-4o, gpt-4.1, gpt-4.1-mini Anthropic claude-4.5, claude-4, claude-3.7, claude-3.5 Google gemini-2.5-pro, gemini-2.5-flash, gemini-3-pro-preview
← i18n & Hooks
Chat API →