AgentFlare

Guides · For publishers · Intermediate

Pricing Content by Directory: Best Practices

Price deep content per directory by sorting each URL into a free, pay, or block rule. This guide walks through the AgentFlare pricing.json, from tiers and per-request prices to regex patterns, priorities, and testing a rule.

LevelIntermediate
Reading time6 min
Steps66 with code
Sources5primary docs
✓ Open accessFree

You're reading the full report — free for humans. The machine-readable dataset for this section is open to all agents too — no payment required.

⚡ Agents: fetch .data.json → agents: allowed (no charge) · verify at https://esa.aisa.one/api/v1/access/verify

This guide is for publishers who want to keep articles open for search and AI answer engines while charging crawlers for complete datasets. Using the AgentFlare pricing.json as a worked example, you will split content into free and deep tiers, set a price per directory, write regex rules with a mode, price and priority, open or block special directories, and test the result against the AISA verify endpoint. You finish with a rule set you can import into Content Controls.

How the flow works

For publishersDrawn from the AISA agent and publisher documentation
Publisher-side access decision flow: 1. Crawler to Your edge: GET /dir/file; 2. Your edge to AISA verify: POST verify: URL, token, UA; 3. AISA verify to Your edge: decision: allow / pay / block; 4. Your edge to Your origin: fetch when granted; 5. Your edge to Crawler: 200 content; 6. Your edge to Crawler: or 402 / 403 JSONCrawlerany agentYour edgeCDN / gatewayAISA verify/api/v1/access/verifyYour origincontent1. GET /dir/file2. POST verify: URL, token, UA3. decision: allow / pay / block4. fetch when granted5. 200 content6. or 402 / 403 JSON
Price per paid request, by directoryAgentFlare pricing.json · deep files (.data.json, .full.md) only; HTML and .md are free
USD per request: /research/ $0.02, /scholar/ $0.02, /crypto/ $0.01, /markets/ $0.01, /predictions/ $0.01, /news/ $0.005, /social/ $0.005/research/$0.02/scholar/$0.02/crypto/$0.01/markets/$0.01/predictions/$0.01/news/$0.005/social/$0.005

Before you start

  • A publisher account on the AISA rules UI
  • Content organised in top-level directories such as /news/ and /research/
  • Basic regular expression knowledge
  • An ESA gateway token for testing

Step by step

  1. Split content into free and deep tiers

    Start by deciding what stays open. AgentFlare keeps index pages, .html articles, .md teasers, llms.txt, sitemap.xml and robots.txt free (L1_free) to drive SEO and GEO. Only the complete datasets and full analysis, the *.data.json and *.full.md files, are paid (L2_paid). Set default_mode to allow so anything no rule matches stays free and uncharged.

    text
    L1_free: index pages, .html articles, .md teasers, llms.txt, sitemap.xml, robots.txt
    L2_paid: *.data.json + *.full.md
    default_mode: allow
  2. Set a price per directory

    Give each directory one price per request, based on how valuable its deep payload is. AgentFlare charges 0.005 for news and social, 0.01 for crypto, markets and predictions, and 0.02 for research and scholar. The directory_pricing_usd map is a readable summary that crawlers can fetch for free to plan their budget. The enforceable prices live in the rules.

    text
    directory_pricing_usd
    crypto: 0.01
    markets: 0.01
    news: 0.005
    social: 0.005
    predictions: 0.01
    research: 0.02
    scholar: 0.02
  3. Write one pay rule per directory

    Each directory gets a rule with a regex urlPattern that matches only its deep files, mode pay, a price, currency USD, billingType per-request and a priority. The pattern anchors on the directory and the two deep extensions, so teasers in the same directory are never charged. This is the Newswire rule; AgentFlare gives it priority 100 and counts down for later directories.

    text
    description: Newswire - deep structured data (L2, metered)
    urlPattern: ^/news/.*\.(data\.json|full\.md)$
    patternType: regex
    mode: pay
    price: 0.005
    currency: USD
    billingType: per-request
    priority: 100
  4. Add allow and block rules for exceptions

    Not every directory is for sale. AgentFlare publishes /guides/ deep files as open data with mode allow and price 0, so agents fetch them without a token. It withholds /members/ deep files with mode block, which returns 403 access_blocked whatever the token or balance. Blocking is a policy choice, so a crawler cannot pay its way past it.

    text
    urlPattern: ^/guides/.*\.(data\.json|full\.md)$
    mode: allow
    price: 0
    priority: 93
    
    urlPattern: ^/members/.*\.(data\.json|full\.md)$
    mode: block
    price: 0
    priority: 92
  5. Import the rules and test the verify call

    Import the rules array into Content Controls, or use POST /api/publisher/rules/bulk-import; the fields map 1:1 to the publisher rule schema. Then test one URL against the verify endpoint. Send your gateway token in Authorization: Bearer and the crawler token in X-Crawler-Token, which replaces the older X-AISA-Crawler-Token. Read accessGranted first; statusCode and error explain a denial.

    python
    import requests
    
    resp = requests.post(
        'https://esa.aisa.one/api/v1/access/verify',
        headers={
            'Authorization': 'Bearer YOUR_ESA_GATEWAY_TOKEN',
            'X-Crawler-Token': 'YOUR_CRAWLER_TOKEN',
            'Content-Type': 'application/json',
        },
        json={
            'publisherDomain': 'agentflare.org',
            'resourceUrl': '/research/report.data.json',
            'crawlerAutoPrice': True,
        },
    )
    print(resp.json())
  6. Check each mode from the crawler side

    Request one URL per mode and confirm the outcome. A pay URL with no token should return 402 invalid_token, a free URL 200, and a blocked URL 403 access_blocked. Pass the 402 and 403 JSON to the crawler unmodified: its onboarding and guidance blocks tell new crawlers how to register, fund a balance and retry.

    bash
    curl -i 'https://PUBLISHER-SITE/members/report.data.json' \
      -H 'X-Crawler-Token: YOUR_CRAWLER_TOKEN' \
      -A 'MyBot/1.0 (+https://example.com/bot)'
    
    curl -i 'https://PUBLISHER-SITE/research/report.data.json'

AgentFlare directory rules at a glance

DirectoriesModePrice per request (USD)Effect
news, socialpay0.005200 and charge with a valid token and balance
crypto, markets, predictionspay0.01402 invalid_token without a token
research, scholarpay0.02402 insufficient_balance when the balance is low
guidesallow0200 free, no token required
membersblock0403 access_blocked regardless of token

Common pitfalls

  • Rules apply to deep files only. A pattern without the data.json and full.md extensions would also charge for the free teasers you meant to keep open.
  • URL query strings are stripped before rule matching, so a pattern that depends on a query parameter will never match.
  • Never put a crawler token in Authorization: Bearer. That header belongs to the gateway layer and returns 401 gateway_unauthorized.
  • A block rule returns 403 access_blocked even to a funded crawler. Use pay with a price if you want revenue from a directory.

Key takeaways

  • Keep teasers and discovery files free, and meter only *.data.json and *.full.md by directory.
  • Each rule needs a regex urlPattern, a mode of pay, allow or block, a price, billingType per-request and a priority.
  • Test every mode, and pass the 402 and 403 JSON bodies to crawlers unmodified so they can onboard.

FAQ

What happens to URLs that match no rule?

They fall through to the default allow and are served free with no charge. AgentFlare sets default_mode to allow so the SEO and GEO surface stays open while only deep files are monetised.

How is a pay rule different from a block rule?

A pay rule serves content once the crawler has a valid token and enough balance. A block rule returns 403 access_blocked regardless of token or balance, so payment never unlocks it.

How is billing counted?

Billing is per-request. Each granted fetch of a priced resource deducts that directory's price once, and denials never charge.

Can I bulk-load rules instead of typing them in the UI?

Yes. Import the rules array into Content Controls, use POST /api/publisher/rules/bulk-import, or run POST /api/publisher/discover, which reads your pricing.json or sitemap.

How this page is made. Written from 5 primary sources — the AISA agent and publisher documentation and AgentFlare's own files (pricing.json, robots.txt, llms.txt, live responses, .data.json field lists). Each step links the sources it relies on; steps naming a header, endpoint, error code or figure that the sources do not contain are removed. Refreshed weekly.

Sources & citations

  1. Header name: X-Crawler-Token esa.aisa.one
  2. AgentFlare pricing.json (directory price map) agentflare.org
  3. AISA verify API for publishers and edge gateways (llms.txt) esa.aisa.one
  4. AISA publisher API documentation esa.aisa.one
  5. AISA Agent Integration Guide — API reference esa.aisa.one