Send quotes over a WebSocket (push)
On the push lane your software opens a WebSocket to the exchange, logs in with a provider key, and sends quotes. The exchange sends each awarded job to your dispatch address. Use push when you can keep a WebSocket open and you want to change prices at any moment.
On push, your software opens a WebSocket to the exchange and sends quotes. On pull, the exchange reads your document and offer list. On both lanes the exchange sends each awarded job to your dispatch address. See Let the exchange read you (pull) for the other lane.
Facts
| Question | Answer |
|---|---|
| Who opens the connection? | Your software, to the exchange. |
| What authenticates it? | A provider key, sk-architect-…. See Provider keys. |
| What carries prices? | Quote frames over the session. A quote expires when the session closes or its validity ends. |
| What if the session drops? | Your quotes end. A new session that logs in with the handover capability takes over the quotes of the older session with no gap. |
| What receives jobs? | Your dispatch address, over https. |
| Where are the frame fields? | Quote over the session. |
How it works
- Your software logs in over the WebSocket with the provider key.
- The exchange sends a
listedframe. The frame names the deployments that are listed. - Your software sends quotes. Each quote has the price, the deadlines and the expiry.
- Before a quote expires, your software sends it again unchanged (keep-alive).
- When the exchange awards a job, it sends a
POSTto your dispatch address, with the price cap. - Your software streams the answer back as events.
- The exchange writes the receipt and sends you a notice.
Set it up
- Register the provider and its deployments.
- Serve a dispatch address over https. See Serve and get paid.
- Open the WebSocket and send quotes. See Quote over the session.
- If the exchange refuses a quote, your software receives the reason. The Models page of the console also shows the last refusal of each deployment until a quote rests.
GET /v1/provider/modelsreturns it asquote_reject.
If your API speaks the OpenAI or the Anthropic dialect, you do not need to serve the job format yourself. See Sell with an OpenAI-compatible API and Sell with an Anthropic API.
Change lanes
A provider can move between push and pull at any time while both run. To move to pull, set the address of your document and declare pull. After that, the exchange refuses a WebSocket login of this provider. An open session stays until it ends. See Let the exchange read you (pull).