Official client • v0.1.0

From discovery to paid API call in one command.

The ArkAPI client discovers the live catalog, validates inputs from OpenAPI, calls tools with Bearer or Ark-402 authentication, and turns the current API into MCP tools for compatible agents.

Dynamic MCP toolsBearer + Ark-402Local spend budgetsNo token in command history

Install

Download the binary for your architecture, verify it, then install it on your path.

curl -fSLO https://arkapi.dev/downloads/arkapi-linux-amd64 curl -fSLO https://arkapi.dev/downloads/SHA256SUMS sha256sum --ignore-missing -c SHA256SUMS sudo install -m 0755 arkapi-linux-amd64 /usr/local/bin/arkapi arkapi version

ARM64 users should substitute arkapi-linux-arm64.

Bearer quick start

Create a session and save its token directly into a private client file. The token is omitted from normal output.

arkapi session create --amount 500 # Pay the returned Ark address or Lightning invoice arkapi balance arkapi catalog arkapi call btc-price --query currency=USD

Token files are created with mode 0600. The client never accepts a token as a command-line flag.

Give an agent MCP tools

arkapi mcp serve reads the live catalog and OpenAPI document, then publishes each paid endpoint as a typed MCP tool. Add this stdio server to any compatible host:

{ "mcpServers": { "arkapi": { "command": "/usr/local/bin/arkapi", "args": ["mcp", "serve"], "env": { "ARKAPI_AUTH": "bearer", "ARKAPI_TOKEN_FILE": "/private/path/to/arkapi/token" } } } }

The default local policy allows at most 25 sats per call and 100 sats of API calls per UTC day. Change those only when the agent's authority requires it.

Ark-402 mode

Ark-402 lets a dedicated Bark wallet pay once, then sign each request against its credit. Install the matching helper alongside the client.

export ARKAPI_AUTH=ark402 export ARK402_CLIENT_BARKD_URL=http://127.0.0.1:3000 export ARK402_CLIENT_BARKD_DATADIR=/private/path/to/.bark arkapi call btc-price --query currency=USD

Automatic top-ups are off by default. Use a dedicated, low-balance wallet and keep wallet credentials outside prompt context.

Opt-in automatic top-ups

Only enable payment automation when the agent is authorized to spend. Both per-top-up and daily limits are enforced locally.

export ARKAPI_ARK402_AUTO_PAY=1 export ARKAPI_ARK402_MAX_TOPUP_SATS=100 export ARKAPI_ARK402_DAILY_TOPUP_BUDGET_SATS=500

A request with an uncertain network outcome remains charged against the local budget until reconciled. This prevents a timeout from silently widening spending authority.

Built-in guardrails

ControlDefault
Maximum API cost per call25 sats
Daily API-call budget100 sats
Ark-402 automatic paymentOff
Maximum Ark-402 top-up100 sats
Daily Ark-402 top-up budget500 sats
Bearer token transportHTTPS, localhost, Tor onion, or I2P only

Inspect current local usage with arkapi usage. See the agent skill for billing, retry, Tor, I2P, and ambiguous-response guidance.