> ## Documentation Index
> Fetch the complete documentation index at: https://open-fi.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> OpenFi is a hybrid Open Finance infrastructure connecting Open Banking and Web3 into a single programmable rail for humans and AI agents.

<Note>
  This is an early, working draft of the OpenFi API reference. Endpoints, parameters, and response shapes are subject to change before the public testnet launch.
</Note>

## What is OpenFi

OpenFi is the infrastructure layer that lets applications, and autonomous AI agents, move money and verify identity across both traditional banking rails and blockchain rails through one API.

## The four pillars

<CardGroup cols={2}>
  <Card title="1. Bi-Directional Direct Debits" icon="repeat" href="/essentials/payments-vs-mandates">
    Standardized pull transactions across Web2 and Web3, **live in V1**.
  </Card>

  <Card title="2. Symmetrical Data Oracles" icon="satellite-dish" href="/api-reference/oracles/overview">
    ZK-TLS financial data oracle, **V2 roadmap**, not yet in the API.
  </Card>

  <Card title="3. Identity & Anti-Bot Verification" icon="fingerprint" href="/essentials/identity-and-vcs">
    W3C Verifiable Credentials for Sybil resistance, **live in V1** (endpoints still placeholder).
  </Card>

  <Card title="4. Atomic Clearing & Escrows" icon="lock" href="/essentials/atomic-clearing">
    Real-time settlement is atomic by default today; Programmatic Escrow is **V2 roadmap**.
  </Card>
</CardGroup>

See [Use Cases](/use-cases) for how these combine in practice.

## Two kinds of money movement

<CardGroup cols={2}>
  <Card title="One-time payments" icon="bolt" href="/api-reference/payments/create-payment">
    A single push or pull payment. No standing authorization is created.
  </Card>

  <Card title="Agentic recurring debits" icon="robot" href="/api-reference/agentic/create-mandate">
    A mandate + session-key flow that lets a human or an AI agent pull funds repeatedly within strict, on-chain enforced limits.
  </Card>
</CardGroup>

## How the API is organized

The API is split at the route level to match how these two flows actually work under the hood:

| Flow                    | Route                   | Purpose                                                                         |
| ----------------------- | ----------------------- | ------------------------------------------------------------------------------- |
| One-time payment        | `POST /v1/payments`     | Single push/pull, no standing authorization                                     |
| Recurring agentic debit | `POST /v1/mandates`     | Establishes the top-level authorization (amount, cadence, purpose)              |
| Recurring agentic debit | `POST /v1/session-keys` | Issues a time-bound, velocity-bound cryptographic allowance scoped to a mandate |
| Recurring agentic debit | `POST /v1/debit-pulls`  | Executes a single pull against an active session key                            |

This same split is reflected in the SDKs as two modules: `payments` and `agentic`.

<CodeGroup>
  ```javascript Node.js theme={null}
  import OpenFi from "@openfi/sdk";

  const client = new OpenFi({ apiKey: process.env.OPENFI_API_KEY });

  // One-time payment
  await client.payments.create({ amount: 2500, currency: "USD" });

  // Agentic recurring debit
  const mandate = await client.agentic.mandates.create({ /* ... */ });
  const sessionKey = await client.agentic.sessionKeys.create({ mandateId: mandate.id });
  await client.agentic.debitPulls.create({ sessionKeyId: sessionKey.id, amount: 50 });
  ```

  ```python Python theme={null}
  from openfi import OpenFi

  client = OpenFi(api_key="OPENFI_API_KEY")

  # One-time payment
  client.payments.create(amount=2500, currency="USD")

  # Agentic recurring debit
  mandate = client.agentic.mandates.create(...)
  session_key = client.agentic.session_keys.create(mandate_id=mandate.id)
  client.agentic.debit_pulls.create(session_key_id=session_key.id, amount=50)
  ```
</CodeGroup>

## Settlement Chains

Every OpenFi call, regardless of which route it hits, ultimately touches one of two settlement chains:

* **Aptos (Move)**: settlement router + allowance state machine (the on-chain enforcement behind mandates and session keys)
* **Stellar (Soroban)**: settlement router + attestation verifier (data-oracle / proof-of-financial-health use cases)

You don't need to specify a chain when calling the API. OpenFi routes internally based on the request type and your account configuration.

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Get a testnet key and make your first call.
  </Card>

  <Card title="Authentication" icon="key" href="/authentication">
    How API keys and signing work.
  </Card>
</CardGroup>
