• Docs
  • AI GatewayGateway

Viewing AI SDK 4 Documentation.

Go to AI SDK 6 (Latest)
AI SDK by Vercel
AI SDK 5 Beta
Foundations
Overview
Providers and Models
Prompts
Tools
Streaming
Agents
Getting Started
Navigating the Library
Next.js App Router
Next.js Pages Router
Svelte
Vue.js (Nuxt)
Node.js
Expo
AI SDK Core
Overview
Generating Text
Generating Structured Data
Tool Calling
Prompt Engineering
Settings
Embeddings
Image Generation
Transcription
Speech
Language Model Middleware
Provider & Model Management
Error Handling
Testing
Telemetry
AI SDK UI
Overview
Chatbot
Chatbot Message Persistence
Chatbot Tool Usage
Generative User Interfaces
Completion
Object Generation
OpenAI Assistants
Streaming Custom Data
Error Handling
Smooth streaming japanese text
Smooth streaming chinese text
Stream Protocols
AI SDK RSC
Advanced
Reference
AI SDK Core
AI SDK UI
AI SDK RSC
Stream Helpers
AI SDK Errors
AI_APICallError
AI_DownloadError
AI_EmptyResponseBodyError
AI_InvalidArgumentError
AI_InvalidDataContentError
AI_InvalidDataContent
AI_InvalidMessageRoleError
AI_InvalidPromptError
AI_InvalidResponseDataError
AI_InvalidToolArgumentsError
AI_JSONParseError
AI_LoadAPIKeyError
AI_LoadSettingError
AI_MessageConversionError
AI_NoAudioGeneratedError
AI_NoContentGeneratedError
AI_NoImageGeneratedError
AI_NoObjectGeneratedError
AI_NoOutputSpecifiedError
AI_NoSuchModelError
AI_NoSuchProviderError
AI_NoSuchToolError
AI_NoTranscriptGeneratedError
AI_RetryError
AI_TooManyEmbeddingValuesForCallError
ToolCallRepairError
AI_ToolExecutionError
AI_TypeValidationError
AI_UnsupportedFunctionalityError
Migration Guides
Troubleshooting
AI SDK ErrorsAI_JSONParseError

AI_JSONParseError

This error occurs when JSON fails to parse.

Properties

  • text: The text value that could not be parsed
  • message: The error message including parse error details

Checking for this Error

You can check if an error is an instance of AI_JSONParseError using:

import { JSONParseError } from 'ai';
if (JSONParseError.isInstance(error)) {
// Handle the error
}
Previous
AI_InvalidToolArgumentsError
Next
AI_LoadAPIKeyError
On this page
AI_JSONParseError
Properties
Checking for this Error
Deploy and Scale AI Apps with Vercel

Deliver AI experiences globally with one push.

Trusted by industry leaders:
  • OpenAI
  • Photoroom
  • leonardo-ai Logoleonardo-ai Logo
  • zapier Logozapier Logo

Get Started

  • Templates
  • Supported frameworks
  • Marketplace
  • Domains

Build

  • Next.js on Vercel
  • Turborepo
  • v0

Scale

  • Content delivery network
  • Fluid compute
  • CI/CD
  • Observability
  • AI GatewayNew
  • Vercel AgentNew

Secure

  • Platform security
  • Web Application Firewall
  • Bot management
  • BotID
  • SandboxNew

Resources

  • Pricing
  • Customers
  • Enterprise
  • Articles
  • Startups
  • Solution partners

Learn

  • Docs
  • Blog
  • Changelog
  • Knowledge Base
  • Academy
  • Community

Frameworks

  • Next.js
  • Nuxt
  • Svelte
  • Nitro
  • Turbo

SDKs

  • AI SDK
  • Workflow DevKitNew
  • Flags SDK
  • Chat SDK
  • Streamdown AINew

Use Cases

  • Composable commerce
  • Multi-tenant platforms
  • Web apps
  • Marketing sites
  • Platform engineers
  • Design engineers

Company

  • About
  • Careers
  • Help
  • Press
  • Legal
  • Privacy Policy

Community

  • Open source program
  • Events
  • Shipped on Vercel
  • GitHub
  • LinkedIn
  • X
  • YouTube

© 2026 Vercel, Inc.

Select a display theme: