AI Chat & Structured JSON Inference Failover Pool (ai_chat_json)
The ai_chat_json pool aggregates 8 vault-backed LLM inference upstreams—starting with 5 zero-cost free-tier slots—to deliver 99.6% availability and 2,200 ms target p95 latency at a flat $0.010 (10,000 micros) outcome price.
ai_chat_json Upstream Candidates (Ordered by Cost Tier & Rank)
| Upstream ID | Domain ID | Cost Tier | Unit Cost | Base Weight | Expected p95 | Quota (RPM/RPD/Mo) |
|---|---|---|---|---|---|---|
| ai_chat_groq_free | console.groq.com | free_tier_0 | $0.00 | 0.94 | 680 ms | 30 / 14400 / 432000 |
| ai_chat_openrouter_free | openrouter.ai | free_tier_0 | $0.00 | 0.92 | 1350 ms | 20 / 1000 / 30000 |
| ai_chat_modelscope_free | modelscope.cn | free_tier_0 | $0.00 | 0.90 | 1480 ms | 30 / 2000 / 60000 |
| ai_chat_huggingface_free | huggingface.co | free_tier_0 | $0.00 | 0.88 | 1750 ms | 30 / 1000 / 30000 |
| ai_chat_cerebras_t09_slot | cerebras.ai | free_tier_0 | $0.00 | 0.87 | 520 ms | 30 / 14400 / 432000 |
| ai_chat_featherless_lowcost | featherless.ai | low_cost_wholesale | $0.00120 | 0.91 | 1250 ms | 60 / 5000 / 150000 |
| ai_chat_stepfun_lowcost | platform.stepfun.com | low_cost_wholesale | $0.00180 | 0.90 | 1400 ms | 60 / 5000 / 150000 |
| ai_chat_ppio_fallback | ppio.cn | standard_fallback | $0.00250 | 0.93 | 1300 ms | 120 / 10000 / 300000 |
Strict JSON Output Validation & Whitelisted Model Tiers
Structured agent workflows break immediately when an inference provider returns truncated text, an HTML gateway timeout, or a rate-limit JSON error object with HTTP 200. The ai_chat_json anti-fake-200 gate enforces application/json responses of at least 16 bytes with a populated content field.
Callers may optionally specify whitelisted model tiers (gemini-4-hydrogen-low, gemini-4-hydrogen-medium, gemini-4-hydrogen-high, gemini-4-neon-medium, gemini-4-neon-high, or gemini-pro-orchestrator-neon) alongside prompt, messages, system, response_format, max_tokens, and temperature.
Aggressive 45-Second Circuit Cooldown for Fast Inference Recovery
Because inference rate limits often recover faster than scraping bans, ai_chat_json uses a shorter 45-second open_cooldown_s (versus 60s on other pools) with 2.0x exponential backoff capped at 900s and single-probe HALF_OPEN recovery.
Deterministic prompts with temperature: 0 benefit heavily from the 7d default (up to 30d max) cross-tenant archive cache, cutting repeat latency to local SQLite speed and same-tenant cost to $0.001.
Dispatch a Structured JSON Inference Request via /v1/router/dispatch
curl -fsSL -X POST "https://fuelrouter.fastmesh.dev/v1/router/dispatch" \
-H "Content-Type: application/json" \
-d '{
"pool_id": "ai_chat_json",
"tenant_id": "classifier_worker",
"inputs": {
"prompt": "Classify invoice line items into tax categories as JSON.",
"response_format": "json_object",
"temperature": 0,
"model_tier": "gemini-4-hydrogen-medium"
},
"max_cost_micros": 50000
}'
Optimizing ai_chat_json Cost and Latency
- Use deterministic prompts and temperature: 0 to unlock 7d-30d cross-tenant cache hits at 100% repeat margin.
- Keep default max_cost_micros at 50,000 micros ($0.05) to allow smooth overflow from 5 free slots to 3 wholesale slots.
- Inspect trace[].latency_ms to verify ultra-low-latency free slots remain healthy.
- Rely on automatic HTTP 429 failover instead of writing custom client-side retry loops.
Frequently Asked Technical Questions
How many free-tier inference accounts are included in ai_chat_json?
Five of the eight upstreams in ai_chat_json operate at $0.00 unit cost, combining for 140 RPM and 32,800 RPD before paid wholesale fallback is touched.
What is the outcome price for ai_chat_json?
A verified fresh hit or new-tenant cache hit bills 10,000 micros ($0.010); a same-tenant repeat cache hit bills 1,000 micros ($0.001); pool exhaustion bills $0.00.
Why is open_cooldown_s set to 45 seconds for ai_chat_json?
Inference rate-limit windows reset quickly; a 45-second initial cooldown restores healthy free-tier throughput faster while exponential backoff protects persistently degraded hosts.
Live Try-Now Console & Machine Discovery
Test failover routing, dry-run quotes, and circuit breaker metrics on the live gateway or connect via JSON-RPC 2.0 MCP.
Related FuelRouter Architecture Guides
- Embeddings & Semantic Rerank Pool with 30-Day Adaptive Cache — embeddings and semantic rerank API failover cache
- Web Search & SERP Grounding Failover Pool (web_search) — web search SERP grounding API failover router
- Clean Scrape & Markdown Extraction Failover Pool (clean_scrape_extract) — clean URL to markdown extraction API failover