> ## Documentation Index
> Fetch the complete documentation index at: https://docs.testnet.dev.adipredictstreet.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication overview

> PredictStreet's integrator API authenticates every request with an X-Api-Key header. Every operation that moves money is additionally signed with EIP-712.

PredictStreet's integrator API uses a **two-layer authentication model**:

1. **Session auth — API key.** Your server holds an issued key and
   sends it as `X-Api-Key: ps_live_<keyId>_<secret>` on every request.
   See [API keys](/auth/api-keys).
2. **Per-operation auth — EIP-712.** Every operation that moves
   funds (placing orders, vault split / merge) additionally
   requires an EIP-712 signature over the operation's typed data.
   An API key alone is never sufficient to move money — the private
   key of your `associatedWallet` signs each order / split / merge.

This split gives you stable long-lived credentials for the HTTP layer
while keeping cryptographic finality for writes — a compromised API
key cannot drain a vault, because the private key that signs the
EIP-712 authorisation never leaves your infrastructure.

<Note>
  **Retail user logins live on a separate surface.** If you're
  building a web/mobile experience where end users sign in with
  their own wallet, that flow (Sign-In With Ethereum → short-lived
  JWT) happens on `app.predictstreet.io`, not on this API. Partner
  integrations do not need — and should not implement — SIWE.
</Note>

<Tip>
  **One key, many wallets.** Trading firms with N sub-accounts,
  copy-trading platforms, and custodial brokers can request a
  `multi_wallet` partner kind — one API key fans out across many
  end-user wallets, with the actor declared on each request via
  `X-User-Wallet`. See [Partner kinds](/auth/api-keys#partner-kinds)
  for the contract.
</Tip>

## Flow at a glance

```mermaid theme={null}
sequenceDiagram
    autonumber
    participant P as Your backend
    participant API as core.api.dev.predictstreet.sde.adifoundation.ai

    Note over P: key + associatedWallet private key<br/>loaded from your secrets manager

    P->>API: GET /api/markets<br/>X-Api-Key: ps_live_...
    API-->>P: market list

    Note over P: sign Order struct with<br/>associatedWallet private key (EIP-712)

    P->>API: POST /api/orders/place<br/>X-Api-Key: ps_live_...<br/>{ maker, signature, … }
    API-->>P: { orderId, status, … }

    Note over P,API: partner session is stateless — the key is<br/>the credential, valid until revoked or expired
```

## Base URL

| Environment | Base URL                                                  |
| ----------- | --------------------------------------------------------- |
| **Testnet** | `https://core.api.dev.predictstreet.sde.adifoundation.ai` |
| **Staging** | Available on request                                      |
| **Mainnet** | Issued on partner onboarding                              |

Retail user traffic (`app.predictstreet.io`) is a separate surface
and isn't documented here.

## Where to next

<CardGroup cols={2}>
  <Card title="API keys" icon="key" href="/auth/api-keys">
    Format, scope taxonomy, endpoint coverage, rotation procedure.
  </Card>

  <Card title="Rate limits" icon="gauge" href="/auth/rate-limits">
    Per-partner, per-wallet, per-IP buckets.
  </Card>

  <Card title="EIP-712 signing" icon="signature" href="/concepts/trading/eip712-signing">
    How the per-operation order signature works.
  </Card>

  <Card title="Quickstart" icon="rocket" href="/quickstart">
    First order end-to-end with an API key.
  </Card>
</CardGroup>
