Foresea Autonomous Twin API

The Autonomous Twin API from Foresea — 13 operation(s) for autonomous twin.

GitHub OpenAPI

Operations 14

POST /twin/mandates Create Route #
GET /twin/mandates/{mandate_id} Read Route #
POST /twin/mandates/{mandate_id}/revisions Revise Route #
POST /twin/mandates/{mandate_id}/approve Approve Route #
POST /twin/mandates/{mandate_id}/revoke Revoke Route #
GET /twin/status Status Route #
GET /twin/portfolio Portfolio Route #
GET /twin/decisions Decisions Route #
GET /twin/commands Commands Route #
GET /twin/readiness Readiness Route #
POST /twin/pause Pause Route #
POST /twin/commands/{command_id}/cancel Cancel Route #
GET /twin/accounts/{scope_id}/opening Review Route #
POST /twin/accounts/{scope_id}/opening Confirm Route #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/foresea-ink:foresea-ink-autonomous-twin-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

foresea-ink-autonomous-twin-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Foresea Intelligence Autonomous Twin API
  description: '## Overview


    The **Foresea Intelligence API** turns market questions, linked evidence, and

    prediction-market prices into probabilistic forecasts that can sit behind

    trading dashboards, alerting systems, and research workflows. It supports binary, multiple-choice, numeric, and date forecasts. Each response

    includes a structured **rationale**, typed forecast fields, optional evidence

    sources fetched from live news, and optional market-edge analysis when you pass

    a market-implied probability. ---


    ## Quick start


    ```bash

    curl -X POST https://foresea.ink/predict \

    -H "Content-Type: application/json" \

    -d ''{

    "question": "Will the Fed cut rates before September 30, 2026?",

    "question_type": "binary",

    "market_platform": "Polymarket",

    "market_probability": 0.54,

    "variant": "variant0_neutral_baseline"

    }''

    ```


    ---


    ## Question types


    Use `question_type` when your client already knows the shape of the question. If omitted, the model will try to infer it. | Type | Response shape |

    |---|---|

    | `binary` | `predicted_answer` is `Yes`/`No`; `confidence` is 0–1 |

    | `multiple_choice` | `options` contains per-option probabilities; `predicted_answer` is the top option |

    | `numeric` | `range_forecast` contains `p10`, `p50`, `p90`, and optional `unit` |

    | `date` | `range_forecast` contains date percentiles |


    For multiple-choice forecasts, pass `options` when the answer set is known. ---


    ## Prediction-market context


    Pass `market_probability` when you know the current market-implied probability

    for the target outcome. For binary markets this defaults to the `Yes` side; set

    `market_outcome` to compare against `No` or a named multiple-choice outcome. Foresea returns `market_analysis` with model probability, market probability,

    percentage-point edge, and a stance (`model_above_market`, `model_below_market`,

    `in_line`, or `not_comparable`). ---


    ## Trading execution


    Foresea can preview and submit guarded orders for Kalshi and Polymarket:


    | Endpoint | Purpose |

    |---|---|

    | `GET /trading/accounts` | Return configured/not-configured server-account status without exposing secrets |

    | `POST /trading/accounts/check` | Validate caller-supplied own-account (BYO) credentials without storing them |

    | `POST /trading/preview` | Normalize and validate an order without placing it |

    | `POST /trading/orders` | Submit a live order after explicit confirmation |


    Live trading is disabled unless `FORESEA_ENABLE_TRADING=true`. Every live order

    requires a signed-in user session, `execute=true`, and the exact confirmation

    phrase `PLACE REAL ORDER`. Market/IOC/FOK-style orders are separately blocked

    unless `FORESEA_ALLOW_MARKET_ORDERS=true`. Exchange credentials come from a shared server account (environment variables /

    Secret Manager mounts) or an authenticated user''s **encrypted account

    connection**. The connection endpoint accepts a user''s credentials once, validates

    them with a unique data-encryption key wrapped by Cloud KMS, and never returns

    them to the browser. Inline `venue_credentials` are rejected on public preview

    and order calls; encrypted own-account trading remains gated by

    `FORESEA_ENABLE_BYO_TRADING=true` (independent of `FORESEA_ENABLE_TRADING`). `/agent/analyze` may return a directional recommendation, but it never places an

    order. Use `/trading/preview` first, review the normalized order, then call

    `/trading/orders` only when you intend to submit a real order. ---


    ## Prompt variants


    The `variant` field controls how the LLM is prompted.'
  contact:
    name: Pareel Amre
    url: https://foresea.ink/
    email: pareel.amre@gmail.com
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  version: 1.0.0
tags:
- name: Autonomous Twin
paths:
  /twin/mandates:
    post:
      tags:
      - Autonomous Twin
      summary: Create Route
      operationId: create_route_twin_mandates_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MandateDraftRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /twin/mandates/{mandate_id}:
    get:
      tags:
      - Autonomous Twin
      summary: Read Route
      operationId: read_route_twin_mandates__mandate_id__get
      parameters:
      - name: mandate_id
        in: path
        required: true
        schema:
          type: string
          title: Mandate Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /twin/mandates/{mandate_id}/revisions:
    post:
      tags:
      - Autonomous Twin
      summary: Revise Route
      operationId: revise_route_twin_mandates__mandate_id__revisions_post
      parameters:
      - name: mandate_id
        in: path
        required: true
        schema:
          type: string
          title: Mandate Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MandateRevisionRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /twin/mandates/{mandate_id}/approve:
    post:
      tags:
      - Autonomous Twin
      summary: Approve Route
      operationId: approve_route_twin_mandates__mandate_id__approve_post
      parameters:
      - name: mandate_id
        in: path
        required: true
        schema:
          type: string
          title: Mandate Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MandateApprovalRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /twin/mandates/{mandate_id}/revoke:
    post:
      tags:
      - Autonomous Twin
      summary: Revoke Route
      operationId: revoke_route_twin_mandates__mandate_id__revoke_post
      parameters:
      - name: mandate_id
        in: path
        required: true
        schema:
          type: string
          title: Mandate Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MandateTransitionRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /twin/status:
    get:
      tags:
      - Autonomous Twin
      summary: Status Route
      operationId: status_route_twin_status_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
  /twin/portfolio:
    get:
      tags:
      - Autonomous Twin
      summary: Portfolio Route
      operationId: portfolio_route_twin_portfolio_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
  /twin/decisions:
    get:
      tags:
      - Autonomous Twin
      summary: Decisions Route
      operationId: decisions_route_twin_decisions_get
      parameters:
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          maximum: 100
          minimum: 1
          default: 25
          title: Limit
      - name: cursor
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            maxLength: 512
          - type: 'null'
          title: Cursor
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /twin/commands:
    get:
      tags:
      - Autonomous Twin
      summary: Commands Route
      operationId: commands_route_twin_commands_get
      parameters:
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          maximum: 100
          minimum: 1
          default: 25
          title: Limit
      - name: cursor
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            maxLength: 512
          - type: 'null'
          title: Cursor
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /twin/readiness:
    get:
      tags:
      - Autonomous Twin
      summary: Readiness Route
      operationId: readiness_route_twin_readiness_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
  /twin/pause:
    post:
      tags:
      - Autonomous Twin
      summary: Pause Route
      operationId: pause_route_twin_pause_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OperatorPauseRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /twin/commands/{command_id}/cancel:
    post:
      tags:
      - Autonomous Twin
      summary: Cancel Route
      operationId: cancel_route_twin_commands__command_id__cancel_post
      parameters:
      - name: command_id
        in: path
        required: true
        schema:
          type: string
          title: Command Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OperatorCancelRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /twin/accounts/{scope_id}/opening:
    get:
      tags:
      - Autonomous Twin
      summary: Review Route
      operationId: review_route_twin_accounts__scope_id__opening_get
      parameters:
      - name: scope_id
        in: path
        required: true
        schema:
          type: string
          minLength: 1
          maxLength: 256
          title: Scope Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
      - Autonomous Twin
      summary: Confirm Route
      operationId: confirm_route_twin_accounts__scope_id__opening_post
      parameters:
      - name: scope_id
        in: path
        required: true
        schema:
          type: string
          minLength: 1
          maxLength: 256
          title: Scope Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OpeningConfirmation'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    OpeningConfirmation:
      properties:
        review_hash:
          type: string
          pattern: ^[0-9a-f]{64}$
          title: Review Hash
        evidence_ref:
          type: string
          pattern: ^[0-9a-f]{64}$
          title: Evidence Ref
        confirmation:
          type: string
          const: REGISTER ACCOUNT OPENING
          title: Confirmation
      additionalProperties: false
      type: object
      required:
      - review_hash
      - evidence_ref
      - confirmation
      title: OpeningConfirmation
    OperatorCancelRequest:
      properties:
        idempotency_key:
          type: string
          maxLength: 128
          minLength: 8
          title: Idempotency Key
      additionalProperties: false
      type: object
      required:
      - idempotency_key
      title: OperatorCancelRequest
    MandateRevisionRequest:
      properties:
        client_request_id:
          type: string
          maxLength: 128
          minLength: 8
          title: Client Request Id
        account_scope_id:
          type: string
          maxLength: 256
          minLength: 1
          title: Account Scope Id
        strategy_version:
          type: string
          maxLength: 128
          minLength: 1
          title: Strategy Version
        expires_at:
          type: string
          format: date-time
          title: Expires At
        live:
          type: boolean
          title: Live
          default: false
        allowed_actions:
          items:
            type: string
          type: array
          title: Allowed Actions
          default:
          - BUY_YES
          - BUY_NO
        max_capital:
          type: string
          title: Max Capital
          default: '0'
        max_loss:
          type: string
          title: Max Loss
          default: '0'
        max_model_usd:
          type: string
          title: Max Model Usd
          default: '0'
        max_model_tokens:
          type: integer
          minimum: 0.0
          title: Max Model Tokens
          default: 0
        max_model_requests:
          type: integer
          minimum: 0.0
          title: Max Model Requests
          default: 0
      additionalProperties: false
      type: object
      required:
      - client_request_id
      - account_scope_id
      - strategy_version
      - expires_at
      title: MandateRevisionRequest
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    MandateTransitionRequest:
      properties:
        idempotency_key:
          type: string
          maxLength: 128
          minLength: 8
          title: Idempotency Key
      additionalProperties: false
      type: object
      required:
      - idempotency_key
      title: MandateTransitionRequest
    OperatorPauseRequest:
      properties:
        paused:
          type: boolean
          title: Paused
        reason:
          type: string
          maxLength: 128
          minLength: 1
          pattern: ^[A-Za-z0-9][A-Za-z0-9._:@-]*$
          title: Reason
        idempotency_key:
          type: string
          maxLength: 128
          minLength: 8
          title: Idempotency Key
      additionalProperties: false
      type: object
      required:
      - paused
      - reason
      - idempotency_key
      title: OperatorPauseRequest
    MandateApprovalRequest:
      properties:
        expected_hash:
          type: string
          maxLength: 64
          minLength: 64
          title: Expected Hash
        idempotency_key:
          type: string
          maxLength: 128
          minLength: 8
          title: Idempotency Key
      additionalProperties: false
      type: object
      required:
      - expected_hash
      - idempotency_key
      title: MandateApprovalRequest
    MandateDraftRequest:
      properties:
        client_request_id:
          type: string
          maxLength: 128
          minLength: 8
          title: Client Request Id
        account_scope_id:
          type: string
          maxLength: 256
          minLength: 1
          title: Account Scope Id
        strategy_version:
          type: string
          maxLength: 128
          minLength: 1
          title: Strategy Version
        expires_at:
          type: string
          format: date-time
          title: Expires At
        live:
          type: boolean
          title: Live
          default: false
        allowed_actions:
          items:
            type: string
          type: array
          title: Allowed Actions
          default:
          - BUY_YES
          - BUY_NO
        max_capital:
          type: string
          title: Max Capital
          default: '0'
        max_loss:
          type: string
          title: Max Loss
          default: '0'
        max_model_usd:
          type: string
          title: Max Model Usd
          default: '0'
        max_model_tokens:
          type: integer
          minimum: 0.0
          title: Max Model Tokens
          default: 0
        max_model_requests:
          type: integer
          minimum: 0.0
          title: Max Model Requests
          default: 0
      additionalProperties: false
      type: object
      required:
      - client_request_id
      - account_scope_id
      - strategy_version
      - expires_at
      title: MandateDraftRequest
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError