pythonPython SDK

The floe-agentkit-actions package provides Coinbase AgentKit ActionProviders with 45 total actions (30 in FloeActionProvider + 15 in X402ActionProvider — 6 credit delegation + 9 agent-awareness) for Python 3.10+ environments.

Parity note. As of May 2026, the Python SDK has full parity with the TypeScript SDK: 30 Floe actions, 6 X402 credit-delegation actions, and 9 agent-awareness actions (45 total). The previously TS-only credit-facility actions (instant_borrow, repay_and_reborrow, request_credit, manual_match_credit, check_credit_status, repay_credit, renew_credit_line) and the v0.3.0 agent-awareness actions are all available in Python.

Naming convention: All action names and parameters in the Python SDK use snake_case (e.g., borrow_amount, max_interest_rate_bps). The TypeScript SDK uses camelCase for the same fields. Code examples are not interchangeable between SDKs without adjusting case.

Installation

# Core package
pip install floe-agentkit-actions

# With CLI support
pip install floe-agentkit-actions[cli]

# With LangChain integration
pip install floe-agentkit-actions[langchain]

Quick Start

As an AgentKit Provider

from coinbase_agentkit import AgentKit, AgentKitConfig
from floe_agentkit_actions import floe_action_provider

agentkit = AgentKit(AgentKitConfig(
    wallet_provider=wallet_provider,
    action_providers=[floe_action_provider()],
))

Standalone Usage

Call actions directly without an AI framework:

Framework Integrations

LangChain

OpenAI Function Calling

CLI: floe-agent

Interactive AI-powered DeFi agent with support for OpenAI, Claude, and Ollama, plus per-agent registration tooling.

Subcommands

Command
Purpose

floe-agent run [--agent <name>]

Interactive REPL. Default when no subcommand is given. Picks the agent from --agent, then active_agent, then the single registered agent if there's only one.

floe-agent register --name <name>

Provision a Floe agent (server-managed Privy wallet + on-chain delegation) and mint a floe_* key. Key is stored in OS keychain and printed once. Flags: --borrow-limit <usdc>, --max-rate-bps <n>, --expiry-days <n>, --facilitator-url <url>.

floe-agent agents

List registered agents and keychain status for each.

floe-agent use <name>

Set the active agent (persisted in .floe-agent.json).

floe-agent rotate <name>

Atomically rotate the agent's API key — old key revoked + new key minted server-side, keychain entry replaced.

floe-agent revoke <name>

Revoke the agent's API key server-side and remove the local keychain entry.

floe-agent open-credit-line --name <name> --deposit <usdc>

Open the USDC/USDC credit line for a previously-registered agent. Floe server-signs the borrow intent from the agent's Privy wallet (which must already hold the USDC deposit). Flags: --max-ltv-bps <bps> (1–9500, default 9500), --max-rate-bps <bps>. Required AFTER register before paid /proxy/fetch calls can succeed.

Setup flow (for run)

The REPL prompts for wallet provider, AI provider, and RPC URL. Configuration (wallet type + AI provider + agent registry, not secrets) is saved to .floe-agent.json and reused on subsequent runs. API keys live in the OS keychain via the keyringarrow-up-right package, or — when no keyring backend is available — in FLOE_AGENT_KEY_<UPPER_NAME> environment variables.

Multi-agent registry

One developer can register up to five agents. Typical flow:

Example Session

Wallet Providers

Provider
Use Case

EvmWalletProvider

Development / scripting — raw private key

CdpWalletProvider

Production agents — MPC-managed via CDP API

Environment Variables

Variable
Description

PRIVATE_KEY

Wallet private key (0x...)

CDP_API_KEY_NAME

Coinbase CDP API key name

CDP_API_KEY_PRIVATE_KEY

Coinbase CDP API secret

OPENAI_API_KEY

OpenAI API key (for CLI)

ANTHROPIC_API_KEY

Anthropic API key (for CLI)

BASE_RPC_URL

Custom Base RPC URL (recommended)

Development

Agent Awareness Actions (v0.3.0+)

The X402ActionProvider now includes 9 actions that let an agent reason about its own credit before committing capital. Configure facilitator_api_key to enable them:

Action names: get_credit_remaining, get_loan_state, get_spend_limit, set_spend_limit, clear_spend_limit, list_credit_thresholds, register_credit_threshold, delete_credit_threshold, estimate_x402_cost. See Agent Awareness for the decision-loop pattern.

Source Code

GitHub: Floe-Labs/agentkit-actions-pyarrow-up-right

Last updated