Skip to main content
Trepa recommends the official @trepa/sdk package for TypeScript and Node. This guide is for integrations that call the HTTP API directly: another language, curl, or your own client. You use the same API key and wallet private key as SDK-based bots. Two ideas drive every integration:
  1. Session cookies after you exchange the API key for a session.
  2. Create, sign, submit for each on-chain action (predictions, claims, withdrawals).
Paths, bodies, and status codes are in the API Reference tab.

Session cookies

Authentication always starts by trading your API key for cookies: POST /auth/session with header trepa-api-key returns Set-Cookie headers (no JSON body):
Expired access tokens return 403 or 401 on /auth/*. Call /auth/refresh, refresh your cookie jar, retry.

Create, sign, submit

Authenticated writes always follow the same three steps:
  1. Create: POST the /transactions/... route. Body includes { transaction, proof } where transaction is an unsigned base64 VersionedTransaction.
  2. Sign: Deserialize, sign with your wallet key, serialize, base64-encode again.
  3. Submit: POST the paired /transactions/.../submit route with signed_transaction and the original proof.
Here is one full prediction round-trip in Node:

Node example (prediction)

The same pattern ports to Python (solders), Rust (solana-sdk), or other stacks you already use. Next: Rate limits.
Last modified on May 29, 2026