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

# Answer the current step (signature or wallet result)

> Posts the wallet's answer to the step that is `needs_signature` and returns the next step.

- **Signature steps** (`eth_signTypedData_v4`, `personal_sign`): send `{"signature": "0x…"}` — exactly 65 bytes, hex. A JSON string in `result` is accepted as the signature too. Smart-account (EIP-1271) signatures are refused.
- **`wallet_sendCalls` steps** (Predict.fun approvals): send `{"result": <the wallet_sendCalls return value>}`, or `{"result": ["0xhash", …]}` after sending `fallbackRequests` one by one. The step moves to `working` while Kairos waits for the approvals on chain.

**Failures after a signature are not HTTP errors.** A venue refusal, an expired signing window, a rate limit or an ambiguous submission comes back as **`200`** with `status: "failed"`, `error`, and — when there is one — `errorCode`. Read `errorCode` before retrying: `ORDER_OUTCOME_UNKNOWN` and `CANCEL_OUTCOME_UNKNOWN` mean the venue may have acted, so read `/v3/wallets/{address}/orders` before placing again.

**Safe to repeat.** Posting to a step that is no longer `needs_signature` returns the current step unchanged; a step is never run twice. A wrong signer gets `400` and the same step stays open for another try.

This call waits up to about 45 s for the step to settle, then returns `working`; keep polling `GET /v3/actions/{id}`.



## OpenAPI

````yaml /openapi/wallet-api.json post /v3/actions/{id}
openapi: 3.1.0
info:
  title: Kairos Partner API
  version: 1.0.0
  description: >-
    Self-custody trading for wallets and apps: Kairos builds each step, the
    user's wallet signs it. Every operation is under `/v3`. Guides:
    https://docs.kairos.trade/wallets/overview
servers:
  - url: https://execution.kairos.trade
    description: Production
  - url: https://staging-execution.kairos.trade
    description: Staging
security: []
tags:
  - name: Actions
    description: >-
      Start `setup`, `order`, `cancel` and `login` actions and answer their
      steps. Live. Send `X-Kairos-Wallet-Api: 2`.
  - name: Reads
    description: >-
      Wallet readiness and balances per venue (partner id or API key, no wallet
      proof), and the wallet's orders and positions (also needs `Authorization:
      SIWE <token>` from a `login` action). Live.
  - name: Trade plans (preview)
    description: >-
      One buy order authorized up front in one signature batch, with a fee
      ceiling and deadlines, optionally funded by bridging the exact shortfall
      from Polygon or Arbitrum USDC. Preview: staging only; production returns
      `503` until release.
  - name: Fees (preview)
    description: >-
      Trading fees from trade plans accrue as a debt per wallet and are paid in
      one settlement — a gasless signature on Polymarket, a USDT transfer on
      Predict.fun. Preview: staging only.
  - name: On-chain intents (preview)
    description: >-
      Split, merge or redeem conditional tokens on a Polymarket deposit wallet
      with two signatures and no gas; Kairos confirms from the finalized
      receipt. Preview: staging only; production returns `503` until release.
paths:
  /v3/actions/{id}:
    parameters:
      - $ref: '#/components/parameters/WalletActionId'
      - $ref: '#/components/parameters/WalletApiVersion'
    post:
      tags:
        - Actions
      summary: Answer the current step (signature or wallet result)
      description: >-
        Posts the wallet's answer to the step that is `needs_signature` and
        returns the next step.


        - **Signature steps** (`eth_signTypedData_v4`, `personal_sign`): send
        `{"signature": "0x…"}` — exactly 65 bytes, hex. A JSON string in
        `result` is accepted as the signature too. Smart-account (EIP-1271)
        signatures are refused.

        - **`wallet_sendCalls` steps** (Predict.fun approvals): send `{"result":
        <the wallet_sendCalls return value>}`, or `{"result": ["0xhash", …]}`
        after sending `fallbackRequests` one by one. The step moves to `working`
        while Kairos waits for the approvals on chain.


        **Failures after a signature are not HTTP errors.** A venue refusal, an
        expired signing window, a rate limit or an ambiguous submission comes
        back as **`200`** with `status: "failed"`, `error`, and — when there is
        one — `errorCode`. Read `errorCode` before retrying:
        `ORDER_OUTCOME_UNKNOWN` and `CANCEL_OUTCOME_UNKNOWN` mean the venue may
        have acted, so read `/v3/wallets/{address}/orders` before placing again.


        **Safe to repeat.** Posting to a step that is no longer
        `needs_signature` returns the current step unchanged; a step is never
        run twice. A wrong signer gets `400` and the same step stays open for
        another try.


        This call waits up to about 45 s for the step to settle, then returns
        `working`; keep polling `GET /v3/actions/{id}`.
      operationId: answerWalletAction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WalletActionAnswer'
            examples:
              signature:
                summary: Typed-data or personal_sign signature
                value:
                  signature: >-
                    0x4f8b2c1d9e7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c3d9e8f7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d9e1b
              sendCalls:
                summary: wallet_sendCalls result
                value:
                  result:
                    id: >-
                      0x1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c
      responses:
        '200':
          description: >-
            The next step — `needs_signature` (another prompt), `working`,
            `done`, or `failed` (with `error` and usually `errorCode`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletActionStep'
              examples:
                signatureExpired:
                  summary: Answered after expiresAtMs
                  value:
                    id: 6a1f9e2c-3b4d-4c5e-8f6a-7b8c9d0e1f2a
                    type: order
                    status: failed
                    request: null
                    description: null
                    chainId: null
                    venue: null
                    result: null
                    error: >-
                      the signing window closed before a signature was accepted;
                      nothing was placed; start a new action
                    errorCode: SIGNATURE_EXPIRED
                loginDone:
                  summary: Login finished
                  value:
                    id: 2d4f6a8c-0e1b-4c3d-9e5f-7a9b1c3d5e7f
                    type: login
                    status: done
                    request: null
                    description: null
                    chainId: null
                    venue: null
                    result:
                      token: >-
                        TWVzc2FnZSBleGFtcGxl.4f8b2c1d9e7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c1b
                      expiresAt: '2026-10-29T12:00:00Z'
                    error: null
        '400':
          description: >-
            JSON: `signature is required`; `signature must be hex`; `signature
            must be 65 bytes`; `signature is not from this wallet` (the step
            stays open — sign with the right account and post again).


            Plain text: the body is not valid JSON, or `{id}` is not a UUID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletApiError'
              example:
                error: signature is not from this wallet
            text/plain:
              schema:
                $ref: '#/components/schemas/WalletPlainTextError'
        '401':
          $ref: '#/components/responses/WalletTenantUnauthorized'
        '403':
          $ref: '#/components/responses/WalletTenantForbidden'
        '404':
          description: '`unknown or expired action`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletApiError'
        '409':
          description: >-
            `this action is busy; GET it and retry` — another request is
            advancing this action. `GET /v3/actions/{id}`, then answer the step
            it shows.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletApiError'
              example:
                error: this action is busy; GET it and retry
        '413':
          $ref: '#/components/responses/WalletPayloadTooLarge'
        '415':
          $ref: '#/components/responses/WalletUnsupportedMediaType'
        '422':
          $ref: '#/components/responses/WalletUnprocessable'
        '429':
          $ref: '#/components/responses/WalletRateLimited'
        '500':
          $ref: '#/components/responses/WalletInternalError'
        '502':
          $ref: '#/components/responses/WalletVenueUnavailable'
        '503':
          $ref: '#/components/responses/WalletServiceUnavailable'
        '504':
          $ref: '#/components/responses/WalletGatewayTimeout'
      security:
        - walletPartnerId: []
        - apiKeyClientId: []
          apiKeyKey: []
          apiKeySecret: []
components:
  parameters:
    WalletActionId:
      name: id
      in: path
      required: true
      description: Action id returned by `POST /v3/actions`.
      schema:
        type: string
        format: uuid
    WalletApiVersion:
      name: X-Kairos-Wallet-Api
      in: header
      required: true
      description: >-
        Wallet API contract version. Send `2` — the multi-venue contract this
        reference documents. Without the header (or with any other value)
        `/v3/actions` and `/v3/wallets/*` serve the original Polymarket-only
        contract, which ignores venue prefixes, `expiresAt` and `setup.venues`,
        omits `chainId`, `venue` and `fallbackRequests` from steps, refuses
        orders on a wallet that is not set up (`409`), and returns snake_case
        order and position rows.
      schema:
        type: string
        enum:
          - '2'
      example: '2'
  schemas:
    WalletActionAnswer:
      type: object
      description: >-
        Answer to a `needs_signature` step. Send `signature` for signature
        prompts (65 bytes, hex, `0x` optional); a JSON string in `result` is
        read as the signature. For `wallet_sendCalls`, send the wallet's return
        value (or the transaction hashes from `fallbackRequests`) as `result`.
      properties:
        signature:
          type: string
          pattern: ^(0x)?[0-9a-fA-F]{130}$
          description: 65-byte ECDSA signature, hex (`0x` optional).
          example: >-
            0x4f8b2c1d9e7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c3d9e8f7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d9e1b
        result:
          description: >-
            The wallet's return value for `wallet_sendCalls`, or an array of
            transaction hashes.
    WalletActionStep:
      type: object
      description: >-
        The current step of an action. Every response from `/v3/actions` and
        `/v3/actions/{id}` is one of these.
      required:
        - id
        - type
        - status
        - request
        - description
        - chainId
        - venue
        - result
        - error
      properties:
        id:
          type: string
          format: uuid
          description: Action id. One id for the whole action, across venues.
        type:
          type: string
          enum:
            - setup
            - order
            - cancel
            - login
        status:
          $ref: '#/components/schemas/WalletStepStatus'
        request:
          description: What the wallet must run. Non-null only while `needs_signature`.
          oneOf:
            - $ref: '#/components/schemas/WalletEip1193Request'
            - type: 'null'
        description:
          type:
            - string
            - 'null'
          description: >-
            Text to show with the wallet prompt (e.g. `Confirm this Hyperliquid
            order`), or progress text while `working`.
        chainId:
          type:
            - string
            - 'null'
          description: >-
            EIP-155 chain id (hex) the wallet must be on to answer — `0x89`
            Polygon, `0x38` BNB Chain, `0xa4b1` Arbitrum One (`0x66eee` Arbitrum
            Sepolia on Hyperliquid testnet). `null` for `personal_sign` and when
            nothing is asked.
          example: '0x38'
        venue:
          oneOf:
            - $ref: '#/components/schemas/WalletVenue'
            - type: 'null'
          description: Venue of the current prompt; `null` when finished and on cancels.
        fallbackRequests:
          type: array
          description: >-
            Present with `wallet_sendCalls` requests only — the same calls as
            individual `eth_sendTransaction` requests, for wallets without
            EIP-5792. Send them in order and answer with `{"result": ["0xhash",
            …]}`.
          items:
            $ref: '#/components/schemas/WalletEip1193Request'
        expiresAtMs:
          type: integer
          format: int64
          description: >-
            Last accepted millisecond (Unix ms) for answering this prompt.
            Answers after it fail the action with `SIGNATURE_EXPIRED`.
          example: 1793130772999
        holdUntilMs:
          type: integer
          format: int64
          description: >-
            On a `working` order the venue is still matching — poll again after
            this time (Unix ms). `result` then holds a provisional outcome with
            `final: false`.
        result:
          description: >-
            Outcome on `done` (and the provisional outcome of a held order).
            Shape depends on `type`.
          oneOf:
            - $ref: '#/components/schemas/WalletSetupResult'
            - $ref: '#/components/schemas/WalletOrderResult'
            - $ref: '#/components/schemas/WalletCancelResult'
            - $ref: '#/components/schemas/WalletLoginResult'
            - type: 'null'
        error:
          type:
            - string
            - 'null'
          description: Why the action failed; non-null on `failed`.
        errorCode:
          $ref: '#/components/schemas/WalletErrorCode'
    WalletApiError:
      type: object
      description: >-
        Wallet API error body. `error` is a human-readable message; `code` is
        set on a few structured refusals (e.g. `CLIENT_ORDER_ID_CONFLICT`,
        `POLYMARKET_V2_TRADING_DISABLED`, `SIGNATURE_EXPIRED`); `errorCode`
        mirrors `code` where the same refusal can also surface on a failed step.
        Most `/v3` errors carry only `error`. Framework rejections (malformed
        JSON, wrong shape, missing content type) are plain text, not this body.
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable message.
        code:
          type: string
          description: Stable code, present on structured refusals only.
        errorCode:
          type: string
          description: >-
            Same as `code`; present where the refusal can also appear as a
            failed step's `errorCode`.
      example:
        error: unknown or expired action
    WalletPlainTextError:
      type: string
      description: >-
        A plain-text (non-JSON) rejection from request parsing — malformed JSON,
        a body of the wrong shape, a missing `Content-Type`, a malformed path id
        or query. Do not JSON-parse it.
      example: >-
        Failed to deserialize the JSON body into the target type: action.price:
        invalid type: floating point `0.52`, expected a string
    WalletStepStatus:
      type: string
      description: >-
        `needs_signature` — run `request` and answer; `working` — poll; `done` —
        read `result`; `failed` — read `error` and `errorCode`.
      enum:
        - needs_signature
        - working
        - done
        - failed
    WalletEip1193Request:
      type: object
      description: >-
        An EIP-1193 request to run through the wallet's provider exactly as
        given (`provider.request({method, params})`).

        - `eth_signTypedData_v4`: `params` = `[address, typedData]` —
        `typedData` is a **JSON string**; pass it unchanged.

        - `personal_sign`: `params` = `[hexMessage, address]`.

        - `wallet_sendCalls` (EIP-5792): `params` = `[{version, chainId, from,
        atomicRequired, calls}]`; the wallet pays gas.

        - `eth_sendTransaction`: `params` = `[{from, to, data, value,
        chainId?}]`; the wallet pays gas.
      required:
        - method
        - params
      properties:
        method:
          type: string
          enum:
            - eth_signTypedData_v4
            - personal_sign
            - wallet_sendCalls
            - eth_sendTransaction
        params:
          type: array
          items: {}
      example:
        method: personal_sign
        params:
          - 0x6b6169726f732e7472616465207761…
          - '0x8ba1f109551bD432803012645Ac136ddd64DBA72'
    WalletVenue:
      type: string
      description: Venue id. `predict.fun` is accepted as an input alias of `predictfun`.
      enum:
        - polymarket
        - predictfun
        - hyperliquid
    WalletSetupResult:
      type: object
      description: '`result` of a `setup` action.'
      required:
        - ready
      properties:
        ready:
          type: boolean
          description: Every requested venue is ready.
        venues:
          type: object
          description: Outcome per requested venue.
          additionalProperties:
            $ref: '#/components/schemas/WalletSetupVenueResult'
        tradingWallet:
          type:
            - string
            - 'null'
          description: >-
            Polymarket's trading wallet, when Polymarket was set up; `null` when
            Polymarket's setup failed.
        transactionHash:
          type:
            - string
            - 'null'
          description: Polymarket's approval transaction, when Polymarket was set up.
      example:
        ready: false
        venues:
          polymarket:
            ready: true
            tradingWallet: '0x2f9c4b8e1d7a6c5b4a3f2e1d0c9b8a7f6e5d4c3b'
            transactionHash: '0x7c3e9a1b5d2f4c6e8a0b2d4f6a8c0e2b4d6f8a0c2e4b6d8f0a2c4e6b8d0f2a4c'
          predictfun:
            ready: false
            next: fund
            tradingWallet: '0x8ba1f109551bd432803012645ac136ddd64dba72'
            venueDetail:
              reason: >-
                needs about 0.0004 BNB on BNB Chain to pay gas for 2 Predict.fun
                approvals
              approvals: 2
              gasWei: '400000000000000'
        tradingWallet: '0x2f9c4b8e1d7a6c5b4a3f2e1d0c9b8a7f6e5d4c3b'
        transactionHash: '0x7c3e9a1b5d2f4c6e8a0b2d4f6a8c0e2b4d6f8a0c2e4b6d8f0a2c4e6b8d0f2a4c'
    WalletOrderResult:
      type: object
      description: >-
        `result` of an `order` action. No fee fields: Kairos and venue fees are
        not reported here.
      required:
        - orderId
        - status
        - final
        - success
      properties:
        orderId:
          type: string
          format: uuid
          description: Kairos order id — use it to cancel.
        status:
          type: string
          description: >-
            Order status: Polymarket's answer (`matched`, `live`, `delayed`,
            `unmatched`) or the Kairos order status on Hyperliquid (`executing`,
            `live`, `partial`, `filled`, `cancelled`, `failed`, …). Read `final`
            and `success` rather than matching on this.
          example: matched
        venueOrderId:
          type:
            - string
            - 'null'
        venueStatus:
          type:
            - string
            - 'null'
          description: The venue's first answer.
        filledSize:
          type:
            - string
            - 'null'
          description: Shares filled; `null` when unknown.
          example: '7.140348'
        filledNotional:
          type:
            - string
            - 'null'
          description: Collateral spent or received, before venue fees.
          example: '4.069998'
        avgPrice:
          type:
            - string
            - 'null'
          example: '0.57'
        final:
          type: boolean
          description: Matching is finished.
        success:
          type: boolean
          description: '`false` when the order did nothing, failed, or is not confirmed yet.'
        message:
          type:
            - string
            - 'null'
          description: >-
            Set when `success` is false:

            - `No fill: the venue matched none of this order`

            - `The order failed at the venue; any fills shown were reverted`

            - `The venue rejected the order`

            - `Outcome not confirmed yet; check this wallet's orders before
            placing it again`
        venue:
          $ref: '#/components/schemas/WalletVenue'
        market:
          type: string
          description: '`venue:market_id`.'
    WalletCancelResult:
      type: object
      description: >-
        `result` of a `cancel` action. If nothing was confirmed and a venue may
        have acted, the action fails with `CANCEL_OUTCOME_UNKNOWN` and keeps
        this result.
      required:
        - cancelled
        - failed
        - venueDetail
      properties:
        cancelled:
          type: array
          items:
            type: string
          description: Order ids cancelled.
        alreadyClosed:
          type: array
          items:
            type: string
          description: By id — orders already filled, cancelled or expired.
        failed:
          description: By id — the failures; with `all` — the number of failures.
          oneOf:
            - type: array
              items:
                $ref: '#/components/schemas/WalletCancelFailure'
            - type: integer
        venueDetail:
          type: object
          description: >-
            Per venue: `{cancelled, failed}` counts for `all`, or `{error}` when
            the venue could not be reached (`{error, code:
            "CANCEL_OUTCOME_UNKNOWN"}` when it may have cancelled). Empty when
            every venue answered on a by-id cancel.
          additionalProperties:
            type: object
            properties:
              cancelled:
                type: integer
              failed:
                type: integer
              error:
                type: string
              code:
                type: string
      example:
        cancelled:
          - 3f2b8c1e-5d4a-4e6f-9b7c-1a2d3e4f5a6b
        alreadyClosed: []
        failed:
          - orderId: 9c8d7e6f-5a4b-4c3d-8e2f-1a0b9c8d7e6f
            reason: order not found
        venueDetail: {}
    WalletLoginResult:
      type: object
      description: '`result` of a `login` action. Send it as `Authorization: SIWE <token>`.'
      required:
        - token
        - expiresAt
      properties:
        token:
          type: string
          description: Opaque sign-in token (at most 4096 bytes).
        expiresAt:
          type: string
          format: date-time
          description: 24 hours after issue.
    WalletErrorCode:
      type: string
      description: >-
        Machine-readable reason on a `failed` step; the key is omitted when the
        failure has no code. Codes may be added; treat an unknown code as a
        failure whose order was not placed.


        | Code | Meaning | Order placed? |

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

        | `NO_MATCH` | An immediate order (FOK/FAK/IOC) found nothing to match.
        | No |

        | `VENUE_REJECTED` | The venue refused the order. | No |

        | `ORDER_OUTCOME_UNKNOWN` | The submission's outcome is unknown. Read
        the wallet's orders before placing again. | Maybe |

        | `CANCEL_OUTCOME_UNKNOWN` | Some venue may have cancelled. Read the
        wallet's orders. | Maybe |

        | `SIGNATURE_EXPIRED` | The signing window closed before a signature was
        accepted. Nothing was sent. | No |

        | `CLIENT_ORDER_ID_CONFLICT` | The `clientOrderId` names an order with
        different terms. | No |

        | `HYPERLIQUID_AGENT_MISSING` | Hyperliquid no longer lists this
        wallet's trading approval. Run `setup` again. | No |
      enum:
        - NO_MATCH
        - VENUE_REJECTED
        - ORDER_OUTCOME_UNKNOWN
        - CANCEL_OUTCOME_UNKNOWN
        - SIGNATURE_EXPIRED
        - CLIENT_ORDER_ID_CONFLICT
        - HYPERLIQUID_AGENT_MISSING
    WalletSetupVenueResult:
      type: object
      description: One venue's setup outcome.
      required:
        - ready
      properties:
        ready:
          type: boolean
        tradingWallet:
          $ref: '#/components/schemas/WalletAddress'
        transactionHash:
          type:
            - string
            - 'null'
          description: >-
            Polymarket — the approval transaction, or `null` when none was
            needed.
        sessionExpiresAt:
          type: string
          format: date-time
          description: Predict.fun — when the venue session ends.
        next:
          type: string
          enum:
            - fund
            - blocked
          description: >-
            Why a venue that finished setup is not ready: `fund` (deposit, or
            BNB for gas) or `blocked`.
        venueDetail:
          $ref: '#/components/schemas/WalletVenueDetail'
        error:
          type: string
          description: This venue failed; the others may still have succeeded.
    WalletCancelFailure:
      type: object
      required:
        - orderId
        - reason
      properties:
        orderId:
          type: string
        reason:
          type: string
          description: >-
            The venue's reason, `cancel failed; retry`, `order not found` (also
            for ids that are not this wallet's), `venue unavailable; retry`, or
            an outcome-unknown message.
        code:
          type: string
          description: '`CANCEL_OUTCOME_UNKNOWN` when the venue may have cancelled.'
    WalletAddress:
      type: string
      description: EVM address, `0x` + 40 hex.
      pattern: ^0x[0-9a-fA-F]{40}$
      example: '0x8ba1f109551bd432803012645ac136ddd64dba72'
    WalletVenueDetail:
      type: object
      description: Venue-specific detail. Keys appear only where they apply.
      properties:
        chainId:
          type: string
          description: Chain the venue settles on (hex).
          example: '0x89'
        gasBalance:
          type:
            - string
            - 'null'
          description: Predict.fun — BNB balance for gas, whole units.
        missingApprovals:
          type: integer
          description: Predict.fun — approvals still to send.
        sessionExpiresAt:
          type:
            - string
            - 'null'
          format: date-time
          description: Predict.fun — when the venue session ends.
        network:
          type: string
          description: Hyperliquid — `Mainnet` or `Testnet`.
        transferFromPerps:
          type: object
          description: >-
            Hyperliquid — USDC in perps the next order can move to spot (with an
            extra prompt).
          properties:
            available:
              type: string
              example: '12.5'
            note:
              type: string
        code:
          type: string
          description: >-
            Hyperliquid — `HYPERLIQUID_AGENT_MISSING` when the trading approval
            must be renewed by `setup`.
        reason:
          type: string
          description: Why the venue is not ready (fund, blocked, or approval renewal).
        blocked:
          type: boolean
          description: Hyperliquid — this account cannot be enrolled.
        accountMode:
          type: string
          description: Hyperliquid — the account mode that blocks enrollment.
        approvals:
          type: integer
          description: Setup result, Predict.fun — approvals the wallet needs gas for.
        gasWei:
          type: string
          description: Setup result, Predict.fun — estimated BNB gas needed, in wei.
      additionalProperties: true
  responses:
    WalletTenantUnauthorized:
      description: >-
        `send X-Kairos-Partner-Id or your API key (X-Client-Id, X-Api-Key,
        X-Api-Secret)` — no partner id and no API key (a delegation header never
        qualifies); `invalid API key`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/WalletApiError'
          example:
            error: >-
              send X-Kairos-Partner-Id or your API key (X-Client-Id, X-Api-Key,
              X-Api-Secret)
    WalletTenantForbidden:
      description: >-
        `unknown partner id` (unknown, or the Wallet API is not enabled for it);
        `this partner id is used with its API key; send the key instead of
        X-Kairos-Partner-Id`; `this API key lacks the trade:execute scope` (an
        API key must carry `trade:execute` to act as the tenant — a
        `trade:read`-only key is refused, even on reads); `the wallet API is not
        enabled for this account`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/WalletApiError'
          example:
            error: unknown partner id
    WalletPayloadTooLarge:
      description: >-
        Plain text (`Failed to buffer the request body: length limit exceeded`)
        when the body is over the limit: 16 KiB for fee settlements, 64 KiB for
        trade plans and on-chain intents, the server-wide 2 MiB for actions.
        Above 64 KiB the answer may instead be `{"error": "request body too
        large"}`.
      content:
        text/plain:
          schema:
            $ref: '#/components/schemas/WalletPlainTextError'
        application/json:
          schema:
            $ref: '#/components/schemas/WalletApiError'
    WalletUnsupportedMediaType:
      description: 'Plain text — the request has no `Content-Type: application/json` header.'
      content:
        text/plain:
          schema:
            $ref: '#/components/schemas/WalletPlainTextError'
    WalletUnprocessable:
      description: >-
        Plain text — the body is valid JSON of the wrong shape (a missing or
        unknown field, or a wrong type).
      content:
        text/plain:
          schema:
            $ref: '#/components/schemas/WalletPlainTextError'
    WalletRateLimited:
      description: >-
        `rate limit exceeded for this endpoint; retry later`. The default limit
        is 120 requests per minute per client IP per path (1000 when
        `X-Client-Id` is sent), over a sliding 60 s window; `GET` and `POST` on
        one path share it. No `Retry-After` header is sent.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/WalletApiError'
          example:
            error: rate limit exceeded for this endpoint; retry later
    WalletInternalError:
      description: '`internal error`.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/WalletApiError'
          example:
            error: internal error
    WalletVenueUnavailable:
      description: >-
        A venue did not answer cleanly, e.g. `Hyperliquid is unavailable; retry
        shortly`, `Predict.fun is unavailable; retry shortly`. Retry.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/WalletApiError'
    WalletServiceUnavailable:
      description: >-
        `partner registry unavailable; retry shortly`; `rate limiter
        unavailable` (the rate limiter fails closed); `wallet sign-in is not
        configured on this node`; `<venue> is not available right now`. Retry
        later.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/WalletApiError'
    WalletGatewayTimeout:
      description: >-
        `… did not answer in time; GET /v3/actions/{id} before retrying`. The
        request may have taken effect: read the state before repeating it.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/WalletApiError'
  securitySchemes:
    walletPartnerId:
      type: apiKey
      in: header
      name: X-Kairos-Partner-Id
      description: >-
        Wallet API partner id, issued by Kairos together with the partner's base
        URL. Identifies the partner (tenant) on every `/v3` call; sent instead
        of an API key. Letters, digits and `._:-`, at most 64 characters,
        case-insensitive. A partner id issued for an individual account cannot
        be sent this way — that account sends its API key triple instead.
    apiKeyClientId:
      type: apiKey
      in: header
      name: X-Client-Id
      description: >-
        Credential client id (`kairos_ck_...`). Must be sent together with
        X-Api-Key and X-Api-Secret.
    apiKeyKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: 64-char hex API key.
    apiKeySecret:
      type: apiKey
      in: header
      name: X-Api-Secret
      description: 64-char hex API secret.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.