Agent Developer Backend API

These functions require direct input from the user who is invoking the agent.

Initialize a new agent

def init_agent(self, name: str, user_agent_protocol_id: str, description: str) -> Agent:
    """
    Args:
        name (str): The name of the agent.
        user_agent_protocol_id (str): The unique ID for the user.
        description (str): A description of the agent's purpose.

    Returns:
        Agent: The newly created agent object.
    """

Creating, Funding, & Assigning Cards

Initialize Plaid OAuth for linking a user's account and funding cards

def init_plaid_oauth(self, user_ap_id: str, callback_url: str) -> str:
    """
    Args:
        user_ap_id (str): The unique ID for the user.
        callback_url (str): The callback URL to receive the OAuth key.

    Returns:
        str: The URL to redirect the user for Plaid OAuth.
    """

Create a new virtual fiat card

def create_fiat_card(self, user_ap_id: str, permissions: dict) -> Card:
    """
    Args:
        user_ap_id (str): The unique ID for the user.
        permissions (dict): The permissions and limits for the card.

    Returns:
        Card: The created fiat card object.
    """

Fund a fiat card with a specified amount

def fund_fiat(self, card_id: str, user_plaid_key: str, amount: float):
    """
    Args:
        card_id (str): The ID of the fiat card.
        user_plaid_key (str): The Plaid key for the user's account.
        amount (float): The amount to fund the card with.
    """

Assign a card to an agent

def assign_card(self, card_id: str, agent_id: str):
    """
    Args:
        card_id (str): The ID of the card.
        agent_id (str): The ID of the agent.
    """

Fund a crypto card

def fund_crypto(self, card_id: str):
    """
    Args:
        card_id (str): The ID of the crypto card (keypair).
    """

Increase the spend limit for a card

def increase_spend_limit(self, card_id: str, new_spend_limit: float):
    """
    Args:
        card_id (str): The ID of the card.
        new_spend_limit (float): The new spend limit.
    """

Error Class

class errors:
    SPEND_LIMIT_EXCEEDED = "SPEND_LIMIT_EXCEEDED"
    RESTRICTED_VENDOR = "RESTRICTED_VENDOR"
    OUT_OF_FUNDS = "OUT_OF_FUNDS"

Last updated