Overview
This endpoint provides a streaming chat mechanism that works seamlessly with the Vercel AI SDK. After creating a token for a user, you can leverage this endpoint to power real-time chat interfaces using frameworks like React and the Vercel AI SDK’s useChat hook.Endpoint
- HTTP Method: GET
-
URL:
/chat/{token}/stream
Replace {token}
with the actual chat token assigned to the user.
Features
- Real-time streaming: Stream chat messages as they are generated.
-
Vercel AI SDK Compatible: Integrates easily with tools like
ai/react
for a reactive chat interface. - Robust Error Handling: Option for keeping the last message on error.
Request
Path ParameterName | Required | Type | Description |
---|---|---|---|
token | Yes | string | The unique chat session token assigned to the user |
accept: application/json