Skip to main content

Documentation Index

Fetch the complete documentation index at: https://cobo.com/products/agentic-wallet/manual/llms.txt

Use this file to discover all available pages before exploring further.

Start with the language SDK quickstart first, then move to OpenAI Agents SDK once the pact-to-execution flow works without an agent loop.

Before you start

Complete the CLI quickstart first so your runtime already has a paired wallet, API key, and wallet UUID.

5-minute outcome

  1. Create Cobo-enabled OpenAI agent
  2. Submit a pact and wait for owner approval
  3. Execute success plus denial contract-call sequence
  4. Let agent adapt using denial context
  5. Track by request_id and verify with audit logs

Step 1: Install

pip install "cobo-agentic-wallet[openai]"

Step 2: Configure environment

export AGENT_WALLET_API_URL=https://api.agenticwallet.cobo.com
export AGENT_WALLET_API_KEY=your-api-key
export OPENAI_API_KEY=your-openai-api-key

Step 3: Run agent flow

openai_quickstart.py
import asyncio
import os

from agents import Runner

from cobo_agentic_wallet import WalletAPIClient
from cobo_agentic_wallet.integrations.openai import create_cobo_agent, create_cobo_agent_context

INCLUDE_TOOLS = [
    "submit_pact", "get_pact", "transfer_tokens",
    "estimate_transfer_fee", "get_transaction_record_by_request_id", "get_audit_logs",
]


async def main() -> None:
    _ = os.environ["OPENAI_API_KEY"]  # consumed implicitly by the OpenAI Agents runner
    wallet_id = os.environ["AGENT_WALLET_WALLET_ID"]
    destination = os.environ.get("CAW_DESTINATION", "0x1111111111111111111111111111111111111111")
    prompt = (
        f"Use wallet {wallet_id}. Submit a pact for a controlled transfer task and wait until "
        f"it is active. Using the newly created pact, transfer 0.001 SETH to {destination} on "
        f"SETH. Next, using the same pact, attempt 0.005 SETH. If denied, follow the denial "
        f"guidance and retry with a compliant amount. Track the result by request_id and "
        f"summarize what happened."
    )

    async with WalletAPIClient(
        base_url=os.environ["AGENT_WALLET_API_URL"],
        api_key=os.environ["AGENT_WALLET_API_KEY"],
    ) as client:
        agent = create_cobo_agent(client=client, model="gpt-4.1-mini", include_tools=INCLUDE_TOOLS)
        try:
            result = await Runner.run(
                agent, prompt, context=create_cobo_agent_context(), max_turns=20,
            )
            print(result.final_output)
        finally:
            toolkit = getattr(agent, "_caw_toolkit", None)
            if toolkit is not None:
                await toolkit.aclose()


asyncio.run(main())

Step 4: Validate results

Confirm final output includes:
  • pact submission and activation confirmation
  • success event
  • denial reason and suggestion
  • successful compliant retry
  • transaction lookup by request_id
  • audit confirmation

Keep the OpenAI layer thin

The OpenAI agent should coordinate the CAW flow, not absorb every wallet capability by default.
  • expose only the tools needed for the runtime role
  • keep pact submission and execution close together so the approval story stays legible
  • prefer durable tracking by request_id
  • move deterministic checks outside the agent loop when you need strict control

Go further

In Python, create_cobo_agent wires up the widened CAW runtime toolkit directly. In TypeScript, the normal pattern is to wrap the CAW TypeScript SDK in OpenAI tool functions and expose only the subset your runtime needs.
  • Define custom function tools — in Python, add functions alongside CAW’s built-in adapter; in TypeScript, wrap @cobo/agentic-wallet API calls in framework-native tool definitions.
  • Keep CAW behind a narrow tool surface — do not expose the whole API to the model. Start with Pact Drafting, Execution, and Observer roles.
  • Use direct SDK calls for out-of-band operations — run pact submission, policy dry-runs, and audit queries programmatically outside the agent loop when you need deterministic behavior.
  • Combine with CLI — use caw for onboarding and debugging; use the SDK tools for agent-time execution.
  • Use role-based presets — start with Pact Drafting, Execution, and Observer responsibilities instead of exposing the entire toolkit immediately.

Python SDK

Use WalletAPIClient directly for custom tool functions.