zkAPI
API Reference

clientd

User-app-facing HTTP server on localhost:11434

The user's app calls clientd as if it were the upstream API. Clientd handles auth transparently.

OpenAI chat completions

FieldValue
Method + pathPOST /v1/chat/completions
Request bodyOpenAI standard: { model, messages[], temperature?, max_tokens?, ... }
ResponseOpenAI ChatCompletion with extra zkapi: { charge_applied, next_anchor, remaining_balance }

OpenAI Responses

FieldValue
Method + pathPOST /v1/responses
Request body{ model, input, ... }
ResponseOpenAI Responses object with zkapi: {...}

Ollama native chat

FieldValue
Method + pathPOST /api/chat
Request body{ model, messages[], ... }
Response{ model, created_at, message: {role, content}, done, zkapi: {...} }

Wallet status

FieldValue
Method + pathGET /status
Request
Response{ has_note, pending_request, funding_url, note?: { note_id, deposit_amount, current_balance, expiry_ts, is_genesis, current_anchor, current_commitment_x/y } }

Deposit lifecycle

Prepare

FieldValue
Method + pathPOST /deposit/prepare
Request{ amount: u128 }
Response{ amount, secret, commitment, next_note_id, active_root, zero_path: [Felt252; 32] }

Confirm

FieldValue
Method + pathPOST /deposit/confirm
Request{ secret, note_id, amount, expiry_ts }
Responsesame shape as GET /status

Recovery after crash

FieldValue
Method + pathPOST /wallet/recover
Request{}
Response{ recovered: bool, request?: CoreResponse, wallet: WalletStatus }

On this page