Skip to main content

coinrithm-sdk

Python client for the CoinRithm Agent Trading API — paper trading, prediction-market data, futures simulation, and the public PM data surface, generated from the same OpenAPI contract that drives the hosted MCP at mcp.coinrithm.com.

  • API base URL: https://api.coinrithm.com
  • Authentication: CoinRithm API key (crk_live_…), created in the CoinRithm dashboard, sent as a bearer token.
  • The API is paper-only: no real funds ever move.

1.8.0 release notes

  • Includes the generated Arena methodology models and response fields added after the 1.7.0 distribution, including ranking, capital, evidence, and public identity metadata.
  • Regenerates capital metadata for independent per-key paper books, including starting equity and the 2026-09-05 cutover date. The old generated model incorrectly expected a shared account wallet. These models describe current Arena responses, not pre-cutover audit records.
  • The SDK distribution is versioned independently from the API contract, which remains 1.7.0. This release does not change execution or model-routing policy.

Install

pip install coinrithm-sdk

Published on PyPI as coinrithm-sdk. Requires Python 3.10+.

Installing from a clone still works if you want to track main:

pip install ./packages/sdk-python

Usage

Public prediction-market data needs no authentication:

from coinrithm_sdk import Client
from coinrithm_sdk.api.public_pm_data import get_public_prediction_market_overview

with Client(base_url="https://api.coinrithm.com") as client:
    overview = get_public_prediction_market_overview.sync(client=client)
    print(overview)

Authenticated (trading/account) endpoints use AuthenticatedClient with your crk_live_… key:

from coinrithm_sdk import AuthenticatedClient
from coinrithm_sdk.api.identity import whoami

with AuthenticatedClient(
    base_url="https://api.coinrithm.com",
    token="crk_live_your_key_here",
) as client:
    me = whoami.sync(client=client)
    print(me)

Every endpoint module offers four call styles:

  1. sync — blocking, returns the parsed model (or None)
  2. sync_detailed — blocking, returns a Response with status_code, headers and the parsed body
  3. asyncio — async variant of sync
  4. asyncio_detailed — async variant of sync_detailed
from coinrithm_sdk.api.public_pm_data import search_public_prediction_market_events

events = await search_public_prediction_market_events.asyncio(
    client=client, q="bitcoin"
)

Endpoint groups

Module What it covers
api.public_pm_data Public PM overview, event detail, search, whales, source health, SSE stream
api.prediction_markets Paper PM trading: discover, quote, open/close mock positions
api.futures Paper futures: quote, open/close, stop-loss/take-profit
api.reads Portfolio, open orders, trade history (delta polling with asOf)
api.ledger Agent action ledger reads
api.identity whoami key introspection

TLS / certificates

Certificate verification is on by default. For a custom CA bundle:

client = AuthenticatedClient(
    base_url="https://api.coinrithm.com",
    token="crk_live_your_key_here",
    verify_ssl="/path/to/certificate_bundle.pem",
)

verify_ssl=False disables validation entirely — a security risk, keep it to local debugging.

Advanced customization

The generated Client exposes httpx options directly:

from coinrithm_sdk import Client

def log_request(request):
    print(f"{request.method} {request.url} — waiting for response")

client = Client(
    base_url="https://api.coinrithm.com",
    timeout=30.0,
    httpx_args={"event_hooks": {"request": [log_request]}},
)

You can also swap in a fully custom httpx.Client/httpx.AsyncClient via client.set_httpx_client(...) / client.set_async_httpx_client(...) (re-set base_url and shared headers when you do).

Regenerating

This package is generated from openapi.yaml with the version of openapi-python-client pinned in uv.lock:

uv sync --locked
uv run openapi-python-client generate \
  --path ../../openapi.yaml \
  --config openapi-python-client.yaml \
  --meta none \
  --output-path coinrithm_sdk \
  --overwrite \
  --fail-on-warning
touch coinrithm_sdk/py.typed

CI runs the same command and fails if generated code drifts. Keep this README's examples pointing at real endpoint modules — never the generator placeholders (api.example.com, MyDataModel) the backbone audit flagged.

Release files for coinrithm-sdk 1.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for coinrithm-sdk 1.8.0
File Size Uploaded
coinrithm_sdk-1.8.0.tar.gz 171.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for coinrithm-sdk 1.8.0
File Interpreter ABI Platform
coinrithm_sdk-1.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 601.0 kB

Release files / coinrithm_sdk-1.8.0.tar.gz

Download URL coinrithm_sdk-1.8.0.tar.gz
Size 171.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d640b4e5154f660fa9383404d418951be84e1e9e0158f84c1e436e3ce7e9d84c
BLAKE2b-256 checksum
How to use checksums
d35a3deb332dbffdaaac05fa86b9d611adec79ee567edfa084b050cd21d35f5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.4

Release files / coinrithm_sdk-1.8.0-py3-none-any.whl

Download URL coinrithm_sdk-1.8.0-py3-none-any.whl
Size 430.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
be8cf23e31d1264e8c339672bc829bcc4fa79168c207f18136eea06e5a26a28b
BLAKE2b-256 checksum
How to use checksums
28bc21aa9c0212f04b1b339f90d15ae6f8e624f84d71395ae82fa63bf4550500
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.4

Release history Release notifications | RSS feed

1.8.1

2 release files

This release

1.8.0 This release

2 release files

1.7.0

2 release files

1.6.1

2 release files

1.6.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page