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.

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coinrithm_sdk-1.7.0.tar.gz (167.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

coinrithm_sdk-1.7.0-py3-none-any.whl (421.9 kB view details)

Uploaded Python 3

File details

Details for the file coinrithm_sdk-1.7.0.tar.gz.

File metadata

  • Download URL: coinrithm_sdk-1.7.0.tar.gz
  • Upload date:
  • Size: 167.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for coinrithm_sdk-1.7.0.tar.gz
Algorithm Hash digest
SHA256 f676095f64352adaf158616282b321c946839c6f6565506b2c1bb49479368a8d
MD5 f3da4146e2dd0ca579cfe01af90805d1
BLAKE2b-256 f1e6d76ca26eee37f59d04cd4e949355663e23623f47c36462b8b3e065b45c17

See more details on using hashes here.

File details

Details for the file coinrithm_sdk-1.7.0-py3-none-any.whl.

File metadata

  • Download URL: coinrithm_sdk-1.7.0-py3-none-any.whl
  • Upload date:
  • Size: 421.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for coinrithm_sdk-1.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 620caf14f70e68b7bfbb2781ba0953a220ba65adb54593db2ff6825bb913e413
MD5 35dbeeb5f2ec94cd2b115d2cd31ee54a
BLAKE2b-256 4e5252adc3c29e357190940c6b540bc7094a72a187c7e5c13c73c060d4c0215e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page