Skip to main content
This page is the REST and WebSocket contract for the RFQ Network: how to authenticate, which scope each endpoint needs, how to create and accept RFQs, what states a resource moves through, and how to consume the replayable event stream. Read Overview first for the two roles and the consistency rules; use FIX protocol instead if you connect over FIX. Use REST for commands and snapshots and WebSocket for cursor-replayable lifecycle events. The production base URL is https://rfq.kairos.trade.

Authentication

Two credential forms are accepted. API credentials use all three headers together:
Bearer JWTs are also accepted: RS256, issuer kairos.trade, audience kairos-api, with sub, jti, sid, and ver: 1 claims and required iat and exp. A token whose lifetime exceeds 24 hours is refused. Every credential, API key or JWT, is checked for revocation on connect and, on a WebSocket, again every 30 seconds. Authentication fails closed with 503 auth_dependency_unavailable when the credential or its revocation status cannot be verified. API-credential principals carry the scopes stored on the credential, and an ipWhitelist on the credential is enforced against the client IP. A credential bound to an external signing wallet cannot use the RFQ API and gets 403 forbidden.
Gotcha: an IP-allowlist miss is a 403, not a 401. A non-allowlisted source gets 403 forbidden, which is easy to misread as a scope problem. Check the source address before you re-issue credentials.

Scopes

The scope * satisfies every check. A Kairos API token also carries the RFQ scopes its preset implies. A read-only token (read, trade:read) gets rfq:read. A trading token (trade:execute) gets rfq:read, rfq:create, rfq:quote, and rfq:accept.
Gotcha: a JWT with no scopes claim cannot quote. It is granted rfq:read, rfq:create, and rfq:accept — not rfq:quote. Market makers need a credential that carries rfq:quote explicitly.

Endpoint index

/v1/venues/capabilities needs authentication but no particular scope.

Rules that apply to every request

The requester flow

  1. Check venue capabilities. GET /v1/venues/capabilities tells you what each venue currently supports. Do this before selecting venues — see Create an RFQ for what happens when a venue cannot accept requester fanout.
  2. Create the RFQ. POST /v1/rfqs with a fresh Idempotency-Key returns 201 and an rfq_id.
  3. Watch for quotes. Connect to GET /v1/stream and consume quote.created / quote.revised / quote.withdrawn, or poll GET /v1/rfqs/{rfq_id}/quotes.
  4. Accept one. POST /v1/quotes/{quote_id}/accept returns 202 and an acceptance in pending_routing. This reserves quantity; it does not fill.
  5. Follow the acceptance to a terminal state via GET /v1/executions/{acceptance_id} or the acceptance.* events. executed also emits execution.normalized.v1.
  6. Cancel what you no longer want. POST /v1/rfqs/{rfq_id}/cancel moves the RFQ to cancelled and its live quotes to withdrawn.

The market-maker flow

  1. Confirm your credential carries rfq:quote. A scopeless JWT does not.
  2. Discover open venue RFQs with GET /v1/exchange-rfqs, or consume the maker broadcast stream, which callers holding rfq:quote receive on GET /v1/stream.
  3. Quote it. POST /v1/quotes returns 201.
  4. Revise or withdraw. PUT /v1/quotes/{quote_id} requires the new revision to be exactly current + 1; DELETE /v1/quotes/{quote_id} withdraws.
  5. Watch quote.disposition and the acceptance.* events for the outcome.
  6. Confirm Kalshi fills. On a venue that routes maker quotes, a quote is placed on the venue before POST /v1/quotes returns. A Kalshi requester’s acceptance does not execute your quote: you receive quote.venue_accepted with the traded side, price, quantity, and a confirm_by deadline (30 seconds, 3 seconds for combos). Call POST /v1/quotes/{quote_id}/confirm with {"revision": <accepted revision>} before it passes. Kairos never confirms for you. A confirmed quote is filled. This step applies only while Kalshi reports responder_rfq: true; it doesn’t on rfq.kairos.trade yet (see Provide liquidity).

Create an RFQ

Creates a requester RFQ and fans it out to the selected venues. Returns 201. Scope: rfq:create. Requires an Idempotency-Key header.

Example

Validation

A request that breaks any of these is rejected 400 invalid_request. Decimal quantities and prices are strings. A leg’s ratio is signed: positive buys outcome, negative sells it.

Baskets and combos

Several plain legs form a basket: the package pays the sum of ratio × each leg’s payoff, and each leg needs a market_id. A leg that carries a combo object is a combo (parlay): one venue instrument that pays only if every component outcome occurs.
combo.venue defaults to the leg’s source_venue. combo.instrument_id is the Kalshi multivariate market ticker or the Polymarket combo condition ID; Polymarket derives it from the components when you omit it. A combo is never routed to any venue other than its own. Check combos, min_combo_components, and max_combo_components in /v1/venues/capabilities.

Venue targets

Each venue you select appears in the RFQ’s targets with a state: pending (awaiting dispatch), submitted (accepted by the venue adapter), quoted, rejected (the venue declined or could not quote), or excluded (never sent, with a reason). Each change emits rfq.target_updated.

Gotchas

Idempotency binds the body. Keys are (principal, operation, key). Replaying a key with the same body returns the resource the first call created and never performs a second mutation. The same key with a different body returns 422 idempotency_key_reused. Treat a key as bound to one command.
Requester fanout is not live yet. No venue on rfq.kairos.trade reports requester_rfq: true today, so each entry in venues comes back as a targets entry with state: "excluded" and a reason, plus a mapping_warnings entry. The 201 is not evidence that anything reached a venue. Read /v1/venues/capabilities before relying on fanout.

List your RFQs

Scope: rfq:read.

Discover venue RFQs

Lists the venue-originated RFQs currently open for you to quote. Scope: rfq:quote.

Example

Response

Results are expiry ordered and include an opaque next_cursor plus observed_at, which reports the local projection’s last mutation time. Each entry in recently_closed carries its terminal state, closed_at, and a close_reason such as rfq_deleted or deadline_passed. A Polymarket combo auction lasts about 400 ms, so a poll rarely sees one open. A venue RFQ sized only in currency carries notional instead of package_quantity and remaining_quantity. One that Kairos cannot quote carries unsupported_reason, and a quote on it returns invalid_request.

Errors

Lifecycle states

RFQ

Quote

Acceptance

Gotcha: acceptance is a reservation, not a fill. It binds quote_revision, side, quantity, expected_price, and mapping_snapshot_id atomically and holds reserved_quantity on both the RFQ and the price level until the acceptance reaches a terminal state. Do not book a trade on the 202.

Errors

Errors are JSON objects whose only field is error, except where noted.

Stream recovery

Scope: rfq:read. Upgrades to a WebSocket (101). The simplest client sends no frames:
  1. Connect to /v1/stream.
  2. Persist the sequence of the last event you processed.
  3. On reconnect, pass after=<sequence> to replay missed durable events.
Events are delivered as JSON text frames with sequence, event_id, resource_id, type, occurred_at, and data. Events are pushed as soon as they commit. Expiry events (rfq.expired, quote.expired) are pushed at the deadline, typically within a few milliseconds. Events arrive in commit order, so a lower sequence can follow a higher one. sequence is unique per event: deduplicate by it. Resuming with after cannot see a lower sequence that commits after you disconnect. Use a v2 cursor when you need gap-free resume.
Gotcha: always process events idempotently. A reconnect can redeliver an event that was received immediately before the disconnect.

Filters and gap-free resume (v2)

Connect with ?v=2 and send a subscribe frame within 10 seconds, or send any subscribe, unsubscribe, or ping frame on an existing connection to switch it to v2.
  • filters takes event_types (exact types or families such as quote.*), rfq_ids, markets, and venues. Values match with OR within a list and AND across lists, up to 1,000 values per list.
  • include_broadcast defaults to true when you hold rfq:quote.
  • The server answers subscribed with the resume cursor delivery starts from, replays every event after it, then continues live. Send subscribe again (at most once per 250 ms) to replace the filters without redelivery.
  • A heartbeat every 15 seconds carries a cursor that covers everything before it on this connection. ping returns an exact cursor in pong, and unsubscribe stops delivery and returns one in unsubscribed.
  • Reconnect with ?resume=<cursor> (or resume in subscribe). You receive every event committed after it exactly once, including late commits, provided the gap closes within 2 hours. A malformed cursor is HTTP 400.
  • Each connection has a bounded queue. If you fall behind, you receive lagged with your exact cursor, and the connection closes with 4008.
While a gateway is still starting its event tail, a v=2 or resume connection gets HTTP 503 with Retry-After. Retry it.

Event types

quote.venue_* events go only to the maker of a venue-routed quote. They carry quote_id, rfq_id, state, venue, and venue_event; on quote.venue_accepted, venue_event holds the traded side, price, quantity, and confirm_by. Callers holding rfq:quote additionally receive the maker broadcast stream of venue-originated RFQ events.

Close codes

Scope and authentication failures, and the per-principal connection cap (429), happen before the upgrade and surface as an ordinary HTTP error rather than a close frame.

Venue RFQ firehose

Scope: rfq:quote. Upgrades to a WebSocket (101). The firehose pushes every status change of every RFQ on every connected venue, one WebSocket message per event, about 1 ms after the venue sends it. It carries only venues whose exchange_rfq_feed is true in /v1/venues/capabilities, and it returns 404 where it is turned off. Use it when you need to see every auction as it happens. Use GET /v1/exchange-rfqs when you only need the currently open set.
The unfiltered firehose is a lot of data. Size your client for it before you connect without filters.
  • Kalshi opens about 1,250 RFQs per second, and about as many close. Most are multi-leg combos (median 6 legs, up to about 200), and around 250,000 are open at any time.
  • Polymarket combos arrive at about 300 RFQs per second. Each auction lasts about 400 ms.
  • At those rates, the default compact encoding is about 3 MB/s of JSON, or about 0.5 MB/s with compress=true. detail=full is about 7.8 MB/s, or about 0.9 MB/s compressed.
  • If your connection cannot keep up, the server warns you, then closes it with 4008. Your client must read and parse at least as fast as events arrive.
Rates are live venue flow observed in October 2026. They vary with the market, and they spike around major events.
To keep up: filter on the server, enable compression, and do as little work as possible on the read path. Parse frames on one goroutine or thread and hand them to workers.

Subscribe

Pass options as query parameters on the upgrade URL, or send a subscribe frame after you connect. A later subscribe frame replaces your filters and encoding in place.
The server answers subscribed with your stream_id, resume_status (live, replayed, or gap), detail, and snapshot. Invalid query parameters fail the upgrade with HTTP 400. Filters run on the server before encoding. Events you filter out cost you no bandwidth and no parsing.

Encodings

Key your rows by the event’s top-level rfq_id. It is present on every event in both encodings.

Compression

Add compress=true to the URL, and make sure your WebSocket client offers permessage-deflate. The server declines compression for connections that don’t ask for it. Compression cuts bandwidth by about 6×. It costs CPU on both ends, so enable it when bandwidth is your limit.

Event types

On Polymarket, venue_rfq.executed can follow venue_rfq.expired for the same RFQ. The deadline closes the quote window, not the auction, so a trade can print after it. Don’t treat expired as final for Polymarket.
Venues don’t publish other makers’ quotes or fills. quoted, accepted, and updated only describe your own quotes, and only your connections receive them.

Heartbeats, lag, and close codes

The server sends a heartbeat every 15 seconds. It carries your current position. If you fall behind, you receive one lag_warning. If you keep falling behind, you receive lagged and the server closes the connection with 4008. The close reason carries your resume position: lagged stream_id=<id> since_seq=<venue>:<seq>,…. Other close codes are 1008 (a missing or invalid subscribe, or a failed authentication recheck), 1011 (a snapshot could not be read), and 1013 (too many connections). A feed_reset frame means the server resynchronized a venue and may have missed events. Resubscribe with snapshot: true.

Resume after a disconnect

  1. Keep stream_id and the last seq you processed for each venue. Heartbeats and the 4008 reason also carry them.
  2. Reconnect with stream_id=<id>&since_seq=kalshi:<seq>,polymarket:<seq>.
  3. Check resume_status in the subscribed frame:
    • replayed — you receive every event after your position, with no gap.
    • gap — the server can’t replay from your position. This happens when your reconnect reaches a different server, or the position is too old. The server streams a snapshot instead.
A snapshot (snapshot=true, or a gap) sends the filtered open set as venue_rfq.snapshot items between live events, then snapshot_end with a count. Apply snapshot items as upserts and terminal events as deletes. You may see duplicates, but never gaps.
You don’t need to rebuild your state from GET /v1/exchange-rfqs after a disconnect. Reconnect with your position, and use the snapshot if you get a gap.

Unmet demand

Polymarket reports, about every 30 seconds, which combos requesters asked for that no maker filled. The firehose sends it as venue_rfq.unmet_demand, and GET /v1/venue-rfqs/unmet-demand returns the latest summary per venue. Each entry has: Filter the REST endpoint with venue, reason, and min_count. On the firehose, a subscription that uses RFQ filters only receives venue_rfq.unmet_demand if it names it in event_types.
Unmet demand shows where requesters are not getting quotes. It is a direct signal of combos and sizes worth quoting.

Connection limits

Each server accepts a limited number of firehose connections, and a lower number per principal. Over either limit, you receive an error frame too_many_connections and close 1013. Open one connection per process and fan out internally, rather than one per consumer.

Machine-readable contract

The complete machine-readable contract lives in the RFQ service’s spec/openapi.yaml and spec/asyncapi.yaml files.