Official Python SDK for the 01credit platform
Project description
credit01 — 01credit Python SDK
Official Python SDK for the 01credit platform. No dependencies — stdlib only.
Install
pip install credit01
Quickstart
from credit01 import CreditClient
client = CreditClient(api_key="01l_live_xxx")
# On startup
client.set_status("active")
# Before every action your agent takes
result = client.check(action="swap $500 USDC to ETH", amount=500)
if result["result"] == "DENY":
client.log("warn", "Action blocked", action="swap $500 USDC to ETH")
elif result["result"] == "STEP_UP":
client.log("warn", "Action flagged for review", checkId=result["checkId"])
else:
# execute the action
client.report_transaction(type="trade", amount=500, token="ETH", side="BUY", pnl=12.5)
client.update_metrics(tradingPnL=12.5, txCount=1, volumeUSD=500)
client.log("info", "Trade executed")
# On shutdown
client.set_status("stopped")
Methods
| Method | Description |
|---|---|
check(**context) |
Risk check before any action. Returns result, tier, reasoning, checkId, authorityReceipt |
resolve(log_id, resolved_by) |
Resolve a STEP_UP decision ("approved" or "denied") |
set_status(status) |
Update agent status: active / paused / stopped / error |
is_kill_switch_active() |
Returns True if operator has killed the agent |
update_metrics(**kwargs) |
Report metrics: tradingPnL, volumeUSD, txCount, etc. |
report_transaction(**kwargs) |
Log an executed transaction |
log(level, message, **kwargs) |
Send a log entry to the dashboard |
get_config() |
Fetch full agent config |
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
credit01-0.1.0.tar.gz
(3.2 kB
view details)
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 credit01-0.1.0.tar.gz.
File metadata
- Download URL: credit01-0.1.0.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8576649f7c119ae8c0a33a6baa1e1c16777c371f2725fba90f89ea533ee86736
|
|
| MD5 |
c962143393b9f5154af51a42c9ed6999
|
|
| BLAKE2b-256 |
27644f77a82ac3b1d4971f850449dc5c815cd2e7740b65215947f9cf62bec781
|
File details
Details for the file credit01-0.1.0-py3-none-any.whl.
File metadata
- Download URL: credit01-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5f6aa14875864f3c3326b2012200271854c78e5176feae967886f601d1a4793
|
|
| MD5 |
326aac8a1c85a8cdd7ac5dbe1479788a
|
|
| BLAKE2b-256 |
3981629967c5579fcff5f3a47758059dfc686fe431dbe9d7b599ab553f1312ce
|