Basic route
GET /api/hello.
HTTP methods
Export any standard HTTP method:Dynamic parameters
Use brackets in the path, then read params from the URL:Request parsing
JSON body
Form data
Query parameters
Headers and cookies
Streaming responses
Return aReadableStream for real-time data:
AI chat endpoint
The most common API route pattern in Veryfront connects a chat UI to an agent:{ id, role, parts: [{ type: "text", text }] }. This pairs with useChat({ api: "/api/chat" }) on the client, which handles the format automatically. See the Chat UI guide.
Next
- Agents: the agent behind the
/api/chatendpoint - Middleware: add CORS, rate limiting, and auth checks
Related
veryfront/agent: agent API referenceveryfront/middleware: middleware API reference