{"uid":"cap_PDoMkjfdJ8vl4LcYIl1WB","slug":"inference402-structured-json-chat-e51971c2","name":"Inference402 Structured JSON Chat","description":"Pay-per-call AI inference for agents: chat (Llama 3.3 70B / 3.1 8B), structured JSON, summarize, translate (incl. Egyptian Arabic), extract, classify, sentiment, keywords, rewrite, embeddings, moderation, vision and speech-to-text. USDC on Base mainnet over x402. No API key, no account.","url":"https://inference402.worlddata402.workers.dev/v1/chat/json?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","properties":{"schema":{"type":"object","description":"JSON Schema the output must satisfy (≤4000 chars when serialized)"},"messages":{"type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"enum":["system","user","assistant"],"type":"string"},"content":{"type":"string"}}},"maxItems":50,"minItems":1},"max_tokens":{"type":"integer","default":512,"maximum":768,"minimum":1}}},"responseSchema":{"type":"json","example":{"data":{"age":34,"city":"Alexandria","name":"Sara Ahmed"},"model":"@cf/meta/llama-3.3-70b-instruct-fp8-fast","valid":true,"attempts":1}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_Xo8a3hYh4OAqyZ9G2ChT4","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Generate LLM responses constrained to a caller-supplied JSON Schema, using Llama 3.3 70B, paid per-call via USDC on Base mainnet with no API key required.","exampleAgentPrompt":"Extract the person's name, age, and city from this text into structured JSON — 'My name is Sara Ahmed, I am 34 years old and I live in Alexandria' — use the schema {name: string, age: integer, city: string} and keep it under 256 tokens.","exampleUseCases":[{"title":"Entity extraction from user profile text","prompt":"Parse this bio into a structured JSON object with fields for name, age, and city: 'Hi, I'm Sara Ahmed, 34, from Alexandria.' Use the schema {name: string, age: integer, city: string}."},{"title":"Classifying support ticket with typed output","prompt":"Classify this support ticket into a JSON object with fields 'category' (one of: billing, technical, account) and 'urgency' (low, medium, high): 'I can't log in and my subscription expires tomorrow.'"},{"title":"Structured product data extraction","prompt":"Given this product description — 'Wireless noise-cancelling headphones, black, $149, in stock' — extract a JSON object with fields: product_name, color, price_usd, and in_stock (boolean)."}],"resultDescription":"A JSON object with a 'data' field containing the schema-validated response, a 'model' field indicating which Llama model was used, a 'valid' boolean confirming schema compliance, and an 'attempts' integer showing how many inference retries were needed to produce a valid result.","failureModes":["Schema too large (>4000 chars serialized) causes rejection","Messages array empty or exceeds 50 items","max_tokens out of range (must be 1–768)","Payment failure or insufficient USDC balance on Base mainnet blocks the call","Model fails to produce schema-valid JSON after retry attempts, returning valid: false","Malformed JSON Schema causes parse errors","Rate limiting or Cloudflare Worker timeout on complex schemas"],"whenToPreferThis":"Choose this endpoint when you need LLM output that must conform to a specific JSON Schema without post-processing — especially in agentic pipelines where downstream code consumes typed data. It is ideal when you have no existing AI API key, want pay-per-call billing in USDC with no subscription, and need schema validation built into the inference loop. Prefer alternatives if you need streaming responses, very large token outputs (>768), or integration with OpenAI-compatible SDKs.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-19T12:36:41.988Z","isFirstParty":false,"canonicalSlug":"inference402-structured-json-chat-e51971c2"}