---
title: "Pay to provision a persistent API key (x402): get an API key after one payment, no human approval."
method: POST
path: "/provision"
tags: ["Provision"]
---

# Pay to provision a persistent API key (x402): get an API key after one payment, no human approval.

`POST /provision`

## Request

- Base URL: `https://api.stacktr.ee`
- URL: `https://api.stacktr.ee/provision`
- Auth: none required

Agent-native, no human in the loop. POST with no payment to receive a 402 with x402 payment requirements (PAYMENT-REQUIRED header for v2; the accepts list in the body for v1). Pay $1.00 in USDC on Base (accepts[0], an EIP-3009 authorization) or on Solana (accepts[1], an `exact` transfer sponsored by the fee payer in extra.feePayer) and retry; on settlement you receive a one-time stk_live_ API key. The key is a free-tier identity: 3 pages in total, each expiring after 7 days, passcodes included. POST /unlock lifts those limits (higher_limits $25/30 days) or cancels the expiry on one page (make_permanent $5). Settled through the Coinbase CDP facilitator. Read the accepts array from the 402 rather than hardcoding a rail: the requirements differ per network, and the v1 rail (X-PAYMENT, accepts in the body) is Base only. Other agentic rails (MPP, ACP, AP2) are advertised in the rail menu when enabled.

## Request body

- object
  - `acp_shared_payment_token` string: ACP rail: a Stripe Shared Payment Token (spt_...).
  - `ap2_mandate` object: AP2 rail: an AP2 mandate object (supports human-not-present).
  - `agent_context` object: Optional discovery telemetry, never required and never affecting the response: which client is paying (e.g. agentcash, awal, pay.sh, bazaar-mcp), the kind of agent, and the search query that led here. Recorded only to improve how Stacktree describes itself to agents.
    - `client` string
    - `agentType` string: Codex, Claude Code, Hermes, OpenClaw, or Others (Specify).
    - `agentTypeOther` string
    - `discovery_query` string: The search that led here, verbatim.

## Response `200`

Paid and provisioned. Returns the API key once.

- object
  - `ok` boolean
  - `protocol` string
  - `api_key` string
  - `prefix` string

## Other responses

- `402`: Payment Required. x402 requirements are in the PAYMENT-REQUIRED header (v2) and the response body (v1).
- `502`: Facilitator verify/settle error.

---

[API](https://skmtc.dev/stacktr/apis/stacktree-api.md) · [All operations](https://skmtc.dev/stacktr/apis/stacktree-api/llms.txt) · [OpenAPI document](https://skmtc.dev/stacktr/apis/stacktree-api/revisions/5878cce46977?raw)
