Skip to main content

Who this is for

Your backend calls the PredictStreet integrator API. Examples:
  • Market-maker bot quoting a pre-approved wallet
  • Copy-trading service mirroring strategy signals
  • Data pipeline pulling your positions / fills into a warehouse
  • Mobile backend that never ships secrets to the device
The integrator API (core-api.adipredictstreet.com) is designed for server-to-server traffic. Retail users sign in on the web app (adipredictstreet.com); that login is outside the scope of this documentation. A signed-in user can also create a key for their own account and trade from a bot: see Self-service keys.
Never ship an API key to a browser, mobile app bundle, public repo, or any environment a user can inspect. A leaked key lets anyone read your account data and take every action its scopes allow that needs no wallet signature, such as cancelling your orders. It cannot place orders or move money out of a vault without the wallet’s EIP-712 signature. A key with vault:migrate can also activate your generation-2 vault, which needs no wallet signature and cannot be undone. Ask your integration manager to revoke it immediately.

Format

Only a SHA-256 hash of secret (peppered with a server-side salt) is stored. If our database leaks, your secret does not.

Partner kinds

Every partner is one of two kinds. The kind is set at partner creation and decides where the request’s acting wallet comes from. Kind belongs to the partner, not to individual keys, so every key under a partner behaves the same way. Operations can change a partner’s kind, its requirePerWalletKyc setting or its associated wallet only after all of its active orders:write / vault:write keys are revoked. A multi_wallet key with orders:write is issued only to a partner registered as a market maker with at least one active registered trading wallet.

Compliance toggle on multi_wallet

Multi_wallet partners come in two compliance flavours, set by the requirePerWalletKyc boolean on the partner record: Single_wallet partners always enforce KYC at API key creation time (the partner’s associatedWallet must be APPROVED tier ≥ 1 before any write-scope key issues), so the toggle is inert there.

single_wallet flow

Send the API key, nothing else. The associatedWallet on the partner record is the request’s effective wallet for KYC, compliance, and rate-limit buckets. Any X-User-Wallet header is ignored. If a single_wallet partner has no associatedWallet attached yet, every authenticated endpoint rejects with 401 api_key_no_associated_wallet — admin must attach one before writes or /me reads work.

multi_wallet flow

Send the API key plus X-User-Wallet: 0x… on every request:
The header value is lower-cased server-side and becomes the request’s effective wallet for balances, positions, trades, fees, rate-limit buckets, and audit trails — exactly as if a single_wallet key were attached to that wallet. Rules:
  • Header missing → 401 api_key_user_wallet_required.
  • Header malformed (not 0x + 40 hex) → 401 api_key_user_wallet_invalid.
  • Wallet binding & account status: In enforce mode (default), the X-User-Wallet address must be bound to the partner organization in admin.partner_wallets. An unbound wallet, or a wallet whose account is closed, blocked, deleted, or banned, returns a neutral 403 account_unavailable ({ "code": "account_unavailable", "message": "This account is not available." }). This ensures third parties cannot probe or enumerate valid user accounts. A WebSocket handshake refused because the wallet is not bound closes with 4401 api_key_user_wallet_unavailable, and one with a closed, blocked or banned account with 4401 account_unavailable. An open socket whose wallet stops being bound closes with 4403 api_key_user_wallet_unavailable.
  • KYC enforcement on the header wallet is controlled by the partner’s requirePerWalletKyc flag (see Partner kinds table above). Two options:
    • requirePerWalletKyc: true (default) — every X-User-Wallet sub-account must clear retail KYC (status APPROVED, tier ≥ 1) via the same SumSub flow a retail user goes through. Used for sub-account models where each underlying wallet is a distinct person.
    • requirePerWalletKyc: false — the partner is KYB-onboarded as a legal entity and takes compliance responsibility for its sub-accounts. Per-wallet KYC is not checked. Used for trading firms / market makers / submitters whose addresses are operational, not retail identities. The first request through the key for a previously unseen X-User-Wallet auto-enqueues:
      1. vault deploy (VaultFactory on-chain, ~10 sec to confirm);
      2. on-chain limits opening — DepositLimitRegistry.setTier(VIP) and setCustomCaps(0, 0, 0), plus setDepositsRestricted(false) / setTradingRestricted(false) / setWithdrawalsRestricted(false). setCustomCaps(0, 0, 0) clears any per-wallet override, so the VIP tier applies: no on-chain deposit ceiling on singleDeposit / 30d / 12m. PredictStreet broadcasts all five ops; the sub-account is fully usable end-to-end (deposit + trade + withdraw) within ~30 sec of the first request. Without this auto-step the wallet would stay at tier NONE: every vault.depositERC20 would revert with KycRequired, and trading and withdrawals would be blocked on-chain.
      Until the vault is deployed, orders are rejected with vault_not_deployed. While the on-chain limits are still confirming, orders may also be rejected with kyc_blocked. Retry after a few seconds. Need a per-sub-account deposit cap? Contact your integration manager.
  • Each acting wallet still needs its own private key to sign the EIP-712 payload on writes. The on-chain CTFExchange and Vault contracts verify the signer ↔ vault binding, so the X-User-Wallet header alone cannot authorise a trade for a wallet you don’t control.
  • Each X-User-Wallet is the order’s signer. Sign the EIP-712 order with that wallet’s private key and put its address in the struct’s signer field. The struct’s maker must be that wallet’s vault of the market’s generation (GET /api/me/vault vaults[]), with signatureType: 1 (VAULT). It is never the EOA itself, and signatureType: 0 is not accepted.
  • The REST body maker may be either the X-User-Wallet address or its vault. Any other value is rejected at the gateway with maker_mismatch (HTTP 401 on /api/orders/place, a per-entry REJECTED on /api/orders/place-batch).
  • If the signature is not in canonical 65-byte (r, s, v) form (v = 27 or 28 and low s; RND-2432) or does not recover to the X-User-Wallet address (for example, because it was signed with maker set to the EOA or with signatureType: 0), placement returns status: "REJECTED" with code: "bad_signature". Non-canonical byte encodings carry details: { expected_signer, signature_form }; canonical 65-byte signatures carry details.platform_canonical_struct with the exact struct the platform verified so you can compare it field by field with the struct you signed.

Getting a key

There are two kinds of key. Partner keys (this section) are issued by PredictStreet ops via the admin panel. Self-service keys are created by a signed-in user for their own wallet on the web app’s API-keys page: see Self-service keys below. For a partner key, contact your integration manager with:
  1. Partner name — internal label.
  2. Contact email — for rotation notices, incident pages, and SLA comms. It is also subscribed automatically to maintenance emails when your account is created, so give an address your on-call watches.
  3. Partner kind — single_wallet (default) or multi_wallet. Pick multi_wallet if one key needs to act across many wallets (trading desk with N sub-accounts). See Partner kinds above, including the market-maker requirement for orders:write.
  4. Associated wallet — required for single_wallet partners that need write scopes; the wallet must have signed in to the web app at least once and cleared KYC tier 1. For multi_wallet partners the REST API ignores it. On /ws/user it is used only when the upgrade names no wallet: an X-User-Wallet header (or wallet= / user_wallet= query parameter) takes precedence (RND-4958).
  5. IP allowlist — not offered at the moment. Do not request one: the platform cannot yet match your egress IP reliably behind its edge, so an allowlisted key would be refused on every call (api_key_ip_denied). Protect the key by keeping the secret server-side and requesting only the scopes you need.
  6. Requested scopes — what endpoints you plan to hit (see table below).
You will receive the plaintext key exactly once on creation. Copy it into a secrets manager (AWS Secrets Manager, HashiCorp Vault, Kubernetes Secret, 1Password) immediately. We cannot show it to you again — if lost, we revoke and issue a new one.

Self-service keys (your own account)

A signed-in user can create keys for their own wallet on the web app’s API-keys page (GET / POST /api/me/api-keys, plus regenerate and revoke). These routes take the web-app session only: a key cannot create, regenerate or revoke keys.
  • Bound to your wallet. The key acts on your own wallet only (like a single_wallet partner key); no X-User-Wallet header is needed.
  • Permissions. read (portfolio:read, orders:read), trade (orders:write), withdraw (withdraw:write) and vault (vault:migrate, positions:write). A key with withdraw can be created only for a registered, unblocked wallet with full ID verification (403 kyc_required / wallet_blocked / wallet_not_registered), and withdraws only if it was created after that verification. Using any key still runs the KYC gates of the route it calls. Partner-only scopes and routes (for example partner:limits:write, GET /api/platform/status) answer 403 partner_key_required.
  • Expiry and limits. 30, 90 or 365 days, or no expiry; at most 10 keys that are not revoked per account (an expired key counts until you revoke it). The secret is shown once, on creation or regeneration.
  • Accounts managed by a partner (signed in through a partner’s app) cannot create keys: 403 api_keys_unavailable_for_partner_accounts.
  • Platform freeze and staff wallets. Creating and regenerating a key are write actions (RND-3925): while a platform-wide freeze is on they answer 503 platform_frozen with retryAfterSec 60 (Retry-After), and a staff wallet gets 403 employee_trading_prohibited. Listing and revoking keys are not affected.
  • Location checks apply. Unlike partner keys, a self-service key gets the geo check on order placement and money-moving routes: see Geo handling.
  • A staff block revokes your keys for good (RND-2752). When support blocks or login-suspends an account, every self-service key of that account is revoked (a call with it then gets 401 api_key_revoked) and its app sessions end. Lifting the block does not bring them back: sign in again and create new keys. Creating a key while such a block is on is refused with account_blocked: 401 from sign-in, or 403 if the block takes effect while the request is in flight.

Trading by API with an email or Google wallet

If you signed up with email or Google, your account uses an embedded wallet. A self-service key lets a bot read your data and send requests, but it does not sign anything:
  • Every order needs your wallet’s own EIP-712 signature. The key authenticates the request; the order itself must be signed by your wallet (see EIP-712 signing). PredictStreet does not sign orders for you and offers no server-side or delegated signer, so a bot can place orders only if it can produce that signature for your wallet. Reads and cancels need only the key (with the read / trade permission).
  • Moving money out (withdrawals, vault transfers) also needs your wallet’s signature, as for every key.
  • The bot’s network matters. Order placement and money-moving requests from a blocked country, a VPN, Tor or a data-center / hosting IP (a typical cloud server) are refused with 403 geo_blocked; see Geo handling.
  • Accounts created through a partner’s app cannot create keys (see above).

Scopes

Each key carries a set of scopes. Requests are rejected with 403 api_key_scope_missing if the endpoint requires a scope the key doesn’t carry. Where the table below says “or”, any one of the listed scopes is enough. positions:write and vault:migrate work only on single-wallet keys; a multi_wallet key needs vault:write on those routes (and portfolio:read or vault:write on GET /api/me/vault). For most partners, orders:write + orders:read + portfolio:read covers the day-one scope.
Vault generation 2 adds the vault:migrate and positions:write scopes (vault permission on self-service keys). See API keys and WebSocket.

Endpoint coverage

Authenticated endpoints

Require X-Api-Key with the listed scope.

Public endpoints

No authentication required. Any rate limit on these endpoints is per source IP. An X-Api-Key header is ignored here and does not raise it:
  • GET /api/markets, /api/markets/{slug}, /api/markets/{symbol}/orderbook, /api/markets/{symbol}/trades, /api/markets/{symbol}/ohlc
  • GET /api/events, /api/events/{slug}, /api/events/featured, /api/events/stats
  • GET /api/tags
  • GET /api/platform/contracts, /api/platform/fee-config
  • GET /api/compliance/geo
  • GET /health, /ready
GET /api/platform/status and GET /api/platform/notices used to be on this list. They now require a partner API key — they report what is down and why, which is not something we publish to the open internet. See Maintenance notifications.

WebSocket

Both WebSocket gateways authenticate with the same X-Api-Key as HTTP — send either the X-Api-Key header on the upgrade or a ?key=<token> query parameter (for browser clients that can’t set headers on the WebSocket upgrade). For multi_wallet keys on /ws/user, send the acting wallet in the X-User-Wallet header, or via the ?wallet=<address> or ?user_wallet=<address> query parameter.

WebSocket close codes

The gateway closes failed connections with structured close codes and reason strings:

Not available via API key

A small number of surfaces are intentionally not exposed to integrators — they require a signed-in web-app user session and live on the web app (adipredictstreet.com). These include the self-service profile / consent / KYC submission flows: partners shouldn’t drive end-user identity capture from server-side because SUMSUB and the geo-fingerprinting layer expect the live retail session. Withdrawals are fully partner-driven via API key (request, list, detail, cancel) — the vault-owner EIP-712 signature still gates funds movement, so an API key alone cannot move money out of a vault. See Withdrawals overview for the dual-signature flow. If you have a use case that needs something currently outside the API-key scope, reach out — some can be unlocked with a stricter scope set, others are architecturally out of scope.

Making a request

single_wallet partner:
multi_wallet partner — add X-User-Wallet:
The REST maker field must equal the request’s effective wallet (the associatedWallet for single_wallet, or the X-User-Wallet header value for multi_wallet) or that wallet’s vault. Any other value is rejected with 401 maker_mismatch. This field does not change what you sign: the EIP-712 order is always verified with signer = the effective wallet, maker = its vault of the market’s generation (GET /api/me/vault vaults[]) and signatureType: 1, and it must be signed with the effective wallet’s private key. The wallet needs a deployed vault first, otherwise orders are rejected with vault_not_deployed. See EIP-712 signing for the full struct.Your API key authenticates the HTTP request; the EIP-712 signature authorises the trade. Neither alone is sufficient. PredictStreet checks the signature when you place the order: a failure is rejected with bad_signature (details.signature_form when the signature is not canonical 65-byte (r, s, v), or details.platform_canonical_struct showing the exact struct that was verified when it is). CTFExchange checks it again on-chain before the trade settles.

What happens on every request

  1. Parse the X-Api-Key header into (env, keyId, secret). Bad shape → 401 api_key_bad_format.
  2. Lookup the key by keyId. Unknown → 401 api_key_unknown_key.
  3. Verify the hash in constant time. Mismatch → 401 api_key_bad_secret.
  4. Lifecycle checks: revoked → 401 api_key_revoked; expired → 401 api_key_expired; partner suspended → 401 api_key_suspended; source IP not in allowlist (if set) → 401 api_key_ip_denied.
  5. Resolve effective wallet — depending on partner kind:
    • single_wallet → partner.associatedWallet. Not attached → 401 api_key_no_associated_wallet.
    • multi_wallet → the X-User-Wallet header (lower-cased). Header missing → 401 api_key_user_wallet_required; not a 0x-prefixed 40-hex address → 401 api_key_user_wallet_invalid.
    Partner-level reads (GET /api/platform/status, /notices, /maintenance) skip this step: they need no X-User-Wallet.
  6. Account status & wallet binding checks:
    • For single_wallet: Associated wallet must not be banned, blocked, closed, or deleted (returns 401 wallet_banned, account_blocked, account_closed).
    • For multi_wallet: The X-User-Wallet address must be bound to the key’s partner in enforce mode, and the account must not be banned, blocked, closed, or deleted. Any failure returns a neutral 403 account_unavailable ({ "code": "account_unavailable", "message": "This account is not available." }).
  7. Scope check. Missing → 403 api_key_scope_missing with the required scope in the response body.
  8. Set identity — the resolved wallet becomes the request’s effective wallet for all downstream checks (KYC, compliance, rate-limit buckets, audit trails).

Rate limits

API-key requests are counted in two kinds of independent bucket:
  • IP bucket — shared edge defence (same as anonymous traffic).
  • Wallet bucket — per effective wallet (the associatedWallet for single_wallet, or the X-User-Wallet header value for multi_wallet). Same ceiling regardless of call volume distribution across your keys.
Every bucket that applies to an endpoint must pass. The first exhausted bucket returns 429, with Retry-After set to that bucket’s wait. The X-RateLimit-Limit / -Remaining / -Reset headers describe the endpoint’s own bucket (the wallet bucket where one applies), not necessarily the tightest one. Your partner record’s rate tier (rateLimitPerMin, default 600) scales every wallet bucket your keys hit (except that the 2FA limits under /api/me/withdrawal-security/totp/*, and the shared portfolio bucket on the /api/me/* portfolio routes, are never raised above the listed values; the vault-transfer routes that share that bucket are still raised: see the shared-bucket row in Rate limits), and the per-partner buckets of the partner trade endpoints, of POST /api/partners/limits and of GET /api/platform/status, /notices and /maintenance: effective limit = floor(listed limit × rateLimitPerMin / 600), minimum 1. 600 applies the published limits as-is and 1200 doubles them, apart from those exceptions. IP buckets are never scaled. To change your tier, contact your integration manager. See Rate limits for the per-endpoint table.

Geo handling

Geographic blocking (FATF blacklist / greylist) does not apply to partner-key requests — integrator egress IPs are data-centre / VPN class and blocking them isn’t a meaningful control (you could proxy trivially). Self-service keys are different. A key a user created for their own account is held by that user, not an integrator. On the routes that run the geo check (order placement: POST /api/orders/place, /place-batch; and money-moving routes: withdrawals, deposits, vault operations, redeem), its requests get the country check and the VPN / Tor / hosting check: requests from a blocked country, a VPN, Tor or a data-center / hosting IP are refused with 403 geo_blocked, even from an allowed country. Reads and cancels have no geo check. Run such a bot from a non-hosting IP in an allowed country. For a bot that must run on a server, ask support: compliance can exempt one key from the hosting rule (the VPN, Tor and country checks still apply; the exemption stays with the key when its secret is regenerated). Cancelling orders (/api/orders/cancel, /cancel-batch, /cancel-all) has no geo check for any caller. When the check cannot be completed for a self-service key’s request, the request is refused rather than let through:
  • 503 geo_check_unavailable: the country of the IP cannot be looked up and no earlier country is known for it.
  • 503 vpn_check_unavailable: the VPN / hosting lookup is unavailable and no earlier result is known for the IP; or the IP is a hosting IP and whether the key is exempt from the hosting rule could not be read; or the limit on lookups of new IP addresses has been reached.
Both carry retryAfterSec: 60 (also sent as the Retry-After header) and the message “Location checks are temporarily unavailable. Please retry shortly.” The limit on new IP addresses counts distinct addresses not seen recently, per wallet per UTC hour, per wallet per UTC day, and platform-wide per UTC day. Addresses already in use keep working, but once a limit is reached, requests from further new addresses are refused until the next UTC hour (the per-wallet hourly limit) or the next UTC day (the daily limits), whatever retryAfterSec says. The response does not say which of these causes applies, so run the bot from a stable address. A 403 geo_blocked takes precedence over both 503s when the country, or the VPN / Tor / hosting check, already refuses the request; when both lookups fail, the answer is geo_check_unavailable. For partner keys, compliance stays in force at the wallet level via KYC / AML / RG gates on the effective wallet: the partner’s associatedWallet for single_wallet, or the X-User-Wallet sub-account for multi_wallet. Per-wallet KYC is waived only for multi_wallet partners with requirePerWalletKyc: false, where the KYB-onboarded partner takes that responsibility.

Rotation

Rotate keys pre-emptively on any of:
  • Employee who had access leaves.
  • Secrets-manager misconfiguration suspected.
  • Source-code leak.
  • Routine 6-month rotation hygiene.
Process:
  1. Issue the replacement key via admin. Both keys now work.
  2. Roll your services to the new key. No downtime.
  3. Revoke the old key via admin. Propagation is near-instant; worst-case lag 60s.
A revoked key rejects every subsequent request with 401 api_key_revoked. Re-enabling is not supported — issue a new key.

Security invariants

  • X-Api-Key is the only scheme for partner integrations. No cookies, no basic-auth fallback on core-api.adipredictstreet.com. The API also accepts Authorization: Bearer tokens, but those are web-app user session tokens, not a partner credential. If both are sent, X-Api-Key wins. A request with neither on an authenticated endpoint gets 401 auth_required; a malformed key gets 401 api_key_bad_format.
  • Scopes are enforced server-side. Adding a scope to your key’s stored list is the only way to access a gated endpoint — client-side claims are ignored.
  • Writing still requires EIP-712. The API key proves you’re a pre-approved partner; the EIP-712 order signature proves you authorised the specific trade. CTFExchange verifies this cryptographically on-chain — no compromise of our infrastructure lets anyone move your funds without your private key.