Send Heartbeat
Signals that the client is still active. The first heartbeat enrolls the user in heartbeat monitoring; after that, if no heartbeat arrives for more than 10 seconds, the server automatically cancels every open order under that API key.
Endpoints
Section titled “Endpoints”Two paths are available:
| Method | Path | Compatibility |
|---|---|---|
POST | /v1/heartbeats | Polymarket SDK compatible (recommended) |
GET | /auth/heartbeat | Legacy (backward compatible) |
Base URL: https://api.openfish.fun
Authentication
Section titled “Authentication”L2 authentication required. All five OPENFISH_* headers must be present.
Parameters
Section titled “Parameters”None.
Response
Section titled “Response”POST /v1/heartbeats:
{"status": "ok"}GET /auth/heartbeat (legacy):
{}Behavior
Section titled “Behavior”- First heartbeat: Enrolls the API key in heartbeat monitoring.
- Subsequent heartbeats: Resets the inactivity countdown.
- Missed heartbeat (>10s): All LIVE orders for that API key are canceled automatically.
Monitoring is scoped per API key. A recommended cadence is one heartbeat every 5 seconds to leave comfortable margin before the 10-second deadline.
Examples
Section titled “Examples”# Recommended (Polymarket SDK compatible)curl -X POST https://api.openfish.fun/v1/heartbeats \ -H "OPENFISH_ADDRESS: 0x..." \ -H "OPENFISH_SIGNATURE: ..." \ -H "OPENFISH_TIMESTAMP: 1700000000" \ -H "OPENFISH_API_KEY: ..." \ -H "OPENFISH_PASSPHRASE: ..."
# Legacycurl https://api.openfish.fun/auth/heartbeat \ -H "OPENFISH_ADDRESS: 0x..." \ -H "OPENFISH_SIGNATURE: ..." \ -H "OPENFISH_TIMESTAMP: 1700000000" \ -H "OPENFISH_API_KEY: ..." \ -H "OPENFISH_PASSPHRASE: ..."