Foresea Model Providers API

The Model Providers API from Foresea — 3 operation(s) for model providers.

GitHub OpenAPI

Operations 4

GET /api/user/model-providers List safe BYO model provider connection statuses #
PUT /api/user/model-providers/{provider_id} Encrypt and save credentials for one AI model provider #
DELETE /api/user/model-providers/{provider_id} Delete encrypted credentials for one AI model provider #
POST /api/user/model-providers/{provider_id}/test Live-test credentials against the provider API #

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-model-providers-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-model-providers-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Foresea Intelligence Model Providers 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: Model Providers
paths:
  /api/user/model-providers:
    get:
      tags:
      - Model Providers
      summary: List safe BYO model provider connection statuses
      description: Return configured model provider statuses without leaking secret API keys.
      operationId: list_user_model_providers_api_user_model_providers_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserModelProvidersResponse'
  /api/user/model-providers/{provider_id}:
    put:
      tags:
      - Model Providers
      summary: Encrypt and save credentials for one AI model provider
      description: Validate and store one model provider connection with server-side envelope encryption.
      operationId: save_user_model_provider_api_user_model_providers__provider_id__put
      parameters:
      - name: provider_id
        in: path
        required: true
        schema:
          type: string
          title: Provider Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SaveUserModelProviderRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserModelProviderStatus'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Model Providers
      summary: Delete encrypted credentials for one AI model provider
      description: Delete encrypted credentials for the specified provider.
      operationId: delete_user_model_provider_api_user_model_providers__provider_id__delete
      parameters:
      - name: provider_id
        in: path
        required: true
        schema:
          type: string
          title: Provider Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserModelProviderStatus'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/user/model-providers/{provider_id}/test:
    post:
      tags:
      - Model Providers
      summary: Live-test credentials against the provider API
      description: Send a minimal test request to verify API key validity and measure response latency.
      operationId: test_user_model_provider_api_user_model_providers__provider_id__test_post
      parameters:
      - name: provider_id
        in: path
        required: true
        schema:
          type: string
          title: Provider Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TestUserModelProviderRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestUserModelProviderResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    TestUserModelProviderRequest:
      properties:
        api_key:
          anyOf:
          - type: string
            maxLength: 1000
          - type: 'null'
          title: Api Key
        model_name:
          anyOf:
          - type: string
            maxLength: 200
          - type: 'null'
          title: Model Name
        custom_base_url:
          anyOf:
          - type: string
            maxLength: 500
          - type: 'null'
          title: Custom Base Url
      type: object
      title: TestUserModelProviderRequest
    UserModelProvidersResponse:
      properties:
        providers:
          items:
            $ref: '#/components/schemas/UserModelProviderStatus'
          type: array
          title: Providers
        encryption_configured:
          type: boolean
          title: Encryption Configured
          default: true
      type: object
      required:
      - providers
      title: UserModelProvidersResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TestUserModelProviderResponse:
      properties:
        ok:
          type: boolean
          title: Ok
        latency_ms:
          anyOf:
          - type: number
          - type: 'null'
          title: Latency Ms
        message:
          anyOf:
          - type: string
          - type: 'null'
          title: Message
        model:
          anyOf:
          - type: string
          - type: 'null'
          title: Model
        sample_response:
          anyOf:
          - type: string
          - type: 'null'
          title: Sample Response
        error:
          anyOf:
          - type: string
          - type: 'null'
          title: Error
      type: object
      required:
      - ok
      title: TestUserModelProviderResponse
    UserModelProviderStatus:
      properties:
        provider_id:
          type: string
          title: Provider Id
        name:
          type: string
          title: Name
        category:
          type: string
          title: Category
        description:
          type: string
          title: Description
        connected:
          type: boolean
          title: Connected
        default_model:
          type: string
          title: Default Model
        popular_models:
          items:
            type: string
          type: array
          title: Popular Models
        default_base_url:
          type: string
          title: Default Base Url
        custom_base_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Custom Base Url
        docs_url:
          type: string
          title: Docs Url
          default: ''
        updated_at:
          anyOf:
          - type: string
          - type: 'null'
          title: Updated At
        key_prefix:
          type: string
          title: Key Prefix
          default: ''
        masked_key:
          anyOf:
          - type: string
          - type: 'null'
          title: Masked Key
      type: object
      required:
      - provider_id
      - name
      - category
      - description
      - connected
      - default_model
      - popular_models
      - default_base_url
      title: UserModelProviderStatus
    SaveUserModelProviderRequest:
      properties:
        api_key:
          anyOf:
          - type: string
            maxLength: 1000
          - type: 'null'
          title: Api Key
        default_model:
          anyOf:
          - type: string
            maxLength: 200
          - type: 'null'
          title: Default Model
        custom_base_url:
          anyOf:
          - type: string
            maxLength: 500
          - type: 'null'
          title: Custom Base Url
      type: object
      title: SaveUserModelProviderRequest
    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