Send message to AI assistant
Send a message to the AI trading assistant and receive a streaming response via Server-Sent Events (SSE).
Authentication: Requires a JWT from /v1/auth/verify as a Bearer token.
Rate limiting: 20 requests per minute per wallet (configurable via AI_RATE_LIMIT_RPM).
Response format: The response is an SSE stream (text/event-stream).
Each event has an event type and JSON data field. The stream ends with
a done event containing the conversation ID and token usage.
Conversation continuity: Omit conversation_id to start a new conversation.
Include it to continue an existing conversation with message history.
Trade boundary: A strategy event is a proposal, not an order.
The model has no order-placement tool. In the Joyride app, the user taps
Buy or Sell and the client keeps that intent while it completes wallet
authentication, any required USDC deposit, and final order submission.
Account data failures are not represented as a zero or fallback balance.
SSE event types:
text— AI-generated text chunk (streamed incrementally)tool_start— Tool execution started (for UX loading indicators)tool_result— Tool execution completed with summarystrategy— Trade recommendation card with a client-owned Buy or Sell actiontable— Tabular data displayoptions_chain— Options chain dataprice_quote— Single instrument price quoteaccount_summary— Account balance overvieworder_status— Order placement/cancellation resulterror— Error during processing (non-fatal, stream may continue)done— Stream complete with conversation ID and usage stats
Data conventions in SSE events: Unlike the main REST API which uses internal units (micros, millicontracts), AI Chat SSE events use human-readable units:
- Prices in USD (e.g.,
1.50not1500000) - Sizes in contracts (e.g.,
2.0not2000) - Balances in USD (e.g.,
10000.0not10000000000)
Authorizations
JWT obtained from POST /v1/auth/verify after SIWS authentication.
Include as: Authorization: Bearer <jwt>
Body
Response
SSE stream of AI response events
Server-Sent Events stream. Each event has format: