Skip to main content
OCX authenticates you with Sign-In With Ethereum (SIWE, EIP-4361). You prove control of your wallet by signing a message; the exchange returns a session that authorizes your trading, wallet, and account requests. The same session works for a browser and for automated clients. All requests go through the API gateway at https://api.ocx.global, written below as {BASE_URL}.

Access tiers

Public

No credentials. Market-data reads and public streams.

Session

A SIWE sign-in yields a session token valid for 7 days. Required for orders, quotes, your account, and your wallet.
The session token is a signed JWT. The gateway accepts it in either form:
  • the astra_session cookie (httpOnly, Secure, SameSite=None), set by a successful sign-in — browsers send it automatically;
  • an Authorization: Bearer <token> header — the form to use from a bot or agent.

Sign in with your wallet

1

Request a nonce

Ask the gateway for a one-time nonce to include in your signed message.
walletAddress must be a 20-byte hex address. The nonce is single-use and expires after 10 minutes; request a fresh one on each sign-in.
2

Build and sign a SIWE message

Construct a standard EIP-4361 message and sign it with your wallet (for example personal_sign, wagmi’s signMessage, or viem’s account.signMessage). The gateway rejects the message unless it carries:
A signature minted for another site or chain is rejected — there is no cross-domain replay.
3

Verify and open a session

Submit the exact message string and its signature. On success the response sets the astra_session cookie and returns your identity.
The token itself is the value of the astra_session cookie in the Set-Cookie response header.
4

Make authenticated requests

Send the cookie (browsers) or the token as a bearer header (bots). Check or end the session with:

End-to-end example

Each wallet is one OCX account. For a bot or agent, sign in with a dedicated wallet so its orders, positions, and risk are separate from your own. Re-run the sign-in before the 7-day session expires.

API keys

The app can create API keys, and the gateway exposes key management under /fut/me/api-keys (list, create, revoke — session only). The public API does not yet accept these keys for authentication. Use a session token (cookie or Authorization: Bearer) for all automated access.

Access by capability

Rate limits

The gateway rate-limits requests per client. The /auth/* endpoints are limited to 10 requests per minute per IP. See Errors & rate limits for the full picture and the x-ratelimit-* headers.