OpenAPI Specification

Machine-readable API definition for code generators, agent frameworks, and SDK builders.

OpenAPI 3.1 — JSON

Compatible with Swagger, Postman, and all OpenAPI tooling

Download openapi.json
GET https://api.bithaven.ai/openapi.json

Endpoints Summary

Auth/api/v1/auth

POST/signupCreate account (returns JWT + user)
POST/loginAuthenticate (returns JWT + user)
POST/logoutInvalidate token
GET/meGet current user

Master Wallet/api/v1/wallet

GET/Wallet details + deposit address
GET/balanceCurrent USDC balance
GET/depositsPaginated deposit history
POST/withdrawWithdraw USDC (requires password)

Agent Wallets/api/v1/agent-wallets

POST/Create agent wallet
GET/List all agent wallets
GET/:idGet wallet details
PATCH/:idUpdate label
POST/:id/fundFund from master wallet
POST/:id/withdrawWithdraw to master wallet
POST/:id/freezeFreeze wallet
POST/:id/unfreezeUnfreeze wallet

API Keys/api/v1/agent-wallets/:walletId/keys

POST/Create API key (returns rawKey once)
GET/List keys for wallet
POST/:keyId/revokeRevoke a key
POST/:keyId/rotateRotate key (revoke + create)

Policies/api/v1/agent-wallets/:walletId/policies

POST/Create policy
GET/List policies for wallet
PATCH/:policyIdUpdate policy
DELETE/:policyIdDelete policy

Transactions/api/v1/agent-wallets/:walletId/transactions

GET/List transactions for wallet
GET/pendingList pending approvals
POST/:txId/approveApprove transaction
POST/:txId/rejectReject transaction

MCP Tools/mcp/v1

POST/check-balanceAgent balance + remaining cap
POST/send-paymentInitiate USDC transfer
POST/get-tx-historyAgent transaction history
POST/request-approvalEscalate to human

Subscriptions/api/v1/subscription

GET/tierCurrent plan + usage + limits
GET/plansAll plan definitions
POST/checkoutStart Stripe checkout
POST/portalOpen Stripe billing portal
POST/cancelCancel at period end
POST/resumeResume pending cancellation

Authentication

The API uses two authentication methods depending on the caller:

Human (JWT)

For account management, wallet operations, policy setup

Authorization: Bearer <jwt>

Agent (API Key)

For MCP tools — balance, payments, history

Authorization: Bearer bh_live_...

Use With Tools

Import to Postman

File → Import → Link → https://api.bithaven.ai/openapi.json

Generate TypeScript client

npx openapi-typescript https://api.bithaven.ai/openapi.json -o bithaven-api.d.ts

Generate Python client

openapi-python-client generate --url https://api.bithaven.ai/openapi.json