Agent Payment API

Introduction

The Agent Payment API allows an AI agent to autonomously manage and purchase API credits on behalf of a user. This enables unattended workflows where the agent can check its remaining credit balance, review spending limits, and top up credits via the user's saved Stripe payment method all without human intervention.

All three endpoints are hosted on payments.builtwith.com and authenticate with your BuiltWith API key.

Before an agent can use these endpoints the user must enable Agent API Billing and configure spending limits at https://payments.builtwith.com/agent-payment-api-config.
Authentication

Pass the Agent API Key using either method below. The KEY query parameter takes priority if both are supplied.

Authorization Header (recommended)

Authorization: Bearer 00000000-0000-0000-0000-000000000000

Query Parameter (fallback)

?KEY=00000000-0000-0000-0000-000000000000

Requests with a missing, invalid, or disabled key return HTTP 401. Accounts with billing suspended return HTTP 403.

🤖 AI Agent Prompt
Reference https://api.builtwith.com/llms.txt and
https://raw.githubusercontent.com/builtwith/builtwith-ai-sdk/refs/heads/main/README.md
Add BuiltWith Agent Payment API support to my app. Check the current API credit balance,
and if below 1000 credits, purchase 2000 more using the Agent Payment API.
GET /v1/billing/api-discovery — Credit Balance

Returns the current API credit balance for the account.

Request

GET https://payments.builtwith.com/v1/billing/api-discovery?KEY=00000000-0000-0000-0000-000000000000

Response Fields
FieldTypeDescription
credits_totalnumberTotal credits ever allocated to the account.
credits_usednumberCredits consumed by API calls to date.
credits_availablenumberRemaining usable credits (total minus used). This is what the agent should check before making API calls.
Example Response
{
  "credits_total": 10000,
  "credits_used": 1234,
  "credits_available": 8766
}
GET /v1/billing/api-configuration — Spending Limits

Returns the configured spending limits and how much of the monthly allowance has already been used. The agent should check this before attempting a purchase to avoid rejected requests.

Request

GET https://payments.builtwith.com/v1/billing/api-configuration?KEY=00000000-0000-0000-0000-000000000000

Response Fields
FieldTypeDescription
max_per_purchasenumberMaximum credits the agent may buy in a single transaction.
max_monthlynumberMaximum credits the agent may purchase across the current calendar month.
monthly_purchasednumberCredits already purchased by the agent this calendar month.
monthly_remainingnumberHow many more credits can be purchased this month before the monthly limit is reached.
cost_per_2000_credits_usdnumberUSD cost for the minimum 2,000-credit purchase. Use this to estimate the cost of a planned purchase.
Example Response
{
  "max_per_purchase": 5000,
  "max_monthly": 20000,
  "monthly_purchased": 5000,
  "monthly_remaining": 15000,
  "cost_per_2000_credits_usd": 99.00
}
POST /v1/billing/api-purchase — Buy Credits

Charges the user's saved Stripe payment method and immediately credits the account. The purchase is subject to the per-purchase and monthly limits set in the Agent API Billing configuration.

Request

POST https://payments.builtwith.com/v1/billing/api-purchase

Send the Agent API Key as the Authorization: Bearer header or as a ?KEY= query parameter. The request body must be JSON.

Request Body
FieldTypeRequiredDescription
creditsnumberYesNumber of credits to purchase. Minimum 2,000. Must not exceed max_per_purchase or the remaining monthly allowance.
Success Response (HTTP 200)
FieldTypeDescription
successbooleantrue
credits_purchasednumberCredits added to the account.
cost_usdnumberAmount charged in USD.
payment_idstringStripe PaymentIntent ID for reconciliation.
credits_availablenumberUpdated available credit balance after the purchase.
Example Request Body
{ "credits": 2000 }
Example Success Response
{
  "success": true,
  "credits_purchased": 2000,
  "cost_usd": 99.00,
  "payment_id": "pi_3abc123xyz",
  "credits_available": 10766
}
Error Responses
HTTPMeaning
400Validation failure - credits below 2,000, exceeds per-purchase limit, or monthly limit would be breached.
401Missing or invalid Agent API Key.
402Stripe payment failed or no chargeable payment method on file.
403Account billing suspended.
405Method not allowed - endpoint requires POST.
Special Domains

We maintain two lists of use for you when looking up domains. Ignore lists and BuiltWith Suffix lists.

Ignore List
This is our own internal list of domains we do not index. They are either blocked, contains too many misleading technologies or too many subdomains with user generated content.

BuiltWith Suffix List
This is based on the Public Suffix List but includes many additional entries for companies with subdomains that should be considered top level domains. This list provides us with better visibility for internal websites for example it brings northernbeaches.nsw.gov.au to the top level over nsw.gov.au.

Ignore Domains (XML, JSON or TXT)
https://api.builtwith.com/ignoresv1/api.json
Suffix Domains (XML, JSON or TXT)
https://api.builtwith.com/suffixv1/api.json
Error Codes

Note error messages in this format cannot be guaranteed, your implementation should also consider non-200 response codes as errors. The Lookup property will be null (json) or not provided (xml) if the error is server related. View all potential well-formed error codes.

Terms of Use

Our standard terms cover the use all of our APIs.

In general, you can use the API to enhance your product in many ways. The only limitation is you cannot resell the data as-is or provide duplicate functionality to builtwith.com and its associated services.