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:
sync— blocking, returns the parsed model (orNone)sync_detailed— blocking, returns aResponsewithstatus_code, headers and the parsed bodyasyncio— async variant ofsyncasyncio_detailed— async variant ofsync_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
openapi-python-client. Regenerate after any contract change, and 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file coinrithm_sdk-1.6.1.tar.gz.
File metadata
- Download URL: coinrithm_sdk-1.6.1.tar.gz
- Upload date:
- Size: 133.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24e273da48ede1eee1e0c870976e6ecf5eec83bfeba52a94a5a158d3eac5dc27
|
|
| MD5 |
b2d33adb864207bd1d199c17d6bae38e
|
|
| BLAKE2b-256 |
ce7599f1e8bc0ec4541ae7079e730c3309ff29d8ddb13dba01397d5378ec4122
|
File details
Details for the file coinrithm_sdk-1.6.1-py3-none-any.whl.
File metadata
- Download URL: coinrithm_sdk-1.6.1-py3-none-any.whl
- Upload date:
- Size: 345.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa24dc46cf8152be9c966dd05526dfb6c9309bdd871230e9275007a03afd1044
|
|
| MD5 |
f04be9418345eb46144f3b2dbd8722da
|
|
| BLAKE2b-256 |
5e5811c0d8a5600c282150e7f3055ac55a23ad8befb91c33f51da7dbe110be62
|