Skip to content

Spec drift: kalshi — canonical API host migrated to external-api.kalshi.com; elections.kalshi.com may be deprecated #778

@realfishsam

Description

@realfishsam

Exchange

kalshi

Drift Type

auth_change / changed_params

Severity

HIGH — production traffic may stop working if the legacy domain is eventually decommissioned

Their Docs

As of May 7, 2026, Kalshi's official API documentation lists new dedicated external API hostnames as the canonical endpoints:

  • Production REST: https://external-api.kalshi.com/trade-api/v2
  • Production WebSocket: wss://external-api-ws.kalshi.com/trade-api/ws/v2
  • Demo REST: https://external-api.demo.kalshi.co/trade-api/v2
  • Demo WebSocket: wss://external-api-ws.demo.kalshi.co/trade-api/ws/v2

The old elections.kalshi.com domain still works currently, but the documentation now directs all external integrations to use the external-api.* domains.

Source: https://docs.kalshi.com

Our Cached Spec

core/specs/kalshi/Kalshi.yaml uses the server template {env}.elections.kalshi.com/trade-api/v2.

core/src/exchanges/kalshi/config.ts hardcodes:

  • Production: https://api.elections.kalshi.com (env KALSHI_BASE_URL)
  • Demo: https://demo-api.kalshi.co (env KALSHI_DEMO_BASE_URL)
  • Production WS: wss://api.elections.kalshi.com/trade-api/ws/v2
  • Demo WS: wss://demo-api.kalshi.co/trade-api/ws/v2

Neither the spec nor the config references external-api.kalshi.com.

File: core/src/exchanges/kalshi/config.ts, core/specs/kalshi/Kalshi.yaml

callApi() References at Risk

All callApi() calls in fetcher.ts inherit the base URL from the spec/config. If the elections.kalshi.com domain is eventually decommissioned or starts rate-limiting legacy traffic, all calls will fail.

Hardcoded URL Bypasses

None — all calls go through callApi().

Impact

  • If Kalshi deprecates or rate-limits the elections.kalshi.com domain, all production API calls will fail
  • The spec's server template is stale relative to the documented canonical host
  • Config should be updated to default to external-api.kalshi.com with env-var override for the legacy domain

Found by automated spec drift audit

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions