Skip to main content
Opening an HTTPS connection costs two round trips before your request is sent. On an order that is dead time, and it is the single largest thing you control.

Reuse one connection

Create one client when your process starts and reuse it, rather than creating one per request. The Python SDK holds its connection open for you from 3.2.3, with nothing to set:
Python
On the TypeScript SDK, from 1.4.3, it is an option, because the setting it needs is process-wide and we will not reach into a transport you configured yourself:
TypeScript
Leave it off if you reach us through a proxy or with custom TLS, and set the idle timeout on your own transport instead.

On your own HTTP client

We advertise no keep-alive, so whatever your client does by default is what happens. Most hang up after a few seconds of quiet, which means a request sent after a pause pays for a new connection. Raise your idle timeout to 50 seconds and reuse one client. We hold an idle connection for at least 90 seconds, so 50 leaves room. Nothing breaks if you go higher or lower; you simply pay for more reconnects.

Where we run

The API is served from edge locations worldwide, so your TLS handshake finishes near you wherever you are. Orders are then routed from US East (Ohio). If you run your own infrastructure and latency is what you care about most, place it in that region. A client already there, holding its connection open, is as close to us as you can get.