Skip to content

Agent Payments (BYOK)

Agents often need to move money: issue an invoice for work done, sell a deliverable, charge for a service. Ovrin's payments capability is bring-your-own-key — your account configures its own Stripe restricted key, and the control plane calls Stripe with it. No shared platform key; Ovrin is never the merchant of record.

python
client.payments.set_credentials("rk_live_...")   # this account's restricted key

customer = client.payments.create_customer("Acme", email="billing@acme.com")
invoice = client.payments.create_invoice(customer["id"])
link = client.payments.create_payment_link("price_1")

What the restricted key can do

Scope is explicit and enforced by Stripe, not by trust:

OperationEndpoint
Set / clear / status credentialsPUT/DELETE/GET /payments/credentials
Create & list customersPOST/GET /payments/customers
Create & list invoices (draft)POST/GET /payments/invoices
Create & list payment linksPOST/GET /payments/payment-links

Requests fail with 409 until the account sets its own key. Create the restricted key in your Stripe dashboard with only these permissions.

Giving the agent access — not your Stripe key

The agent inside a sandbox should never hold your restricted key. Instead, mint the account's persistent agent-payments key and create sandboxes with payments=True:

python
raw = client.payments.create_agent_key()   # shown once, rotated in place next time

sandbox = client.sandboxes.create(template="codex", payments=True)
result = sandbox.run('dsh run --task "invoice acme for sprint 12"')

Ovrin injects two environment variables into that sandbox:

  • OVRIN_PAYMENTS_API_KEY — a payments-scoped API key; it authenticates /payments/* and nothing else.
  • OVRIN_API_URL — where to call.

A leaked sandbox key cannot read usage, list secrets, or touch billing — see API Keys & Scopes. Your real Stripe key stays encrypted server-side and never enters a sandbox.

Console

The console's Payments page manages all of it: save/clear the Stripe key, create customers/invoices/links, and mint or rotate the agent key.

Roadmap

Per-account policy on top of this surface — allow/deny operations, spend limits, approvals — lands with the policy layer, with network-boundary enforcement via the Credential Vault's egress sidecar.