Response Envelope
Vorte wraps every API response in a consistent JSON envelope. This makes it easy for clients to parse responses uniformly and handle errors predictably.
Standard Envelope
Every response follows this structure:
For error responses:
Response Helpers
Vorte provides helper functions that construct properly formatted envelopes for common response patterns.
success_response
Output:
error_response
paginated_response
Output:
ai_response
Output:
Streaming Responses
Vorte provides two streaming response types for real-time data delivery, commonly used with AI completions and live feeds.
VorteSSEResponse
Server-Sent Events for unidirectional streaming from server to client. Ideal for AI token streaming.
VorteStreamResponse
A generic streaming response for chunked transfer encoding. Useful for large file downloads or binary streams.
Custom Envelopes
Override the default envelope format for specific routes or the entire application.