Skip to main content
Most users should use the CLI or MCP server instead of calling the API directly.

API surfaces

0 Finance exposes two API surfaces:
  1. CLI API — API-key authenticated endpoints at /api/cli
  2. Dashboard API — Session/webhook authenticated endpoints at /api/*

CLI API (API keys)

Base URL

https://www.0.finance/api/cli
For local development:
http://localhost:3050/api/cli

Authentication

Include your API key in the Authorization header:
curl https://www.0.finance/api/cli/balance \
  -H "Authorization: Bearer sk_live_xxx"
Get your API key from Settings → API Keys.

Admin authentication

Admin-only endpoints require the x-admin-token header:
curl https://www.0.finance/api/cli/users \
  -X POST \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "x-admin-token: adm_xxx" \
  -H "Content-Type: application/json" \
  -d '{ "email": "[email protected]" }'

Response format

Endpoints return JSON objects. Errors return { "error": "..." }. Example error:
{
  "error": "Unauthorized: invalid or missing API key"
}

CLI endpoint map

Auth & balance

MethodEndpointDescription
GET/api/cli/whoamiWorkspace metadata for the API key
GET/api/cli/balanceSpendable (idle + earning) balance

Bank accounts

MethodEndpointDescription
GET/api/cli/bank-accountsList saved bank accounts
POST/api/cli/bank-accountsCreate a bank account

Bank transfers

MethodEndpointDescription
POST/api/cli/bank-transfers/proposalsPropose a bank transfer
GET/api/cli/bank-transfers/proposalsList proposals (include_completed=true)
POST/api/cli/bank-transfers/proposals/:id/dismissDismiss a proposal

Invoices

MethodEndpointDescription
POST/api/cli/invoicesCreate an invoice
GET/api/cli/invoicesList invoices (status, limit)
GET/api/cli/invoices/:idGet invoice details
PATCH/api/cli/invoices/:idUpdate an invoice
POST/api/cli/invoices/:id/sendSend an invoice

Transactions

MethodEndpointDescription
GET/api/cli/transactionsList transactions (status, limit)
GET/api/cli/transactions/:idGet transaction details

Attachments

MethodEndpointDescription
POST/api/cli/attachmentsUpload an attachment
GET/api/cli/attachmentsList attachments (transaction_id, transaction_type, limit)
DELETE/api/cli/attachments/:idRemove an attachment

Payment details

MethodEndpointDescription
GET/api/cli/payment-detailsGet IBAN/ACH receiving details
POST/api/cli/payment-details/shareEmail receiving details

Crypto transfers

MethodEndpointDescription
POST/api/cli/crypto-transfers/proposalsPropose a crypto transfer
GET/api/cli/crypto-transfers/proposalsList crypto proposals (include_completed=true)
POST/api/cli/crypto-transfers/proposals/:id/dismissDismiss a crypto proposal

Savings & vaults

MethodEndpointDescription
GET/api/cli/vaultsList supported vaults
POST/api/cli/savings/depositsPropose a vault deposit
POST/api/cli/savings/withdrawalsPropose a vault withdrawal
GET/api/cli/savings/proposalsList savings proposals (include_completed=true)
GET/api/cli/savings/positionsIdle/earning balance and vault positions

Admin endpoints

MethodEndpointDescription
POST/api/cli/usersProvision a user (creates workspace + API key)
GET/api/cli/users/:idFetch user + profile by Privy DID
POST/api/cli/users/:id/walletsPregenerate wallets for a user
POST/api/cli/api-keysCreate an API key for a workspace

CLI query parameters

Invoices

  • status: db_pending, pending, paid, canceled
  • limit: number

Transactions

  • status: pending, completed, failed
  • limit: number

Proposals

  • include_completed: true or false

CLI examples

Check balance

curl https://www.0.finance/api/cli/balance \
  -H "Authorization: Bearer sk_live_xxx"
Response:
{
  "idle_balance": "3200.00",
  "earning_balance": "4220.50",
  "spendable_balance": "7420.50",
  "safe_address": "0x954A329e1e59101DF529CC54A54666A0b36Cae22",
  "chain": "base"
}

Create invoice

curl https://www.0.finance/api/cli/invoices \
  -X POST \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "recipient_email": "[email protected]",
    "amount": 1000,
    "currency": "USD",
    "description": "Consulting services"
  }'

Propose transfer

curl https://www.0.finance/api/cli/bank-transfers/proposals \
  -X POST \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "amount_usdc": "1000",
    "destination_currency": "usd",
    "saved_bank_account_id": "ba_xxx",
    "reason": "Contractor payment"
  }'
Transfers create proposals that require dashboard approval before executing.

Dashboard endpoints (session/webhook)

These endpoints are used by the web app and internal services:
  • Health check: /api/health
  • Upload: /api/upload (requires a signed-in user session)
  • Register primary Safe: /api/user/safes/register-primary
  • Privy webhooks: /api/webhooks/auth (HMAC signed)
See the endpoint pages in the API sidebar for request/response details.

MCP server

The MCP server at /api/mcp wraps the CLI API for AI agents. See MCP Overview for details.