Spec-drift reconciliation against the latest upstream OpenAPI (3.20.0) and AsyncAPI
specs (closes #443). Includes one breaking change: the Self-Clearing-Member
"Klear" API migrated from cookie-session login to Bearer-token auth. Everything
else is additive.
Breaking
- Klear (SCM) auth is now a Bearer token. Upstream removed
POST /log_inand
switched the Klear API toAuthorization: Bearer <admin_user_id>:<access_token>.
KlearClient/AsyncKlearClientnow requireadmin_user_idandaccess_token
at construction (or viafrom_env(), which readsKALSHI_KLEAR_ADMIN_USER_ID/
KALSHI_KLEAR_ACCESS_TOKEN). Removed: thelogin()method, the
is_authenticatedproperty, theclient.authresource, and theLogInRequest/
LogInResponsemodels.KlearAuthis now a Bearer-credential holder
(KlearAuth(admin_user_id, access_token)). Generate a token at
https://klearing.kalshi.com (the "Security" page).
Added
cfbenchmarks_valueWebSocket channel — stream CF Benchmarks reference index
values (e.g.BRTI) with trailing 60-second and final-minute quarter-hour
averages viaKalshiWebSocket.subscribe_cfbenchmarks_value(index_ids=[...]). New
modelsCFBenchmarksValueMessage/CFBenchmarksValuePayload/
CFBenchmarksAvgData/CFBenchmarksIndexListMessage/
CFBenchmarksIndexListPayload(exported fromkalshi.ws.models).AccountResource.upgrade()—POST /account/api_usage_level/upgradeto
request a permanent Advanced API usage-level grant.AccountApiLimits.grants— the per-exchange-lane usage-level grant list, plus
a newApiUsageLevelGrantmodel (exchange_instance/level/source/
expires_ts), exported fromkalshi.MarginAccountResource.api_limits()—GET /account/limits/perpsfor the
Perps API tier limits (reusesAccountApiLimits).- Perps market notional/leverage fields —
MarginMarketgains
leverage_estimatesandvolume/volume_24h/open_interestnotional-value
fields;MarginMarketCandlestickand thetickerWS payload gain notional-value
fields, all tracking the spec.
Changed
- Re-vendored
specs/openapi.yaml,specs/asyncapi.yaml,specs/perps_openapi.yaml,
specs/perps_asyncapi.yaml, andspecs/perps_scm_openapi.yaml; the subaccount
range documented in prose is now 1–63 (no validation change).