> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openfi.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Make your first OpenFi API call in the testnet environment.

**1. Create a testnet account**

Sign up at [openfi.co](https://openfi.co) and generate a testnet API key from the developer dashboard.

**2. Set your API key**

```bash theme={null}
export OPENFI_API_KEY="sk_testnet_..."
```

**3. Make a one-time payment**

```bash theme={null}
curl https://api.openfi.co/v1/payments \
  -H "Authorization: Bearer $OPENFI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 2500,
    "currency": "USD",
    "source": { "type": "bank_account", "id": "src_123" },
    "destination": { "type": "wallet", "address": "..." }
  }'
```

**4. Set up an agentic (recurring) debit**

Recurring, agent-initiated pulls require three calls in sequence: a mandate, a session key, and then one or more debit pulls.

```bash theme={null}
# 1. Create the mandate (the standing authorization)
curl https://api.openfi.co/v1/mandates \
  -H "Authorization: Bearer $OPENFI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "payer_account_id": "acc_123",
    "max_amount": 50,
    "currency": "USD",
    "interval": "daily",
    "purpose": "AI agent operational expenses"
  }'

# 2. Issue a session key scoped to that mandate
curl https://api.openfi.co/v1/session-keys \
  -H "Authorization: Bearer $OPENFI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mandate_id": "man_123",
    "expires_in": 86400
  }'

# 3. Execute a pull against the session key
curl https://api.openfi.co/v1/debit-pulls \
  -H "Authorization: Bearer $OPENFI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "session_key_id": "sk_123",
    "amount": 12.50
  }'
```

> [!NOTE]
>
> Testnet simulates mandates and session keys. Use a mainnet key to move real funds.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.