Skip to main content

Official Python SDK for the 01credit platform — risk control, credit, and lifecycle management for AI agents performing on-chain actions

Project description

credit01 — 01credit Python SDK

Official Python SDK for 01credit.

Install

pip install credit01

Quickstart

from credit01 import CreditClient

client = CreditClient(api_key="01l_live_xxx")
config = client.get_config()

decision = client.check(action="swap", amountUSD=250, venue="Uniswap V3")

if decision["result"] == "REVIEW":
    resolution = client.wait_for_approval(decision["checkId"])
    if resolution != "approved":
        raise SystemExit("Operator denied the action")

Credit Flow

approval = client.request_credit(amount=30, chain_id=11155111)
if approval["approved"]:
    draw = client.draw_credit(amount=30, chain_id=approval["chainId"])
    outstanding = client.get_outstanding(draw["loanId"])
    client.repay_credit(draw["loanId"], "0xrepay...")

Methods

  • get_config()
  • is_kill_switch_active()
  • set_status(status)
  • update_metrics(**kwargs)
  • report_transaction(**kwargs)
  • log(level, message, **kwargs)
  • log_batch(entries)
  • request_credit(amount, chain_id=None)
  • draw_credit(amount, chain_id=None)
  • get_outstanding(loan_id)
  • repay_credit(loan_id, tx_hash)
  • check(**context)
  • resolve(log_id, resolved_by)
  • get_approval_status(check_id)
  • wait_for_approval(check_id, timeout=300, interval=5)

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.6.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

credit01-0.1.6-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file credit01-0.1.6.tar.gz.

File metadata

  • Download URL: credit01-0.1.6.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for credit01-0.1.6.tar.gz
Algorithm Hash digest
SHA256 bd41f510977e0d34e57fd6f6cbb2e1434a662f10b9dd7e3bff427c894ef48bd5
MD5 fde26bbc858059eed30b3b78ecd558cb
BLAKE2b-256 d70b979fc05ff9d7d9ab412587f672e094ddc938c5d1959db6ed3961db04f5b3

See more details on using hashes here.

File details

Details for the file credit01-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: credit01-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for credit01-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 ab1a35a32706a871b8344aa35a83d2cc36ca676504b1366bb1d13d9d4cda13db
MD5 e7909a2ae7f7bc920c627a6a8c1e72c3
BLAKE2b-256 7843002f4bf65e40d74a188ef9720ae57acb695342a053830669724bfdc40516

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 Pingdom Monitoring Sentry Error logging StatusPage Status page