Your AI Agents First Payment

Here we’ll walk you through how to

  • Get your AI Agent API Key
  • Have your AI Agent make a payment

Sign Up To Payman Platform

Go to the Payman web app and sign up for an account. Sign up as a developer and get onboarded.

In “Developer Mode” we automatically set up a first Agent, and prefund your account with $1,000 USD of test funds. In “Developer Mode” no real money is ever spent so you can test the system freely. To get access to “Live Mode” and connect your real account, please request access on the Dashboard.

Enter Developer Mode to experiment with test funds

Get API Key

In order for your AI Agent to access the Payman API it will need an API Key. You can get this by navigating to the AI Agents tab in the sidebar menu and selecting the “Default Agent”.

View your agent details

Clicking the “Regenerate Credentials” button will generate a new API key which you can save for future use.

Save your API Key

This API key is only shown once and if regenerated will invalidate previous API keys, so keep it safe.

Setting up a Payee

In order for the AI Agent to have somewhere to send the funds, you will need a payee set up on the Payman system. There are two options:

  1. You can create the Payee via the Dashboard UI manually; or
  2. The AI Agent can create it as part of its payment request

In either event you will need the bank details to which you wish to send the funds. This needs to be a US Bank Account’s ACH details. It should include:

  1. Account Type (checking or savings)
  2. Account Holder Name
  3. Account Number
  4. Routing Number

For now we will create it manually by navigating to the Payees page on the Dashboard and selecting “Add New Payee”

Add a New Payee

Integrate API into AI Agent

Add Payman’s API to your AI Agent Tool capabilities. We’ve provided what an example AI agent using Payman looks like. This example uses Langchain, but any other agentic framework can be used as well.

Run The Code Above To Make a Payment

You can actually run the code above as python script to make your first payment via Payman.

To run this agent, create a .env file in this directory and put the following environment variables:

OPENAI_API_KEY=<your openAI API key - the agent will use the gpt-4o model by default>
PAYMAN_API_SECRET=<your Payman API Secret for that agent>

Create a agent.py file where your example agent code above will be pasted. Replace the Payman variables in there with the environment variables you created.

Now install the dependencies and run the agent.

pip install -U langchain-openai langchain-community langchainhub langchain openai python-dotenv
python agent.py

Once you have done this you can communicate with the agent and have it make the payment!

If you have not funded your AI Agent with the right amount of funds to spend based on the payment above, then you need to adjust accordingly!

Approving Payments

By default Payman AI will require all payments by an Agent to be approved by a human before the funds are transferred. You can change this behavior on the Agent’s details page, where you can set a different limit for the “Approvals Required” field. When doing so, any payments above the specified amount will require human approvals, any payments below will be automatically processed. This means you can adjust your limit as you gain trust in the Agent’s behavior over time without worrying about it misspending funds.

Let’s approve the payment now by going to the “Requests” page on the side bar and approving the Pending request. Once done, the funds will be deducted from your balance and the payment will be on its way. In “Developer Mode” this will resolve instantly. In the case of a live payment the ACH transfer can take 1-3 business days to complete, during which time the funds will show as Pending.