Skip to main content

Official Python SDK for the OPUS workflow automation platform

Project description

opus-aaico

Official Python SDK for the OPUS workflow automation platform.

Features:

  • Full coverage of all OPUS API endpoints (64 endpoints)
  • Sync and async clients
  • Type-safe with Pydantic models
  • Automatic retry with exponential backoff
  • High-level workflows.run() orchestrator

Installation

pip install opus-aaico

Quick Start

from opus_aaico import OpusClient

client = OpusClient(api_key="your-api-key")

# Run a workflow end-to-end (initiate -> execute -> poll -> results)
result = client.workflows.run(
    workflow_id="wf-123",
    payload={"query": {"value": "Analyze this", "type": "str"}},
)
print(result.outputs)

Authentication

# Pass directly
client = OpusClient(api_key="sk-...")

# Or set environment variables
# OPUS_API_KEY=sk-...
# OPUS_WORKSPACE_ID=ws-...  (optional)
# OPUS_BASE_URL=https://custom.opus.com  (optional)
client = OpusClient()

Resources

Resource Methods Description
client.workflows get, list, list_public, generate, run, share, send_email... Workflow management + orchestration
client.jobs initiate, execute, get_status, get_results, poll, search... Job lifecycle management
client.files upload, download, search, generate, multipart_upload... File operations
client.reviews initiate, list, get, pick, submit_result, submit_output... Human review management
client.api_keys create, list, rotate, revoke, delete... API key management
client.credits get_balance, get_usage, record_usage... Credit tracking
client.policies upload, list, get, get_summary, set_active... Policy management
client.users list, list_projects, get_projects User & project lookups

Async Usage

from opus_aaico import AsyncOpusClient

async with AsyncOpusClient(api_key="sk-...") as client:
    result = await client.workflows.run("wf-123", payload={...})

Error Handling

from opus_aaico import OpusClient, NotFoundError, RateLimitError, OpusError

try:
    result = client.workflows.run("wf-123", payload={...})
except NotFoundError:
    print("Workflow not found")
except RateLimitError as e:
    print(f"Rate limited, retry after {e.retry_after}s")
except OpusError as e:
    print(f"API error: {e.message}")

Configuration

client = OpusClient(
    api_key="sk-...",
    workspace_id="ws-...",
    base_url="https://operator.opus.com",
    timeout=30.0,
    max_retries=3,
)

Requirements

  • Python 3.9+
  • httpx
  • pydantic v2

License

MIT

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

opus_aaico-0.1.0.tar.gz (27.6 kB view details)

Uploaded Source

Built Distribution

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

opus_aaico-0.1.0-py3-none-any.whl (29.6 kB view details)

Uploaded Python 3

File details

Details for the file opus_aaico-0.1.0.tar.gz.

File metadata

  • Download URL: opus_aaico-0.1.0.tar.gz
  • Upload date:
  • Size: 27.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for opus_aaico-0.1.0.tar.gz
Algorithm Hash digest
SHA256 625ab2816284252ade69b0d4fea7825051340b9a6cd44d91fccc8bd4599cf776
MD5 e350db288c43a7a55a710f7654f2e677
BLAKE2b-256 b0367c80e17cadaec1afee896ad8bfda67910ce0c5108ef56b11d758c7cbd943

See more details on using hashes here.

File details

Details for the file opus_aaico-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: opus_aaico-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 29.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for opus_aaico-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 429b11cd8f6eb1074f4424b6d3f43a34e1904e4657455831e5cedde92777314b
MD5 258f8d4b211e71824bf8820fe8131314
BLAKE2b-256 0a649362cf9a9fc9817ec38261eaa6bf13d1ecd314586c07f74cd0244e5794aa

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