Baiyun API tutorial: Codex CLI integration
Customize Responses vendors, environment variables, and the actual boundaries for compression and search. Includes complete inspection steps, practical verification, and error handling.
Codex CLI integration
Preparation
First, install the official Codex CLI and confirm the device is in the terminal codex --version Able to output versions; Back up what you already have ~/.codex/config.toml。 Do not overwrite the original MCP, project permissions, or other vendor settings with a new configuration.
Add suppliers from this site
Merge the following content into the configuration file at the top level model Give me model_provider Don't repeat the definition:
model = "gpt-6-luna"
model_provider = "baiyun"
[model_providers.baiyun]
name = "白云超级智能"
base_url = "https://api.baiyun.si/v1"
env_key = "BAIYUN_API_KEY"
wire_api = "responses"
In the same terminal settings where Codex is launched BAIYUN_API_KEY; Windows PowerShell uses environment variables, while Linux/macOS uses terminal environment variables. Do not hardcode keys in public copies of TOML. The environment between the desktop and terminal processes may not be the same; after switching the startup method, you should re-check.
Verification sequence
- Restarting the Codex process that reads the configuration.
- Check whether the actual chosen model and vendor are the same
baiyun。 - Send a short question in the temporary test directory to observe the streaming results and the site's consumption log.
- When a tool is needed, start by reading a test file; Executing commands and modifying files still follow Codex's permission settings.
The site key is a custom supplier credential, not a ChatGPT login credential, nor does it grant official subscription benefits.
Context, search, and quota
This site has integrated native account information, model lists, Responses, compression, independent search, and quota-related bridging paths. Open paths do not guarantee that every upstream function is stably available: If context compression previously receives upstream 404, errors should be recorded and fixed, and errors cannot be promised never to occur. Independent search also depends on client version, runtime, and model support; Only add it if it is confirmed to be necessary and the version is supported supports_standalone_web_search = true。 The DK wallet on this site does not reset to a free balance due to upstream usage cycle updates.
Official information
Codex customizes vendor configurations。 This page is based on the site's writing style and does not equate third-party gateways with official OpenAI services.
Checklist before practical use
- Prepare your own account and access keys, and do not use others' shared credentials.
- Records client versions, systems, and models to be used for easy reproduction during troubleshooting.
- Save the original configuration or screenshot, hide keys, verification codes, and private content.
- Confirm that testing may consume a small amount of DK, starting with a single sentence and a single request.
- Review the current model plaza and status page before deciding whether to enable more features.
Detailed troubleshooting: Configuration not working
First, confirm that the merged file is config.toml in the actual user directory, not the file with the same name in the project. Check whether the top-level model_provider points to baiyun and whether env_key matches the terminal variable name. Duplicate configurations can cause startup failures, and the GUI may not inherit terminal variables when starting from the desktop. Do not delete all configurations to troubleshoot errors, and do not grant command execution permissions to fix network issues.
How to confirm that this section has been learned
Don't just check the "Configuration saved successfully" prompt. You should be able to clearly state the current Base URL, key usage, chosen model, and request protocol, and be able to verify your operation results on the corresponding console. The client-side tutorial uses a single actual plain text response and corresponding logs as the initial completion standard; Account tutorials are based on comprehensive security information; The billing tutorial uses the correspondence between principal, channel fees, and DK as the standard.
If an error occurs, record the occurrence time, HTTP status, content of the anonymized error, and the actual expected result. Do not screenshot the entire page key, and do not give the password or verification code to others. For 401, authentication should be resolved first; for 400, parameters should be resolved first; for 429, intensive retries should be stopped; for 404, request paths and upstream verification should be verified; recharging cannot resolve all errors.
A small task suitable for practice
Complete the minimum steps in this section in your own testing environment, recording in text "how you originally set it, which item you modified, and what results you saw." Do not treat production data, real payments, or irrecoverable commands as exercises. If you encounter features beyond what this section offers, first check the corresponding protocol tutorial before considering adding features; Changing only one configuration at a time makes it easy to judge which step leads to errors.
The next step is the boundary of the version
Return to the full learning map · Streamlined API site configuration · Real-time status of this site。
The tutorial was compiled on October 9, 2026. The specific interface and capabilities may vary depending on the client and upstream versions; The configuration guidelines do not mean that all client versions have passed the test. For balance payments, QQ / Alipay login, and open channels, please refer to the actual page page; Compression interfaces: Previously, upstream 404 and raw image channels were not available, so don't assume configuration files can be automatically removed.