Overview

AISA is a Pay-per-Crawl content access platform. Publishers set pricing rules for their content, and AI Agents pay to access it. The platform uses the HTTP 402 Payment Required standard to signal when payment is needed.

How it works

Publisher sets price rules AI Agent requests content | | v v AISA Platform <---- access/verify ----> ESA Gateway | | |--- balance sufficient? ---> 200 OK | |--- balance insufficient? -> 402 + price | |--- no token? ------------> 402 + register | |--- blocked? -------------> 403 |

Key Concepts

ConceptDescription
Crawler Token Your API key for accessing content. Format: aisa_crawler_xxx. Obtained after registration.
Balance Prepaid USD balance. Each content access deducts from your balance based on the publisher's pricing.
402 Response HTTP 402 Payment Required. Returned when payment is needed. Contains pricing info and payment options.
accessGranted Boolean field in every response. true = content accessible. false = payment or action needed.
Price Mode How your agent signals willingness to pay: auto-pay, exact price, max budget, or price discovery.

Quick Start (3 Minutes)

1

Register

Create an account via API. No email verification required. You'll receive a crawlerToken immediately.

2

Top Up

Add balance via Stripe (credit card). Minimum $0.50. Your balance is used to pay for content access.

3

Access Content

Call /api/v1/access/verify with your token. If balance is sufficient, content is returned.

Complete Example

bash
# Step 1: Register
curl -s -X POST "https://cdn.aisa.one/api/agent/auth/register" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "password": "MySecurePass123",
    "name": "MyBot",
    "crawlerType": "custom",
    "companyName": "Acme Inc"
  }'
# Response: { "success": true, "crawler": { "crawlerToken": "aisa_crawler_xxx", ... } }

# Step 2: Top up (via dashboard or API - see Top-up section)

# Step 3: Access content
curl -s -X POST "https://cdn.aisa.one/api/v1/access/verify" \
  -H "Content-Type: application/json" \
  -H "X-AISA-Crawler-Token: aisa_crawler_xxx" \
  -d '{
    "publisherDomain": "[email protected]",
    "resourceUrl": "/article/2026/ai-trends.html",
    "crawlerAutoPrice": true
  }'
# Response: { "accessGranted": true, "statusCode": 200, "charge": { "amount": 0.01 } }

Registration API

Create a new crawler account programmatically. No human intervention required.

FieldTypeRequiredDescription
emailstringYesValid email address (used as login ID)
passwordstringYesMinimum 8 characters
namestringNoDisplay name for your crawler/agent
crawlerTypestringNoType identifier: custom, gptbot, perplexitybot, etc.
userAgentstringNoYour crawler's User-Agent string (used for identification)
companyNamestringNoOrganization name
bash
curl -s -X POST "https://cdn.aisa.one/api/agent/auth/register" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "password": "SecurePass888",
    "name": "MySearchBot",
    "crawlerType": "custom",
    "userAgent": "MySearchBot/1.0",
    "companyName": "Acme AI Labs"
  }'

Success Response

json
{
  "success": true,
  "token": "eyJjcmF3bGVySWQ...",       // Session token (for dashboard login)
  "crawler": {
    "id": 42,
    "crawlerUuid": "crawler-a1b2c3d4-1712345678",
    "email": "[email protected]",
    "name": "MySearchBot",
    "crawlerType": "custom",
    "crawlerToken": "aisa_crawler_abc123def456...",  // API token (use this for access/verify)
    "balance": 0,
    "totalSpent": 0
  }
}
Important: Save the crawlerToken securely. This is your API key for all content access requests. The token field is a session token for the web dashboard, not for API access.

Login (Existing Account)

bash
curl -s -X POST "https://cdn.aisa.one/api/agent/auth/login" \
  -H "Content-Type: application/json" \
  -d '{ "email": "[email protected]", "password": "SecurePass888" }'

Authentication

The crawlerToken from registration is used to authenticate all API requests. Three methods supported (pick one):

MethodHeader / FieldExample
Custom Header (recommended) X-AISA-Crawler-Token: <token> X-AISA-Crawler-Token: aisa_crawler_abc123...
Body Parameter crawlerToken in JSON body "crawlerToken": "aisa_crawler_abc123..."
Token Format: aisa_crawler_ followed by 64 hex characters. Tokens do not expire but can be revoked from the dashboard.
⚠️ Authorization: Bearer no longer supported (2026-04)
Per Aliyun security review, the generic Authorization header is no longer accepted for crawler authentication — it leaks through middleware / CDN / WAF / logging pipelines. Use the custom X-AISA-Crawler-Token header instead. Requests still carrying Authorization: Bearer will be treated as unauthenticated and returned 402 + invalid_token.

Balance Top-up

Before accessing paid content, you need balance in your account. Currently supported: Stripe (credit/debit card).

Option 1: Dashboard

Log in to the Agent Dashboard → Wallet and click "Top Up".

Option 2: API (Programmatic)

Create a Stripe Checkout session via API. Requires a session token (from login/register).

bash
# Step 1: Login to get session token
SESSION_TOKEN=$(curl -s -X POST "https://cdn.aisa.one/api/agent/auth/login" \
  -H "Content-Type: application/json" \
  -d '{"email":"[email protected]","password":"SecurePass888"}' \
  | python3 -c "import sys,json; print(json.load(sys.stdin)['token'])")

# Step 2: Create Stripe checkout session
curl -s -X POST "https://cdn.aisa.one/api/agent/topup/create-session" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $SESSION_TOKEN" \
  -d '{"amount": 5.00}'

# Response includes: { "sessionId": "cs_xxx", "url": "https://checkout.stripe.com/..." }
# Open the URL to complete payment. Balance is added automatically after payment.
Minimum top-up: $0.50 | Recommended: $5.00 for testing, $50+ for production use.

Check Balance

bash
curl -s "https://cdn.aisa.one/api/agent/info" \
  -H "Authorization: Bearer $SESSION_TOKEN"
# Response: { "crawler": { "balance": "5.000000", ... } }

Access Verify API

The core API endpoint. Your agent calls this to access content. The platform checks your token, matches publisher rules, and either grants access (200) or requests payment (402).

FieldValue
EndpointPOST /api/v1/access/verify
Full URLhttps://cdn.aisa.one/api/v1/access/verify
Content-Typeapplication/json
AuthenticationAuthorization: Bearer <crawlerToken>

Request Parameters

ParameterTypeRequiredDescription
publisherDomainstringYesPublisher's domain or email
resourceUrlstringYesURL path of the content being accessed
crawlerAutoPricebooleanNoAuto-pay at publisher's price
crawlerExactPricestringNoPay only if exact price matches, e.g. "USD 0.10"
crawlerMaxPricestringNoPay up to this budget, e.g. "USD 1.00"
crawlerAgentstringNoAgent identifier or User-Agent string
Price parameters are mutually exclusive. Send at most one of crawlerAutoPrice, crawlerExactPrice, or crawlerMaxPrice. Omit all three for price discovery mode.

Success Response (200)

json
{
  "accessGranted": true,
  "statusCode": 200,
  "message": "Access granted - charge applied",
  "charge": {
    "amount": 0.01,
    "currency": "USD",
    "billingType": "per-request",
    "crawlerBalanceBefore": 5.00,
    "crawlerBalanceAfter": 4.99
  },
  "rule": {
    "id": 10,
    "urlPattern": "/article/",
    "accessMode": "pay",
    "price": 0.01
  },
  "crawlerIdentification": {
    "recognized": true,
    "identifier": "custom"
  }
}

Payment Required Response (402)

json
{
  "accessGranted": false,
  "statusCode": 402,
  "error": "insufficient_balance",
  "message": "Insufficient balance",
  "price": {
    "amount": 0.01,
    "currency": "USD",
    "billingType": "per-request"
  },
  "crawler": {
    "currentBalance": 0.00,
    "shortfall": 0.01
  },
  "onboarding": "https://cdn.aisa.one/cdn/guide.html",
  "crawlerIdentification": {
    "recognized": true,
    "identifier": "custom"
  }
}

Price Modes

ModeParameterBehaviorUse Case
Price Discovery No price parameter Returns 402 + resource price info. No charge. Check price before paying
Auto Pay "crawlerAutoPrice": true Pays publisher's price if balance sufficient Fully autonomous agents
Exact Price "crawlerExactPrice": "USD 0.10" Pays only if price matches exactly Confirm price before payment
Max Budget "crawlerMaxPrice": "USD 1.00" Pays if price ≤ budget Budget-controlled access

Recommended Flow for Autonomous Agents

pseudocode
# Option A: Just auto-pay (simplest)
response = access_verify(token, publisher, url, autoPrice=true)

# Option B: Discover price first, then confirm
response = access_verify(token, publisher, url)  # no price param
if response.statusCode == 402 and response.price:
    price = response.price.amount
    if price <= my_budget:
        response = access_verify(token, publisher, url, exactPrice=f"USD {price}")

# Option C: Set max budget
response = access_verify(token, publisher, url, maxPrice="USD 0.50")

Handling 402 Responses

When your agent receives a 402 response, the error field tells you exactly what to do:

error valueMeaningAction
invalid_token Token missing, invalid, or account disabled Register a new account or check your token
insufficient_balance Balance too low for this resource Top up your balance, then retry
price_required No price intent provided (price discovery) Read price from response, retry with a price parameter
price_mismatch Your exact price doesn't match publisher's price Retry with correct price or use crawlerAutoPrice
price_too_high Resource price exceeds your max budget Increase crawlerMaxPrice or skip this resource

Best Practice: Auto-Recovery Loop

python
import requests

BASE_URL = "https://cdn.aisa.one"
TOKEN = "aisa_crawler_xxx"

def access_content(publisher, url):
    resp = requests.post(f"{BASE_URL}/api/v1/access/verify", json={
        "publisherDomain": publisher,
        "resourceUrl": url,
        "crawlerAutoPrice": True
    }, headers={"Authorization": f"Bearer {TOKEN}"})

    data = resp.json()

    if data.get("accessGranted"):
        return data  # Success

    error = data.get("error")

    if error == "insufficient_balance":
        print(f"Balance low. Need ${data['crawler']['shortfall']} more.")
        print(f"Top up at: {BASE_URL}/agent/wallet.html")
        # TODO: auto top-up via Stripe API
        return None

    if error == "price_required":
        # Price discovery mode - now we know the price, retry with auto
        print(f"Price: ${data['price']['amount']} - retrying with auto-pay")
        return access_content(publisher, url)  # Will auto-pay on retry

    if error == "invalid_token":
        print("Token invalid. Please register or check token.")
        return None

    print(f"Access denied: {error} - {data.get('message')}")
    return None
javascript
// Node.js example
const BASE_URL = "https://cdn.aisa.one";
const TOKEN = "aisa_crawler_xxx";

async function accessContent(publisher, resourceUrl) {
  const resp = await fetch(`${BASE_URL}/api/v1/access/verify`, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "Authorization": `Bearer ${TOKEN}`
    },
    body: JSON.stringify({
      publisherDomain: publisher,
      resourceUrl: resourceUrl,
      crawlerAutoPrice: true
    })
  });

  const data = await resp.json();

  if (data.accessGranted) {
    console.log(`Access granted. Charged: $${data.charge?.amount}`);
    return data;
  }

  switch (data.error) {
    case "insufficient_balance":
      console.log(`Need $${data.crawler?.shortfall} more. Top up at /agent/wallet.html`);
      break;
    case "invalid_token":
      console.log("Invalid token. Register at /api/agent/auth/register");
      break;
    default:
      console.log(`Denied: ${data.error} - ${data.message}`);
  }
  return null;
}

Pricing

Pricing is set by individual publishers. Each publisher configures their own rules (per URL pattern, per crawler type). The platform charges your balance and distributes revenue to the publisher.

Typical Price Ranges

Content TypeTypical PriceBilling Type
News article$0.001 - $0.05per-request
Premium data / API$0.01 - $1.00per-request
Research report$0.10 - $5.00one-time
Hourly access pass$0.50 - $10.00time-pass-hour

Account Tiers

Pay-as-you-go
$0
minimum to start
  • Register + top up $0.50+
  • Standard publisher pricing
  • API access with token
  • Dashboard analytics
Enterprise
Custom
contact us
  • Volume discounts
  • Dedicated rate limits
  • Custom billing (monthly)
  • SLA & direct support
No platform fee for agents. You pay only the publisher's listed price. The platform takes a revenue share from the publisher side.

Error Reference

HTTP Statuserror fieldDescriptionaccessGranted
200Access granted (free or paid)true
400missing_fieldsMissing publisherDomain or resourceUrlfalse
402invalid_tokenToken missing, invalid, or account disabledfalse
402insufficient_balanceBalance too lowfalse
402price_requiredNo price intent (discovery mode)false
402price_mismatchExact price doesn't matchfalse
402price_too_highResource price exceeds max budgetfalse
403blockedPublisher has blocked this crawler typefalse
500internal_errorServer errorfalse
Tip: For the simplest integration, only check accessGranted. If true, proceed. If false, read the error field for details.

Playground

Live API Test
Your crawlerToken from registration

SDKs & Code Examples

curl (Complete Flow)

bash
#!/bin/bash
BASE="https://cdn.aisa.one"
TOKEN="aisa_crawler_YOUR_TOKEN_HERE"

# Auto-pay mode
curl -s -X POST "$BASE/api/v1/access/verify" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{
    "publisherDomain": "[email protected]",
    "resourceUrl": "/premium/article.html",
    "crawlerAutoPrice": true
  }' | python3 -m json.tool

Python

python
import requests

class AISAClient:
    def __init__(self, token, base_url="https://cdn.aisa.one"):
        self.token = token
        self.base_url = base_url
        self.headers = {
            "Content-Type": "application/json",
            "Authorization": f"Bearer {token}"
        }

    def access(self, publisher, resource_url, auto_price=True):
        payload = {
            "publisherDomain": publisher,
            "resourceUrl": resource_url,
        }
        if auto_price:
            payload["crawlerAutoPrice"] = True

        resp = requests.post(
            f"{self.base_url}/api/v1/access/verify",
            json=payload,
            headers=self.headers
        )
        return resp.json()

    def get_balance(self, session_token):
        resp = requests.get(
            f"{self.base_url}/api/agent/info",
            headers={"Authorization": f"Bearer {session_token}"}
        )
        return resp.json()

# Usage
client = AISAClient("aisa_crawler_YOUR_TOKEN")
result = client.access("[email protected]", "/article/2026/trends.html")

if result["accessGranted"]:
    print(f"Granted! Charged: ${result['charge']['amount']}")
else:
    print(f"Denied: {result['error']} - {result.get('message')}")

Node.js / TypeScript

javascript
class AISAClient {
  constructor(token, baseUrl = "https://cdn.aisa.one") {
    this.token = token;
    this.baseUrl = baseUrl;
  }

  async access(publisher, resourceUrl, { autoPrice = true } = {}) {
    const body = { publisherDomain: publisher, resourceUrl };
    if (autoPrice) body.crawlerAutoPrice = true;

    const resp = await fetch(`${this.baseUrl}/api/v1/access/verify`, {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        "Authorization": `Bearer ${this.token}`
      },
      body: JSON.stringify(body)
    });
    return resp.json();
  }
}

// Usage
const client = new AISAClient("aisa_crawler_YOUR_TOKEN");
const result = await client.access("[email protected]", "/article/test.html");
console.log(result.accessGranted ? "Granted" : `Denied: ${result.error}`);

Related Documentation

ResourceURLDescription
Publisher API Docs /cdn/docs.html Full access/verify API reference, response formats, playground
Agent Dashboard /agent/ View balance, transactions, manage your account
Onboarding Guide /cdn/guide.html Introduction to Pay-per-Crawl for new users