Python Calling AI API: From Client Initialization and Changing base_url to Streaming Output and Retries
Use the openai Python SDK or httpx to call OpenAI-compatible model endpoints: how to initialize the client, change only base_url to connect to other endpoints, read normal and streaming responses, and handle timeouts, 429, and 5xx retries. Each step includes runnable code.
How to Read AI API Error Codes: Causes, Retries, and Fallbacks for 400, 401, 404, 429, 5xx, and 529
Explains common LLM API error codes by splitting them into "fix the request" and "wait and retry" categories, focusing on distinguishing 429 rate limits from quota exhaustion, and provides backoff retry, circuit breaker, and fallback patterns to avoid wasted retries and retry storms.
How to Design AI API Retries: What to Retry, How Long to Back Off, and What to Do When a Stream Breaks
Split LLM call errors into retryable transient failures and deterministic failures that retrying won't fix, with parameter choices for Retry-After priority and jittered exponential backoff, plus handling for three common traps: stream interruptions, nested SDK retries, and tool-call side effects.
How to Change OpenAI base_url: Three Ways and Error Reference
This article explains how to configure OpenAI base_url in Python, Node, and curl, clarifying the /v1 suffix and priority, and uses an error comparison table to solve common issues like 404 and 401.
NexAIX-官方博客