Errors and Debugging
API Errors and Debugging
Error Response Structure
type ErrorResponse = {
error: {
code: number;
message: string;
metadata?: Record<string, unknown>;
};
};Handling Errors in Code
const request = await fetch('https://app.interactive.ai/...');
console.log(request.status); // Will be an error code unless the model started processing your request
const response = await request.json();
console.error(response.error?.status); // Will be an error code
console.error(response.error?.message);Error Codes
Code
Description
Moderation Errors
Provider Errors
Empty Responses
Streaming Error Formats
Pre-Stream Errors
Mid-Stream Errors
Responses API Error Events
Error Code Transformations
Error Code
Transformed To
Finish Reason
API-Specific Error Handling
Chat Completions API (/api/v1/chat/completions)
Responses API (/api/alpha/responses)
Error Type Definitions
Debugging
Debug Option Schema
Enabling Debug Output
Debug Response Format
Constraints
Use Cases
Last updated
Was this helpful?

