Développeurs de logiciels Reference for the OpenAI API and ANY OpenAI-compatible endpoint (set `base_url`/`baseURL` to point the official OpenAI SDK at OpenAI, Azure OpenAI, a local server — vLLM, Ollama, llama.cpp, LM Studio, TGI — or a gateway/aggregator like Groq, Together, Fireworks, OpenRouter, DeepSeek, z.ai). Covers client init + base_url, Chat Completions, streaming, function/tool calling, structured outputs, vision, embeddings, reasoning models, error handling, and per-endpoint feature compatibility, across Python, TypeScript, Go, Java, Ruby, C#, PHP, and cURL.
TRIGGER — read BEFORE writing code — whenever: the prompt names OpenAI or the OpenAI SDK in any form (`openai`, `from openai`, `import OpenAI`, `OpenAI(`, `openai-python`, `openai-node`, `openai-go`, `gpt-*`, `o1`/`o3`/`o4`, `text-embedding-*`, `chat/completions`, `response_format`, `tool_calls`); the user points a client at a custom endpoint via `base_url`/`baseURL`/`OPENAI_BASE_URL`/`OPENAI_API_BASE`; the user targets a local or third-party OpenAI-compatible server (
2026-07-01