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

# Place an order

> Submit a new order to an exchange. The shape of `signed_order` depends on `exchange`:

- **polymarket** — `SignedPolymarketOrder` produced by `buildPolymarketOrder()`
- **kalshi** — `KalshiLimitOrder` (server signs)
- **opinionlabs** — `SignedOpinionLabsOrder` produced by `buildOpinionLabsOrder()`
- **gemini** — `GeminiPredictionOrder` produced by `buildGeminiOrder()` (server signs)
- **limitless** — `SignedLimitlessOrder` produced by `buildLimitlessOrder()`
- **predictfun** — `PredictFunOrderPayload` produced by `buildPredictFunOrder()`

Returns the order ID and current status. Use `GET /orders/{id}` to poll for fills.



## OpenAPI

````yaml openapi.json POST /api/v1/orders
openapi: 3.0.3
info:
  title: Delphi Markets API
  description: >-
    Welcome to Delphi Markets API


    The Delphi Markets API provides unified access to prediction market data
    from **Kalshi (KLSI)** and **Polymarket (POLY)** exchanges.


    Quick Start:


    1. **Get a test API key** - Click on `POST /api/v1/test-key` below and hit
    'Try it'

    2. **Copy your key** - Save the `api_key` from the response

    3. **Authorize** - Click 'Authorize' in the sidebar and paste your key

    4. **Start exploring** - Try any endpoint!


    What You Can Build:


    - **Trading Bots**: Access real-time orderbook data and trade history

    - **Market Analytics**: Analyze market movements, spreads, and liquidity

    - **Research Tools**: Search and filter across thousands of prediction
    markets

    - **Price Feeds**: Get live pricing data for any market


    ---


    Authentication:


    All API requests require an API key passed in the `X-API-Key` header:


    Example request: GET `/api/v1/klsi/markets`

    Header: X-API-Key: dphi_live_your_key_here


    Getting an API Key:


    | Type | Duration | Rate Limit | How to Get |

    |------|----------|------------|------------|

    | Test Key | 10 minutes | 60 req/min | `POST /api/v1/test-key` |

    | Production Key | Permanent | 300 req/min | Contact us |


    ---


    Rate Limits:


    Requests are rate-limited per API key:


    - **Test keys**: 60 requests per minute

    - **Production keys**: 300 requests per minute


    When you exceed the limit, you'll receive a `429 Too Many Requests`
    response. Wait and retry.


    ---


    Error Codes:


    | Code | Meaning |

    |------|---------------|

    | 400 | Bad Request - Invalid parameters |

    | 401 | Unauthorized - Missing or invalid API key |

    | 404 | Not Found - Resource doesn't exist |

    | 429 | Too Many Requests - Rate limit exceeded |

    | 500 | Server Error - Something went wrong |


    All errors return JSON with an `error` field:


    {"error": "invalid api key format"}


    ---


    Support:


    For production API keys or support, visit
    [delphimarkets.com](delphimarkets.com).
  version: 1.0.0
  contact:
    name: Delphi Markets
    url: https://delphimarkets.com
  x-logo:
    url: https://delphimarkets.com/logo.png
servers:
  - url: https://api.delphiterminal.co
    description: Delphi Markets API
security:
  - ApiKeyAuth: []
tags:
  - name: Getting Started
    description: >-
      Start here to get a test API key and begin experimenting with the API.
      Test keys are valid for 10 minutes.
  - name: Health
    description: Health check endpoint to verify the API is operational.
  - name: Auth
    description: >-
      User authentication endpoints for creating accounts and managing sessions.
      Note: These are separate from API key authentication.
  - name: Search
    description: >-
      Search across all markets and events. Includes autocomplete suggestions
      for building search interfaces.
  - name: Delphi
    description: >-
      Cross-exchange market matching via Delphi IDs. Look up cluster metadata
      and find equivalent markets across all supported exchanges.
  - name: Clusters
    description: >-
      Cross-exchange market matching. Markets asking the same question across
      Kalshi, Polymarket, Limitless, and PFun are grouped into clusters. Use
      these endpoints to discover equivalent markets for arbitrage, hedging, and
      cross-exchange analytics.
  - name: KLSI
    description: >-
      Access Kalshi (KLSI) prediction market data including market details,
      orderbooks, trade history, and analytics. Kalshi is a US-regulated
      prediction market exchange.
  - name: Polymarket
    description: >-
      Access Polymarket (POLY) prediction market data including market details,
      orderbooks, and trade history. Polymarket is a decentralized prediction
      market platform.
  - name: Limitless
    description: >-
      Access Limitless exchange prediction market data including orderbooks.
      Limitless is a prediction market platform.
  - name: Predict.fun
    description: >-
      Access Predict.fun exchange prediction market data including price
      history.
  - name: Opinion Labs
    description: >-
      Access Opinion Labs prediction market data including market details,
      orderbooks, price history, and trade history.
  - name: Gemini
    description: >-
      Access Gemini prediction market data including market details, orderbooks,
      price history, and trade history.
  - name: Manifold
    description: >-
      Access Manifold prediction market data including market details,
      orderbooks, price history, and trade history.
  - name: ForecastEx
    description: >-
      Access ForecastEx prediction market data including market details and
      trade history.
  - name: PredictIt
    description: >-
      Access PredictIt prediction market data including market details and price
      history.
  - name: Events
    description: >-
      Events group related markets together. Use these endpoints to browse
      events by category or find all markets within an event.
  - name: Candles
    description: >-
      OHLCV (Open, High, Low, Close, Volume) candle data across exchanges.
      Supports multiple time intervals: 1s, 1m, 5m, 10m, 1h, 1d. Currently
      available for Kalshi (KLSI) with more exchanges coming soon.
  - name: Advanced Analytics
    description: >-
      Advanced orderbook analytics and price data. These endpoints provide
      deeper market insights including historical spreads, liquidity metrics,
      and best quote time series.
  - name: Trading
    description: >-
      Place, query, and cancel orders across all supported prediction-market
      exchanges (Polymarket, Kalshi, Opinion Labs, Gemini, Limitless,
      Predict.fun).


      **Important — client-side signing required for on-chain exchanges.**
      Polymarket, Opinion Labs, Limitless, and Predict.fun use EIP-712 signed
      orders. The signature must be produced on your machine using your private
      key — the Delphi server never has access to it. Use the
      `@delphimarkets/sdk` `build*Order()` helpers to construct a valid
      `signed_order` payload. Raw HTTP calls to `POST /orders` will be rejected
      by the exchange unless `signed_order` contains a valid signature.
  - name: Credentials
    description: >-
      Register and inspect your stored exchange credentials. Each user has at
      most one credential set per exchange. Credentials are encrypted at rest
      and used by the server when forwarding orders to centralized exchanges
      (Kalshi, Gemini) or for credential-derivation flows (Polymarket).
  - name: Polymarket Onboarding
    description: >-
      One-time helpers for Polymarket: derive CLOB HMAC credentials from an EOA
      private key, verify stored credentials are still valid, and look up the
      Gnosis Safe (proxy) address for an EOA. Use these once per user before
      placing your first Polymarket order.
paths:
  /api/v1/orders:
    post:
      tags:
        - Trading
      summary: Place an order
      description: >-
        Submit a new order to an exchange. The shape of `signed_order` depends
        on `exchange`:


        - **polymarket** — `SignedPolymarketOrder` produced by
        `buildPolymarketOrder()`

        - **kalshi** — `KalshiLimitOrder` (server signs)

        - **opinionlabs** — `SignedOpinionLabsOrder` produced by
        `buildOpinionLabsOrder()`

        - **gemini** — `GeminiPredictionOrder` produced by `buildGeminiOrder()`
        (server signs)

        - **limitless** — `SignedLimitlessOrder` produced by
        `buildLimitlessOrder()`

        - **predictfun** — `PredictFunOrderPayload` produced by
        `buildPredictFunOrder()`


        Returns the order ID and current status. Use `GET /orders/{id}` to poll
        for fills.
      operationId: placeOrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlaceOrderRequest'
            examples:
              polymarket:
                summary: Polymarket (signed EIP-712 on Polygon)
                value:
                  exchange: polymarket
                  market_id: 0x123...
                  order_type: GTC
                  signed_order:
                    salt: '1234567890'
                    maker: 0xSafeAddress...
                    signer: 0xEOAAddress...
                    taker: '0x0000000000000000000000000000000000000000'
                    tokenId: 12345...
                    makerAmount: '5000000'
                    takerAmount: '9090909'
                    expiration: '0'
                    nonce: '0'
                    feeRateBps: '0'
                    side: BUY
                    signatureType: 2
                    signature: 0xabcdef...
              kalshi:
                summary: Kalshi (server-side RSA-PSS signing)
                value:
                  exchange: kalshi
                  market_id: KXNHLGAME-26MAR30PITNYI-NYI
                  order_type: GTC
                  signed_order:
                    ticker: KXNHLGAME-26MAR30PITNYI-NYI
                    side: 'yes'
                    action: buy
                    type: limit
                    price_cents: '54'
                    count: '1'
              opinionlabs:
                summary: Opinion Labs (signed EIP-712 on BNB Chain)
                value:
                  exchange: opinionlabs
                  market_id: '8453'
                  order_type: GTC
                  signed_order:
                    salt: '1234'
                    maker: 0xSafeAddress...
                    signer: 0xEOAAddress...
                    taker: '0x0000000000000000000000000000000000000000'
                    tokenId: 1087612329966...
                    makerAmount: '3000000000000000000'
                    takerAmount: '6000000000000000000'
                    expiration: '1740000000'
                    nonce: '12345'
                    feeRateBps: '0'
                    side: '0'
                    signatureType: '2'
                    signature: 0xabcdef...
                    sign: 0xabcdef...
                    topicId: 8453
                    contractAddress: ''
                    currencyAddress: '0x55d398326f99059fF775485246999027B3197955'
                    price: '0.50'
                    tradingMethod: 2
                    timestamp: 1739000000
                    safeRate: '0'
                    orderExpTime: '0'
              gemini:
                summary: Gemini Predictions (server-side HMAC)
                value:
                  exchange: gemini
                  market_id: GEMI-FEDJAN26-DN25
                  order_type: GTC
                  signed_order:
                    symbol: GEMI-FEDJAN26-DN25
                    side: buy
                    outcome: 'yes'
                    quantity: '1'
                    price: '0.55'
                    time_in_force: good-til-cancel
              limitless:
                summary: Limitless (signed EIP-712 on Base)
                value:
                  exchange: limitless
                  market_id: trump-out-as-president-before-2027-1768933068297
                  order_type: GTC
                  signed_order:
                    order:
                      salt: 1234
                      maker: 0xEOAAddress...
                      signer: 0xEOAAddress...
                      taker: '0x0000000000000000000000000000000000000000'
                      tokenId: 56154308...
                      makerAmount: 1000000
                      takerAmount: 10000000
                      feeRateBps: 300
                      side: 0
                      nonce: 0
                      signature: 0xabcdef...
                      signatureType: 0
                      price: 0.1
                    ownerId: 1292635
                    orderType: GTC
                    marketSlug: trump-out-as-president-before-2027-1768933068297
              predictfun:
                summary: Predict.fun (signed EIP-712 on BNB Chain, Kernel smart wallet)
                value:
                  exchange: predictfun
                  market_id: '174032'
                  order_type: GTC
                  signed_order:
                    pricePerShare: '0.50'
                    strategy: LIMIT
                    order:
                      salt: '1234'
                      maker: 0xPredictAccount...
                      signer: 0xPredictAccount...
                      taker: '0x0000000000000000000000000000000000000000'
                      tokenId: 11050832...
                      makerAmount: '25000000000000000000'
                      takerAmount: '50000000000000000000'
                      expiration: 0
                      nonce: '0'
                      feeRateBps: '200'
                      side: 0
                      signatureType: 2
                      signature: 0xabcdef...
      responses:
        '200':
          description: Order placed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlaceOrderResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden
        '502':
          description: Upstream exchange returned an error
      security:
        - ApiKeyAuth: []
components:
  schemas:
    PlaceOrderRequest:
      type: object
      required:
        - exchange
        - market_id
        - order_type
        - signed_order
      properties:
        exchange:
          $ref: '#/components/schemas/Exchange'
        market_id:
          type: string
          description: Informational; used for order tracking on the Delphi server.
        order_type:
          $ref: '#/components/schemas/OrderType'
        signed_order:
          description: >-
            Order payload. Shape depends on `exchange` — see the per-exchange
            examples.
          oneOf:
            - $ref: '#/components/schemas/SignedPolymarketOrder'
            - $ref: '#/components/schemas/KalshiLimitOrder'
            - $ref: '#/components/schemas/SignedOpinionLabsOrder'
            - $ref: '#/components/schemas/GeminiPredictionOrder'
            - $ref: '#/components/schemas/SignedLimitlessOrder'
            - $ref: '#/components/schemas/PredictFunOrderPayload'
        credentials:
          $ref: '#/components/schemas/ExchangeCredentials'
          description: >-
            Optional inline credentials that override stored credentials for
            this single request. Rarely needed.
    PlaceOrderResponse:
      type: object
      required:
        - order_id
        - exchange
        - status
      properties:
        order_id:
          type: string
        exchange:
          $ref: '#/components/schemas/Exchange'
        status:
          type: string
          description: Exchange-reported status, e.g. `live`, `matched`, `cancelled`.
    Exchange:
      type: string
      enum:
        - polymarket
        - kalshi
        - opinionlabs
        - gemini
        - limitless
        - predictfun
      description: Supported exchange identifier.
    OrderType:
      type: string
      enum:
        - GTC
        - GTD
        - FOK
        - FAK
      description: >-
        Order time-in-force. GTC = good-til-canceled, GTD = good-til-date, FOK =
        fill-or-kill, FAK = fill-and-kill.
    SignedPolymarketOrder:
      type: object
      description: >-
        EIP-712 signed Polymarket CTF Exchange order. Produce with
        `buildPolymarketOrder()` from `@delphimarkets/sdk`.
      required:
        - salt
        - maker
        - signer
        - taker
        - tokenId
        - makerAmount
        - takerAmount
        - expiration
        - nonce
        - feeRateBps
        - side
        - signatureType
        - signature
      properties:
        salt:
          type: string
          description: Random uint256 (decimal string) for replay protection.
        maker:
          type: string
          description: >-
            Asset owner. Gnosis Safe address for Safe-based orders, EOA for
            direct EOA orders.
        signer:
          type: string
          description: EOA that produced the signature.
        taker:
          type: string
          description: >-
            Counterparty restriction. Use
            `0x0000000000000000000000000000000000000000` for any taker.
        tokenId:
          type: string
          description: Polymarket outcome token ID (uint256 decimal string).
        makerAmount:
          type: string
          description: Amount the maker is offering, in base units (USDC has 6 decimals).
        takerAmount:
          type: string
          description: Amount the maker is asking for, in base units.
        expiration:
          type: string
          description: Unix seconds. `0` = no expiry.
        nonce:
          type: string
          description: Per-maker monotonic nonce. `0` for first order.
        feeRateBps:
          type: string
          description: Fee rate in basis points (1 bp = 0.01%).
        side:
          $ref: '#/components/schemas/OrderSide'
        signatureType:
          type: integer
          enum:
            - 0
            - 1
            - 2
          description: 0 = EOA, 1 = Polymarket proxy, 2 = Polymarket Gnosis Safe.
        signature:
          type: string
          description: 65-byte ECDSA signature, hex-encoded with 0x prefix.
    KalshiLimitOrder:
      type: object
      description: >-
        Kalshi limit order. Server signs with your registered RSA key — no
        client-side signature required.
      required:
        - ticker
        - side
        - price_cents
        - count
      properties:
        ticker:
          type: string
          example: KXNHLGAME-26MAR30PITNYI-NYI
        side:
          type: string
          enum:
            - 'yes'
            - 'no'
          description: Which Kalshi outcome to take.
        action:
          type: string
          enum:
            - buy
            - sell
          default: buy
        type:
          type: string
          enum:
            - limit
          default: limit
        price_cents:
          type: string
          example: '54'
          description: Limit price in cents (1-99).
        count:
          type: string
          example: '1'
          description: Number of contracts.
    SignedOpinionLabsOrder:
      type: object
      description: >-
        EIP-712 signed Opinion Labs order on BNB Chain. Produce with
        `buildOpinionLabsOrder()` from `@delphimarkets/sdk`. Includes both the
        EIP-712 fields and Opinion-Labs-specific metadata.
      required:
        - salt
        - maker
        - signer
        - taker
        - tokenId
        - makerAmount
        - takerAmount
        - expiration
        - nonce
        - feeRateBps
        - side
        - signatureType
        - signature
        - sign
        - topicId
        - contractAddress
        - currencyAddress
        - price
        - tradingMethod
        - timestamp
        - safeRate
        - orderExpTime
      properties:
        salt:
          type: string
        maker:
          type: string
          description: Gnosis Safe address (asset owner).
        signer:
          type: string
          description: EOA that signs on behalf of the Safe.
        taker:
          type: string
        tokenId:
          type: string
        makerAmount:
          type: string
          description: USDT amount in base units (18 decimals on BSC).
        takerAmount:
          type: string
        expiration:
          type: string
          description: Unix seconds.
        nonce:
          type: string
        feeRateBps:
          type: string
        side:
          type: string
          enum:
            - '0'
            - '1'
          description: 0 = BUY, 1 = SELL.
        signatureType:
          type: string
          enum:
            - '2'
          description: Always 2 for Safe wallet (POLY_GNOSIS_SAFE).
        signature:
          type: string
        sign:
          type: string
          description: Duplicate of `signature` required by the Opinion Labs API.
        topicId:
          type: integer
          description: Opinion Labs market ID.
        contractAddress:
          type: string
          description: Empty string per Opinion Labs convention.
        currencyAddress:
          type: string
          description: 'USDT contract on BSC: 0x55d398326f99059fF775485246999027B3197955.'
        price:
          type: string
          description: Human-readable price (0.01 to 0.99).
        tradingMethod:
          type: integer
          enum:
            - 2
          description: 2 = limit order.
        timestamp:
          type: integer
          description: Order creation Unix seconds.
        safeRate:
          type: string
          default: '0'
        orderExpTime:
          type: string
          default: '0'
    GeminiPredictionOrder:
      type: object
      description: >-
        Gemini Predictions order. Server signs with your registered HMAC-SHA512
        secret.
      required:
        - symbol
        - side
        - outcome
        - quantity
        - price
      properties:
        symbol:
          type: string
          example: GEMI-FEDJAN26-DN25
        side:
          type: string
          enum:
            - buy
            - sell
        outcome:
          type: string
          enum:
            - 'yes'
            - 'no'
        quantity:
          type: string
          example: '1'
        price:
          type: string
          example: '0.55'
          description: Limit price in 0-1 range.
        time_in_force:
          type: string
          default: good-til-cancel
    SignedLimitlessOrder:
      type: object
      description: >-
        EIP-712 signed Limitless order on Base chain. Produce with
        `buildLimitlessOrder()` from `@delphimarkets/sdk`.
      required:
        - order
        - ownerId
        - orderType
        - marketSlug
      properties:
        order:
          type: object
          required:
            - salt
            - maker
            - signer
            - taker
            - tokenId
            - makerAmount
            - takerAmount
            - feeRateBps
            - side
            - nonce
            - signature
            - signatureType
            - price
          properties:
            salt:
              type: integer
            maker:
              type: string
            signer:
              type: string
            taker:
              type: string
            tokenId:
              type: string
            makerAmount:
              type: integer
              description: USDC base units (6 decimals).
            takerAmount:
              type: integer
            feeRateBps:
              type: integer
              default: 300
            side:
              type: integer
              enum:
                - 0
                - 1
              description: 0 = BUY, 1 = SELL.
            nonce:
              type: integer
            signature:
              type: string
            signatureType:
              type: integer
              enum:
                - 0
              description: 0 = EOA wallet.
            price:
              type: number
              description: Human-readable price (0.01 to 0.99).
        ownerId:
          type: integer
          description: Limitless owner ID. Fetch from /profiles.
        orderType:
          type: string
          example: GTC
        marketSlug:
          type: string
    PredictFunOrderPayload:
      type: object
      description: >-
        Predict.fun CreateOrderData envelope. Wrap a `SignedPredictFunOrder`
        with strategy/slippage flags. Produce with `buildPredictFunOrder()`.
      required:
        - pricePerShare
        - strategy
        - order
      properties:
        pricePerShare:
          type: string
          example: '0.50'
        strategy:
          type: string
          enum:
            - LIMIT
            - MARKET
        slippageBps:
          type: string
        isFillOrKill:
          type: boolean
        isPostOnly:
          type: boolean
        order:
          $ref: '#/components/schemas/SignedPredictFunOrder'
    ExchangeCredentials:
      type: object
      required:
        - api_key
        - api_secret
        - api_passphrase
      description: >-
        Generic credential envelope. Field meaning differs per exchange:


        - **kalshi** — `api_key` = Kalshi API key ID, `api_secret` = RSA private
        key PEM, `api_passphrase` = `''`.

        - **gemini** — `api_key` = Gemini key, `api_secret` = HMAC-SHA512
        secret, `api_passphrase` = `''`.

        - **opinionlabs** — `api_key` = Opinion Labs API key, others empty. Pass
        `signer_address`.

        - **limitless** — `api_key` = Limitless key, `api_secret` = HMAC secret.
        Pass `signer_address`.

        - **predictfun** — `api_key` = Predict.fun key, `api_secret` = Privy
        wallet hex private key. Pass `signer_address` = Predict Account.

        - **polymarket** — prefer `POST /polymarket/derive-credentials` instead.
      properties:
        api_key:
          type: string
        api_secret:
          type: string
          format: password
        api_passphrase:
          type: string
          format: password
        signer_address:
          type: string
          description: >-
            Optional. EVM address of the wallet that will sign orders (required
            for opinionlabs, limitless, predictfun).
    Error:
      type: object
      properties:
        error:
          type: string
    OrderSide:
      type: string
      enum:
        - BUY
        - SELL
    SignedPredictFunOrder:
      type: object
      description: Inner EIP-712 signed Predict.fun CTF Exchange order on BNB Chain.
      required:
        - salt
        - maker
        - signer
        - taker
        - tokenId
        - makerAmount
        - takerAmount
        - expiration
        - nonce
        - feeRateBps
        - side
        - signatureType
        - signature
      properties:
        hash:
          type: string
          description: Optional EIP-712 digest.
        salt:
          type: string
        maker:
          type: string
          description: Predict Account (Kernel smart wallet) or EOA.
        signer:
          type: string
        taker:
          type: string
        tokenId:
          type: string
        makerAmount:
          type: string
          description: Token base units (18 decimals on BSC).
        takerAmount:
          type: string
        expiration:
          type: integer
          description: Unix seconds. 0 = no expiry.
        nonce:
          type: string
        feeRateBps:
          type: string
          description: From `market.feeRateBps`.
        side:
          type: integer
          enum:
            - 0
            - 1
          description: 0 = BUY, 1 = SELL.
        signatureType:
          type: integer
          enum:
            - 0
            - 1
            - 2
          description: 0 = EOA, 1 = POLY_PROXY, 2 = POLY_GNOSIS_SAFE.
        signature:
          type: string
  responses:
    BadRequest:
      description: Malformed request body or missing required fields
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Your API key (get one from the test-key endpoint above)

````