$0.02
per call · USD Coin on Base
Extract facts from supplied text into a caller-provided strict JSON Schema. Use for bounded text-to-JSON normalization when every output field must be machine-validated. Use constitutes acceptance of https://diem-agent-workers.vercel.app/terms.
Endpoint
POST https://diem-agent-workers.vercel.app/v1/jobs/extract-json12
Calls / 30d
11
Unique payers / 30d
Aug 14
Last called
exact
Payment scheme
Call this service
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";
const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const fetchWithPay = wrapFetchWithPayment(fetch, account);
const res = await fetchWithPay("https://diem-agent-workers.vercel.app/v1/jobs/extract-json", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"instructions": "Use the displayed price.",
"schema": {
"additionalProperties": false,
"properties": {
"category": {
"type": [
"string",
"null"
]
},
"name": {
"type": [
"string",
"null"
]
},
"price_usd": {
"type": [
"number",
"null"
]
}
},
"required": [
"name",
"category",
"price_usd"
],
"type": "object"
},
"source": "The Acme Trail Mug is drinkware and costs $18.50."
}),
});
const data = await res.json();curl -X POST \
"https://diem-agent-workers.vercel.app/v1/jobs/extract-json" \
-H "Content-Type: application/json" \
-d '{"instructions":"Use the displayed price.","schema":{"additionalProperties":false,"properties":{"category":{"type":["string","null"]},"name":{"type":["string","null"]},"price_usd":{"type":["number","null"]}},"required":["name","category","price_usd"],"type":"object"},"source":"The Acme Trail Mug is drinkware and costs $18.50."}' \
-H "X-PAYMENT: <signed x402 payment>"Example response
{
"provider": {
"model": "venice-uncensored-1-2",
"name": "venice"
},
"result": {
"category": "drinkware",
"name": "Acme Trail Mug",
"price_usd": 18.5
},
"usage": {
"inputTokens": 200,
"outputTokens": 35,
"totalTokens": 235
},
"validation": {
"valid": true
},
"worker": "extract_text_to_json"
}Payment details
0x56b8d69d25a57d291595e41bac57a71d507d96f7USD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913Is this your API?
Pin it to the top of Search & Web and the homepage with a featured placement.
More from DIEM Agent Workers & similar services
DIEM Agent Workers · Jobs Transcribe Audio
diem-agent-workers.vercel.app
Transcribe a base64-encoded PCM WAV clip of at most 60 seconds into text. Input duration is verified before payment. Use constitutes acceptance of https://diem-agent-workers.vercel.app/terms.
DIEM Agent Workers · Jobs Text TO Speech
diem-agent-workers.vercel.app
Convert up to 1,000 characters of text into MP3 speech using a bounded private Venice voice model. Use constitutes acceptance of https://diem-agent-workers.vercel.app/terms.
DIEM Agent Workers · Jobs Generate Draft Image
diem-agent-workers.vercel.app
Generate one safe-mode 1024px WebP draft image from a bounded prompt, with search and prompt enhancement disabled. Use constitutes acceptance of https://diem-agent-workers.vercel.app/terms.