Gateway API documentation
Webmole currently exposes one tool: batch text classification. Start with the fixed, no-charge sample. The supplier-backed route is limited to developer-configured Base Sepolia testing and is not a production payment service.
Current status
- The catalog and fixed demo are public.
- The demo accepts no user text, makes no provider call, and charges $0.00.
- The supplier-backed route returns
503until its server-side testnet configuration is enabled. - End-to-end x402 testnet setup has not yet been proven.
- Webmole has no native buyer wallet and never signs a payment for the caller.
Base URL
Responses use JSON. Preview contracts may change; inspect the catalog before wiring a client. Do not send production or sensitive data to the testnet route.
/api/tools
Returns the current catalog, tool limits, sample path, live route, and payment stage. Catalog discovery does not execute a tool or create a payment.
Request
curl --request GET \
https://webmole.ai/api/toolsResponse
{
"name": "Webmole",
"stage": "early-preview",
"tools": [
{
"id": "classify-text",
"name": "Batch text classification",
"status": "sample-available",
"sample": "/api/tools/classify/demo",
"endpoint": "/api/tools/classify",
"liveStatus": "testnet-configuration-required",
"limits": {
"texts": 10,
"charactersPerText": 2000,
"labels": 8
}
}
],
"docs": "/docs",
"payment": {
"status": "not-live",
"testNetwork": "eip155:84532",
"custody": false
}
}/api/tools/classify/demo
Returns a fixed fixture with three sample enquiries and a sample receipt. Send no request body: custom text is never read or forwarded by this route.
Request
curl --request POST \
https://webmole.ai/api/tools/classify/demoResponse shape
Receipt IDs and timestamps are generated by the server. The texts, labels, confidence values, provider label, and zero cost are fixed sample data.
{
"mode": "sample",
"tool": "classify-text",
"provider": "Illustrative sample; no provider call",
"rows": [
{
"text": "Can I get a quote for 50 units?",
"label": "Sales",
"confidence": 0.94
},
{
"text": "How do I reset my password?",
"label": "Support",
"confidence": 0.98
},
{
"text": "My invoice was charged twice.",
"label": "Billing",
"confidence": 0.97
}
],
"receipt": {
"id": "sample-…",
"cost": "0.00",
"currency": "USD",
"status": "sample",
"createdAt": "<ISO-8601 timestamp>"
}
}/api/tools/classify
Intended for a bounded supplier-backed classification test behind x402 on Base Sepolia (eip155:84532). The configured testnet price is a fixed $0.01 in test USDC. That amount is not a production price.
Input
| Field | Required | Limits |
|---|---|---|
| texts | Yes | 1–10 strings; 1–2,000 characters each after trimming |
| labels | Yes | 2–8 unique strings; 1–80 characters each after trimming |
The JSON body is capped at 32 KB. Extra fields, duplicate labels, empty values, and unsupported content types are rejected before payment handling.
Example request
This unsigned request shows the payload shape. When testnet configuration is enabled, an x402-compatible buyer client must handle the payment challenge and obtain the caller's approval before signing or sending payment.
curl --request POST \
https://webmole.ai/api/tools/classify \
--header 'Content-Type: application/json' \
--data '{
"texts": [
"Can I get a quote for 50 units?",
"How do I reset my password?"
],
"labels": ["Sales", "Support", "Billing"]
}'A successful testnet response identifies mode as testnet, returns the classified rows, and includes a preview receipt. Settlement information comes from the PAYMENT-RESPONSE header; the JSON receipt is not production reconciliation.
Default response
Without complete server-side supplier, recipient, and testnet settings, the route fails closed:
HTTP/1.1 503 Service Unavailable
Content-Type: application/json
{
"error": "Live payments are not enabled. Try the free sample at /api/tools/classify/demo.",
"mode": "unconfigured"
}Testnet payment flow
- 1
Discover
Read GET /api/tools and confirm the route is still testnet-only.
- 2
Request
Send a valid bounded classification payload.
- 3
Review
Inspect the x402 payment requirement and show the amount to the user.
- 4
Approve
Let the user approve and sign with their own compatible testnet client.
- 5
Execute
Resubmit payment proof; the server calls the configured supplier.
- 6
Verify
Read the result and payment response. Do not treat the preview receipt as production reconciliation.
Status codes
| Status | Meaning |
|---|---|
| 400 | Invalid JSON or input outside the classification contract. |
| 402 | Payment required after the x402 testnet route is configured. |
| 413 | Request body exceeds 32 KB. |
| 415 | Content-Type is not application/json. |
| 502 | The supplier did not return a valid successful classification result. |
| 503 | Testnet configuration is absent or the payment service is unavailable. |