# LLM Structured Output with JSON Schema: Typed Responses in TypeScript

DevFeed: [LLM Structured Output with JSON Schema: Typed Responses in TypeScript](<https://devfeed.tech/articles/llm-structured-output-with-json-schema-typed-responses-in-typescript-90075.md>)

Original publisher: [Read original article](<https://www.sitepoint.com/llm-structured-output-json-schema/>)

Author: SitePoint Team

Published: 2026-10-19T15:41:23Z

Content type: tutorial

Language: en

Sources: [SitePoint](<https://devfeed.tech/sources/sitepoint.md>)

Topics: [AI Integration Strategies](<https://devfeed.tech/topics/ai-integration-strategies.md>), [JSON Schema](<https://devfeed.tech/topics/json-schema.md>), [TypeScript](<https://devfeed.tech/topics/typescript.md>), [function calling](<https://devfeed.tech/topics/function-calling.md>), [vercel ai sdk](<https://devfeed.tech/topics/vercel-ai-sdk.md>), [AI Prompt Templates](<https://devfeed.tech/topics/ai-prompt-templates.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>), [LLM observability](<https://devfeed.tech/topics/llm-observability.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [ai-sdk](<https://devfeed.tech/tags/ai-sdk.md>), [anthropic](<https://devfeed.tech/tags/anthropic.md>), [anthropic-ai](<https://devfeed.tech/tags/anthropic-ai.md>), [api](<https://devfeed.tech/tags/api.md>), [apis](<https://devfeed.tech/tags/apis.md>), [app](<https://devfeed.tech/tags/app.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [azure-openai](<https://devfeed.tech/tags/azure-openai.md>), [claude](<https://devfeed.tech/tags/claude.md>), [function-calling](<https://devfeed.tech/tags/function-calling.md>), [json](<https://devfeed.tech/tags/json.md>), [json-schema](<https://devfeed.tech/tags/json-schema.md>), [llm](<https://devfeed.tech/tags/llm.md>), [llms](<https://devfeed.tech/tags/llms.md>), [programming](<https://devfeed.tech/tags/programming.md>), [retries](<https://devfeed.tech/tags/retries.md>), [schema](<https://devfeed.tech/tags/schema.md>), [structured-output](<https://devfeed.tech/tags/structured-output.md>), [typescript](<https://devfeed.tech/tags/typescript.md>), [validation](<https://devfeed.tech/tags/validation.md>), [zod](<https://devfeed.tech/tags/zod.md>)

## AI overview

This tutorial shows how to produce and validate structured LLM output across OpenAI, Gemini, Anthropic, vLLM, and Azure OpenAI. It demonstrates JSON Schema constraints, TypeScript schemas with Zod, function calling, and a provider-agnostic validation wrapper that retries failed responses a bounded number of times. It also discusses provider differences, schema limitations, and practices such as keeping schemas shallow and checking schema changes against each provider.

## Source excerpt

Get reliable, typed JSON from LLMs using schema-constrained outputs, function calling, and a TypeScript Zod validation layer with bounded retries. Continue reading LLM Structured Output with JSON Schema: Typed Responses in TypeScript on SitePoint.