🔧 AI Nachrichten ChatGPT showing blank screen [Fix](05.09.2026 um 19:55 Uhr)
🪟 Windows TippsCodex desktop app not opening, not working or crashing on PC(06.09.2026 um 11:47 Uhr)
⚠️ Malware / Trojaner / VirenSofort deinstallieren: Diese 19 Browser-Erweiterungen sind mit Malware verseucht(06.09.2026 um 08:00 Uhr)
🔧 AI Nachrichten ChatGPT showing blank screen [Fix](05.09.2026 um 19:55 Uhr)
🪟 Windows TippsCodex desktop app not opening, not working or crashing on PC(06.09.2026 um 11:47 Uhr)
⚠️ Malware / Trojaner / VirenSofort deinstallieren: Diese 19 Browser-Erweiterungen sind mit Malware verseucht(06.09.2026 um 08:00 Uhr)

🔧 Programmierung 🕛 kürzlich 4 Min Lesezeit
0

Chat is Dead: How JSON Prompting Cut My AI Costs by 73%

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht




I burned $2,400 in 3 weeks talking to AI like a human



For 18 months, I built AI features the "normal" way: conversational prompts, friendly instructions, "please" and "thank you" sprinkled in. It worked—until our user base 10x'd in January.



Our monthly OpenAI bill went from $800 to $4,100. Same features. Same users. Just more conversations.



That's when I discovered JSON prompting. Not as a nice-to-have. As a survival requirement.



Three weeks after migrating our entire stack, our bill dropped to $1,107. A 73% reduction. Here's the exact system.






Why chat interfaces are a tax on engineering



Traditional prompting looks like this:




CODE
const prompt = `
You're a helpful assistant. Please extract the user's name,
email, and company from this text. Be polite and return
the data in a friendly format.

Text:
${userInput}
`
;






The problems:





  • Unpredictable output: Sometimes JSON, sometimes markdown, sometimes an apology


  • Token bloat: "Please," "helpful," "friendly" = 12 wasted tokens per call


  • Parser hell: JSON.parse() fails 23% of the time (my actual metric)


  • No schema validation: You find out it's broken in production



When you're doing 500K calls/month, those 12 tokens become 6M tokens. At $0.03/1K tokens, that's $180/month for the word "please."




Tool: Calculate your waste with my LLM Token Counter







JSON prompting: treating LLMs like APIs



Here's the same task with JSON prompting:




CODE
const prompt = {
"schema": {
"name": "string",
"email": "string (valid format)",
"company": "string"
},
"instructions": "Extract from text. Return ONLY valid JSON.",
"text": userInput
};

const response = await openai.chat.completions.create({
model: "gpt-4-turbo",
messages: [{
role: "user",
content: JSON.stringify(prompt)
}],
response_format: { type: "json_object" }
});






Result: 100% parse success rate. Zero fluff. 34% fewer tokens.




Tool: Generate these payloads with OpenAI Structured Output Generator







The hidden reason it saves 73% (it's not the tokens)



Everyone focuses on token reduction. That's the small win.



The big win is eliminating retry loops.



With chat prompting, my flow looked like:




  1. Send prompt → get markdown instead of JSON

  2. Retry with "return ONLY JSON" → get JSON with comments

  3. Retry again → finally get clean JSON

  4. Parse → crash on edge case

  5. Add try/catch → retry entire flow



Average: 2.7 API calls per successful extraction.



With JSON prompting + response_format:




  1. Send prompt → get guaranteed JSON

  2. Parse → works



Average: 1.0 calls.



That's a 63% reduction in API calls before token savings. Combined with schema efficiency: 73% total cost cut.






The reasoning token trap



Here's what nobody tells you about "thinking models" (o1, Claude 3.7, Gemini 2.0):



When you enable reasoning, you're billed for internal thoughts at input rates.



I pasted 500K tokens of codebase for analysis. The model used 187K "reasoning tokens" to think about it. My bill: $18.40 for thinking, $15 for the answer.



JSON prompting forces deterministic reasoning. The model doesn't "think" in prose—it maps directly to your schema. My reasoning token usage dropped 81%.




CODE
// Before: 500K context + 187K reasoning = $18.40
// After: 500K context + 35K reasoning = $6.20









Migration: 3 files changed






Step 1: Define schemas (schemas.js)






CODE
export const schemas = {
userExtraction: {
type: "object",
properties: {
name: { type: "string" },
email: { type: "string", format: "email" },
company: { type: "string" }
},
required: ["name", "email"]
}
};









Step 2: Create prompt builder (prompt.js)






CODE
export const buildPrompt = (schema, data) => ({
schema,
data,
instruction: "Return ONLY valid JSON matching schema. No markdown."
});









Step 3: Update API calls






CODE
// Old
const completion = await openai.chat.completions.create({
messages: [{ role: "user", content: chattyPrompt }]
});

// New
const completion = await openai.chat.completions.create({
messages: [{
role: "user",
content: JSON.stringify(buildPrompt(schema, data))
}],
response_format: { type: "json_object" },
temperature: 0 // Critical for determinism
});






Total migration time: 4 hours for 47 endpoints.




Tool: Convert your schemas with JSON to Zod Schema







The results after 21 days












































Metric Before After Change
Avg tokens/call 1,240 820 -34%
Parse failures 23% 0% -100%
Avg calls/task 2.7 1.0 -63%
Monthly cost $4,100 $1,107 -73%
P95 latency 2.3s 1.1s -52%


Bonus: Our error rate dropped from 1.2% to 0.03%. Support tickets about "AI acting weird" went to zero.






When NOT to use JSON prompting




  • Creative writing (you want the fluff)

  • Exploratory analysis (you want reasoning prose)

  • Customer-facing chat (humans like "please")



For everything else—data extraction, classification, transformation, API-like tasks—JSON prompting is highly effective.






The stack is deterministic



The era of "prompt engineering as conversation" is shifting. We are entering a phase where prompt engineering functions more like API design.



Your prompts are schemas. Your LLMs are functions. Your costs are predictable.



Start with one endpoint this week and measure the before/after. The savings may vary depending on your specific use case.



What's your biggest AI cost surprise? I'm collecting data for a follow-up on reasoning token optimization. Drop your numbers below.



P.S. – I open-sourced the prompt builder. Link in comments if you want it.

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 50%
🟡 In Evaluierung 25%
🟢 Keine Auswirkung 12%
Spannende Innovation 13%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
1 Quelle
parsedmarc v11.0.1
1 Quelle
mboxshell v0.7.3
1 Quelle
peirates v1.1.31
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Chat is Dead: How JSON Prompting Cut My AI Costs by 73%

Thematisch verwandte Begriffe: Chat, Dead, JSON, Prompting · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...