Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Python SDK

Hosted API client for InterAI Risk Oracle. It uses Certifi's portable CA bundle by default and also accepts a custom ssl_context in the constructor.

Package version: interai-risk-oracle==0.1.4b0.

pip install interai-risk-oracle==0.1.4b0

Builder workflow

The client can onboard a builder, retain the returned API key, inspect account state, quote usage, and manage a prepaid top-up without hand-building HTTP requests:

from interai_risk_oracle import InterAIRiskOracleClient

client = InterAIRiskOracleClient(
    base_url="https://ai-risk-oracle.fly.dev",
)

onboarding = client.onboard(name="my-agent")
account = client.me()
quote = client.quote(mode="fast")
topup = client.create_topup("0.10")

onboard() stores the returned API key on the client when one is issued. You can also set a key explicitly with set_api_key().

Top-up helpers cover create_topup(), topup_status(), and confirm_topup(). Account helpers include me(), ledger(), and usage(). HTTP failures raise InterAIError (also exported as OracleHttpError) with status, structured API code, headers, body, and parsed x402 payment requirements when present.

Pre-execution verification

import os

from interai_risk_oracle import InterAIRiskOracleClient

client = InterAIRiskOracleClient(
    base_url="https://ai-risk-oracle.fly.dev",
    api_key=os.environ["INTERAI_API_KEY"],
)

decision = client.verify({
    "use_case": "agent-before-tool-execution",
    "action": {
        "schema": "interai-canonical-action/v1",
        "tool_id": "notifications.send_account_notice",
        "type": "email_send",
        "operation": "send_account_notice",
        "arguments": {"account_id": "account_123"},
        "external_side_effect": True,
        "irreversible": False,
    },
    "execution_context": {
        "schema": "interai-host-execution-context/v1",
        "workspace_id": "workspace_123",
        "environment": "production",
    },
    "context": {
        "agent_id": "agent_123",
        "environment": "production",
        "user_confirmation": False,
    },
    "policy": {
        "require_trust_receipt": True,
        "require_human_review_above": 0.75,
    },
}, idempotency_key="stable-business-operation-id")

If the idempotency key is omitted, the client creates a UUID for the call. Use a stable business-operation key when retrying the same action. verify_batch() provides the corresponding bounded batch surface. Configure request timeouts with timeout_seconds globally or per verification call.

Receipt lookup and signature-verification helpers remain available through get_trust_receipt(), get_trust_receipt_reference(), trust_receipts(), trust_reputation(), and verify_trust_receipt_signature().

Metadata

Release files for interai-risk-oracle 0.1.4b0

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

Source distribution (sdist)

Source distribution for interai-risk-oracle 0.1.4b0
File Size Uploaded
interai_risk_oracle-0.1.4b0.tar.gz 5.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for interai-risk-oracle 0.1.4b0
File Interpreter ABI Platform
interai_risk_oracle-0.1.4b0-py3-none-any.whl Python 3 none any Details

Total release size: 11.4 kB

Release files / interai_risk_oracle-0.1.4b0.tar.gz

Download URL interai_risk_oracle-0.1.4b0.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6b296d4f1a3f8643ee9862f0f31a40693e0e359c747cd2fcc755bd385ab7e8e1
BLAKE2b-256 checksum
How to use checksums
dc02131680c084a8b2856c3f65730e1c4e237b7bb6ab4efa75fbd5f54f20952b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.

Transparency log

Release files / interai_risk_oracle-0.1.4b0-py3-none-any.whl

Download URL interai_risk_oracle-0.1.4b0-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6847ceaefb1fd4a8b3284f0fe54d0dc8747595d27193661f10f3cf4d0c28023e
BLAKE2b-256 checksum
How to use checksums
55f667b2a3a13f4a835d3b08fa19eb307efb9923b1fedac7812583dbb10fcd8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.

Transparency log
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