You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add usage categories with tiered pricing and compliance levels
Introduce UsageCategory enum (summary, rag, research, training,
commercial) across the entire protocol stack. Each category has
escalating compliance requirements and pricing multipliers:
- summary (1x, standard) — snippet/summary display
- rag (2x, standard) — retrieval-augmented generation
- research (3x, elevated) — academic/internal research
- training (5x, strict) — model fine-tuning/pre-training
- commercial (10x, strict) — redistribution/derivatives
Changes span interfaces, API, MCP, payments, compliance, and docs:
- UsageGrant now includes usage_category in its signed payload
- PaymentRequirement returns available_tiers in 402 responses
- X402 middleware resolves category from query/header/config
- API routes accept ?usage= parameter and X-USAGE-CATEGORY header
- MCP tools accept usage parameter for tier selection
- ComplianceHeaders emit X-FairFetch-Usage-Category and
X-FairFetch-Compliance-Level headers
- README, DEVELOPMENT.md, and guide docs updated throughout
- Also fixes stale GitHub URLs in docs and openapi.yaml
Copy file name to clipboardExpand all lines: README.md
+69-26Lines changed: 69 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -227,28 +227,33 @@ asyncio.run(main())
227
227
## 💳 The x402 Payment Flow
228
228
229
229
```
230
-
Agent Fairfetch Facilitator
231
-
| | |
232
-
| GET /content/fetch?url=... | |
233
-
|----------------------------->| |
234
-
| | |
235
-
| 402 Payment Required | |
236
-
| { accepts: { price, asset, | |
237
-
| network, payTo } } | |
238
-
|<-----------------------------| |
239
-
| | |
240
-
| GET + X-PAYMENT: <proof> | |
241
-
|----------------------------->| |
242
-
| | POST /settle |
243
-
| |-------------------------> |
244
-
| | { valid, tx_hash } |
245
-
| |<------------------------- |
246
-
| | |
247
-
| 200 OK + Content | |
248
-
| X-PAYMENT-RECEIPT: 0x... | |
249
-
| X-FairFetch-License-ID: ... | |
250
-
| X-FairFetch-Origin-Sig: ... | |
251
-
|<-----------------------------| |
230
+
Agent Fairfetch Facilitator
231
+
| | |
232
+
| GET /content/fetch?url=... | |
233
+
| &usage=rag | |
234
+
|------------------------------>| |
235
+
| | |
236
+
| 402 Payment Required | |
237
+
| { accepts: { price (2x), | |
238
+
| usage_category: "rag" }, | |
239
+
| available_tiers: {...} } | |
240
+
|<------------------------------| |
241
+
| | |
242
+
| GET + X-PAYMENT: <proof> | |
243
+
|------------------------------>| |
244
+
| | POST /settle |
245
+
| |-------------------------> |
246
+
| | { valid, tx_hash } |
247
+
| |<------------------------- |
248
+
| | |
249
+
| 200 OK + Content | |
250
+
| X-PAYMENT-RECEIPT: 0x... | |
251
+
| X-FairFetch-License-ID: ... | |
252
+
| X-FairFetch-Usage-Category: | |
253
+
| rag | |
254
+
| X-FairFetch-Compliance-Level:| |
255
+
| standard | |
256
+
|<------------------------------| |
252
257
```
253
258
254
259
> [!NOTE]
@@ -257,16 +262,49 @@ Agent Fairfetch Facilitator
257
262
258
263
<br />
259
264
265
+
## 📊 Usage Categories & Tiered Pricing
266
+
267
+
Not all content usage is equal. Fairfetch defines **usage categories** that control what an AI agent is permitted to do with the content, with escalating compliance requirements and pricing:
268
+
269
+
| Category | Compliance | Price Multiplier | Use Case |
|`research`| Elevated | 3x | Academic or internal research use |
274
+
|`training`| Strict | 5x | Model fine-tuning or pre-training |
275
+
|`commercial`| Strict | 10x | Redistribution or commercial derivative works |
276
+
277
+
> [!IMPORTANT]
278
+
> The `usage` parameter is specified via query param (`?usage=rag`), HTTP header (`X-USAGE-CATEGORY: training`), or MCP tool argument. It determines the effective price and the compliance level recorded in the Usage Grant.
Every 402 response includes an `available_tiers` object showing the price for each category, so agents can choose the appropriate tier for their needs.
294
+
295
+
<br />
296
+
260
297
## 🔐 Usage Grants (Legal Indemnity)
261
298
262
-
A Usage Grant is an Ed25519-signed token proving legal content access:
299
+
A Usage Grant is an Ed25519-signed token proving legal content access under a specific usage category:
263
300
264
301
```json
265
302
{
266
303
"grant_id": "a1b2c3d4...",
267
304
"content_url": "https://publisher.com/article",
268
305
"content_hash": "sha256:...",
269
306
"license_type": "publisher-terms",
307
+
"usage_category": "rag",
270
308
"granted_to": "0xPayerWallet...",
271
309
"granted_at": "2026-02-22T12:00:00Z",
272
310
"signature": {
@@ -277,6 +315,8 @@ A Usage Grant is an Ed25519-signed token proving legal content access:
277
315
}
278
316
```
279
317
318
+
The `usage_category` field is part of the cryptographic signature, so it cannot be altered after issuance. An agent granted `summary` access cannot claim `training` rights — a new grant with appropriate pricing is required.
319
+
280
320
<details>
281
321
<summary><strong>How to verify a grant locally</strong></summary>
282
322
@@ -287,7 +327,7 @@ A Usage Grant is an Ed25519-signed token proving legal content access:
287
327
# Or extract it from any response's grant signature (the publicKey field)
0 commit comments