Stream quotes (SSE)
Endpoint Details
Streaming Quotes
Stream quote results in real-time as each protocol responds via Server-Sent Events
GET
Stream quotes (SSE)
Overview
The streaming-quotes endpoint emits Server-Sent Events as each protocol returns a quote, instead of waiting for all protocols to complete. Use this for snappy UI — display the first quote in ~200ms instead of waiting 5+ seconds for the slowest aggregator. For a hands-on walkthrough see the Streaming Quotes guide.Endpoint
Request
Authentication
EventSource cannot set custom headers reliably, so authentication accepts both styles:Query Parameters
Response
Headers
Event Sequence
Events are sent asdata: <json>\n\n chunks (legacy SSE format — no named event: fields).
If no protocols return a usable quote, an
error event is sent in place of final.
Event Payloads
- init
- quote
- final
- error
- finished
Quote Object Fields (in final event)
Timeouts
- Total budget: 8 seconds. Protocols that haven’t responded by then are dropped.
- Per-protocol circuit breaker: 5 seconds. Protocols that fail repeatedly are skipped.
Examples
Browser (EventSource)
Server (fetch)
Errors
The
UNABLE_TO_RETRIEVE_QUOTES error is delivered inside the SSE stream as a type: "error" event, not as an HTTP error.
See the error codes catalog for the full list.Authorizations
Demo API-Key (Sandbox): 7037d2b3-9c76-4f62-b730-c544f7570fa4
Query Parameters
Input asset identifier.
Output asset identifier.
From wallet address.
To wallet address.
Amount to swap.
Alternative to Api-Key header (useful for EventSource which cannot set headers).
Response
Server-Sent Events stream. Events are sent as data: {json}\n\n format.
SSE stream with events: init, quote (per protocol), final (sorted), finished.