Direct answer
Official OpenAI SDKs commonly allow a custom API key and Base URL, so they can call LaoZhang API’s OpenAI-compatible endpoints. This does not mean zero code changes or complete compatibility across every SDK, model, and method. Confirm whether the model uses Responses, Chat Completions, or Images, then acceptance-test a pinned SDK version.
This page was last verified on September 2, 2026. Use the official OpenAI API documentation for upstream SDK and protocol behavior and the LaoZhang API console for gateway models and groups.
Python
Install or upgrade:
Responses API:
Chat Completions:
JavaScript / TypeScript
Other SDKs
OpenAI updates official language libraries, method names, and types. Before using .NET, Java, Go, Ruby, or another client, confirm that:
- the library is maintained by OpenAI if it is described as official;
- the current version supports a custom Base URL;
- the target endpoint and streaming events are implemented;
- the library does not reject gateway model IDs through a strict enum;
- response parsing preserves additional gateway fields.
This page no longer labels third-party libraries as official OpenAI SDKs.
Compatibility acceptance
- Pin the SDK and version.
- Copy the exact model ID from the console.
- Validate Responses, Chat Completions, or Images separately.
- Validate streaming, tools, multimodal input, and errors.
- Compare usage with call logs.
- Re-test after SDK upgrades that can change field names or parsing.
A successful /v1/models request does not prove that an SDK workflow works. Tools such as Codex CLI also require an accepted Responses API, SSE streaming, and tool-calling contract.
Key security
Use a server-side environment variable or secret manager. Do not expose complete keys in code, screenshots, logs, or echo output. See API key management.