Baiyun API tutorial: OpenAI Compatible integration
Unified address, protocol selection, minimum request, and compatibility scope. Includes complete inspection steps, practical verification, and error handling.
OpenAI Compatible access
Three core features
| Field | This station is valued |
|---|---|
| Base URL | https://api.baiyun.si/v1 |
| API Key | Model calls in key management |
| Model | Copy the exact name from the model square, such as gpt-6-luna |
Chat Completions and Responses are two different request protocols, not two keys. Ordinary chat clients generally use Chat; Codex custom vendors use Responses. Model list with prices includedModel Squareshall prevail.
First, verify the model list
curl --fail-with-body https://api.baiyun.si/v1/models -H "Authorization: Bearer $BAIYUN_API_KEY"
BAIYUN_API_KEY These are environment variables you set privately locally; do not write the true values into tutorials, code repositories, or screenshots. 401 first checks the key, 404 first checks the address, 429 waits first, do not repeat the process infinitely.
Send the minimum text request again
curl --no-buffer --fail-with-body https://api.baiyun.si/v1/chat/completions -H "Authorization: Bearer $BAIYUN_API_KEY" -H 'Content-Type: application/json' -d '{"model":"gpt-6-luna","messages":[{"role":"user","content":"你好"}],"stream":true}'
Stream requests return segment by segment. Listing models does not mean the generation has been successful; Generating ordinary text does not mean images, audio, files, search, or all tools are available. Keep the minimum setting first, then enable functions one by one according to the actual open area of the site.
Parameters and capability boundaries
Do not automatically add the client toolsImages, attachments, or historical citations are all considered general competencies. Currently, Codex channels have dedicated adaptations, so ordinary clients should still use plain text first. The context compression path is open, but the upstream has previously returned 404; When encountering this error, you cannot fix it by repeatedly changing keys.
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 investigation: narrow down the scope of the problem in order
First, confirm that the account is complete, the key is valid, and the DK balance is sufficient, then verify the protocol, address, and model. Make a minimum text request using the same key; Only after it succeeds does it restore attachments, tools, or automatically retry each item. After saving the client configuration, reopen the session to avoid using the previous vendor in the old session.
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.