SAThinkwithClaude
AI Q&A

What should I check first when an LLM API call returns something unexpected?

Answered by Shantanu Anand, AI Trainer & Consultant · 15 November 2026

First, inspect what you actually sent: the model name, parameters, system prompt and the full message history. Bugs often come from a prompt built differently than you assumed.

Second, read the status code and the finish reason. A response cut off by the length limit or stopped by a safety filter looks like a bad answer but is really a settings issue. Third, check whether your code expects a specific format, and consider using structured output options if the provider offers them. Fourth, lower the temperature and rerun a minimal version of the prompt to see if the problem is repeatable. Save request IDs in your logs, and check the docs or changelog in case behavior changed.

Want your team doing this hands-on? See Shantanu's AI training →

More AI questions, answered

← All AI questions

Want your team to use AI like this?

Hands-on AI training for professionals and teams, online or in person anywhere in India. Get the training details on WhatsApp, or book a free 20-minute call.

Get training detailsBook a free call
© 2026 ThinkwithClaude · Shantanu Anand, AI Trainer & Consultant