DEV Community

flat cash
flat cash

Posted on

How to Give Your AI Agent a Bank Account in 5 Minutes (MCP + flat.cash)

How to Give Your AI Agent a Bank Account in 5 Minutes

Want your AI agent to handle real money? Here’s how to give it a bank account in minutes using FlatCash—a simple API for AI agents.

Step 1: Install FlatCash

bash
pip install flatcash

Step 2: Create a FlatID

  1. Go to flat.cash and sign up with your email and password (30 seconds).
  2. Verify your email.

Step 3: Generate an API Key

  1. Log in to flat.cash/app/settings.
  2. Click "Generate API Key" and copy it.

Step 4: Initialize the FlatClient

from flatcash import FlatClient

Replace with your API key

api_key = "your_api_key_here"
client = FlatClient(api_key)

Step 5: Your Agent’s New Powers

Check balance

balance = client.get_balance()
print(f"Balance: {balance} FLAT")

Earn SAVE from tasks (e.g., completing a task)

client.earn("task_completed", 10) # Earns 10 SAVE

Transfer FLAT to another FlatID

client.transfer("recipient_flat_id", 5.0) # Sends 5 FLAT

Use private AI (requires additional setup)

ai_response = client.ask_private_ai("What’s the weather?")
print(ai_response)

What can your agent do now?

  1. Check balance – View FLAT and SAVE holdings.
  2. Earn rewards – Get paid in SAVE for completing tasks.
  3. Send money – Transfer FLAT to other FlatIDs instantly.
  4. Use private AI – Access secure, agent-specific AI tools.
  5. Automate payments – Integrate with workflows for seamless transactions.

Top comments (0)