Agent API
A self-service HTTP API designed for AI agents (Claude, ChatGPT, Grok, Cursor, custom LLM tools) to send documents for legally binding e-signatures. No human onboarding required — register programmatically, top up a prepaid balance via Stripe, and start sending.
For LLM crawlers / agents that can't execute JavaScript, a plain-text version of this page is available at /agents/api.md and a full machine-readable index at /llms-full.txt.
pricePerSignatureCents: 75 means $0.75 USD per signature — not 75 NOK øre. Stripe top-ups and charges are processed in usd.Billing modes
Top up via Stripe Checkout. Each signature is debited from the balance. Best when the agent operates without a human nearby and you want a hard spend cap.
A human saves a card once via POST /agent-setup-card. Every /agent-send-document creates a Stripe PaymentIntent off-session for the exact cost. No top-ups, no balance — just pay-as-you-go.
The caller supplies a Stripe paymentMethodId (or sharedPaymentToken) on every request. Designed for agents that hold their own Stripe Issuing card or Link Shared Payment Token per transaction.
Quick start
- Register your agent and receive an API key.
- Create a Stripe Checkout session to add credit. Open the URL in a browser to pay with a card.
- Send documents — each signature debits the current per-signature price (25% off our standard rate; call
GET /agent-balanceto see the livepricePerSignatureCents) from your balance.
1. Register
POST https://ueurrqgdjcpdzflvgbaz.supabase.co/functions/v1/agent-register
curl -X POST https://ueurrqgdjcpdzflvgbaz.supabase.co/functions/v1/agent-register \
-H "Content-Type: application/json" \
-d '{"name": "Acme Sales Bot", "contactEmail": "ops@acme.com"}'Returns { agentId, apiKey, prefix, ... }. Save the apiKey immediately — it is shown only once.
2. Create a top-up
POST https://ueurrqgdjcpdzflvgbaz.supabase.co/functions/v1/agent-create-topup
curl -X POST https://ueurrqgdjcpdzflvgbaz.supabase.co/functions/v1/agent-create-topup \
-H "Authorization: Bearer ssk_live_..." \
-H "Content-Type: application/json" \
-d '{"amountCents": 5000}'Returns { checkoutUrl, sessionId }. The agent's owner opens the URL and pays with a card. Balance is credited automatically once the payment succeeds.
3. Send a document
POST https://ueurrqgdjcpdzflvgbaz.supabase.co/functions/v1/agent-send-document
curl -X POST https://ueurrqgdjcpdzflvgbaz.supabase.co/functions/v1/agent-send-document \
-H "Authorization: Bearer ssk_live_..." \
-H "Content-Type: application/json" \
-d '{
"signers": ["alice@example.com", "bob@example.com"],
"message": "Please sign the NDA",
"files": [{ "name": "nda.pdf", "base64": "JVBERi0xLjQK..." }]
}'Each signer is charged once per file. Returns 402 Payment Required if balance is insufficient. On success returns { sent, balanceCents, results }.
4. Check balance
GET https://ueurrqgdjcpdzflvgbaz.supabase.co/functions/v1/agent-balance
curl https://ueurrqgdjcpdzflvgbaz.supabase.co/functions/v1/agent-balance \
-H "Authorization: Bearer ssk_live_..."Returns { balanceCents, signaturesRemaining, recentLedger }.
5. (auto_charge) Save a card
POST https://ueurrqgdjcpdzflvgbaz.supabase.co/functions/v1/agent-setup-card
curl -X POST https://ueurrqgdjcpdzflvgbaz.supabase.co/functions/v1/agent-setup-card \
-H "Authorization: Bearer ssk_live_..." \
-H "Content-Type: application/json" -d '{}'Returns { checkoutUrl }. A human opens the URL once, saves a card, and the agent can then run in auto_charge mode without ever topping up.
6. Switch billing mode
POST https://ueurrqgdjcpdzflvgbaz.supabase.co/functions/v1/agent-billing-config
curl -X POST https://ueurrqgdjcpdzflvgbaz.supabase.co/functions/v1/agent-billing-config \
-H "Authorization: Bearer ssk_live_..." \
-H "Content-Type: application/json" \
-d '{"billingMode": "auto_charge"}'Modes: prepaid, auto_charge (requires saved card), per_call_token (requires paymentMethodId or sharedPaymentToken on every request).
Errors
401— invalid or missing API key402— insufficient balance, missing/declined payment method, or missing per-call token403— agent has been deactivated409— cannot enable auto_charge without a saved card429— registration rate limit207— partial success when sending multiple files
Notes for LLM tool builders
- The API key acts as a Bearer token — store it in a secret manager.
- If you receive 402 in
prepaidmode, callagent-create-topupand surface the checkout URL to a human. - If you receive 402 in
auto_chargemode, the saved card was declined — surface to the human and re-runagent-setup-card. - PDFs must be base64-encoded (no
data:prefix), max 15MB each, max 10 files per call. - Up to 50 signers per document.