Baiyun API tutorial: Responses text interface
Responses synchronizes with SSE streaming text requests and full contextual descriptions. Includes complete inspection steps, practical verification, and error handling.
Responses text interface
Interface Address:POST https://api.baiyun.si/v1/responses。
Suitable for applications explicitly supporting the Responses protocol. Currently available for synchronous and SSE streaming text requests; Tools, files, images, and other extension features with a full interface are not yet available.
Synchronize text requests
curl --fail-with-body https://api.baiyun.si/v1/responses \
-H "Authorization: Bearer $BAIYUN_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model":"gpt-6-luna",
"input":"请用一句话介绍你能帮我做什么。",
"stream":false
}'
In response output The array contains output items. Read message items content Middle type For this output_text Yes text Fields, and keep them usage Usage information. Do not assume that the original REST JSON necessarily contains the convenience fields provided by the SDK output_text。
SSE stream request
curl --no-buffer --fail-with-body https://api.baiyun.si/v1/responses \
-H "Authorization: Bearer $BAIYUN_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"model":"gpt-6-luna","input":"请写两句普通的问候语。","stream":true}'
Parsing by SSE event type:response.output_text.delta Provides text increments; Upon completion of the act, it should be received response.completed。 When the stream is incomplete, fails occur, or network interruptions occur, the displayed portion should not be taken as the full response.
Submit the full text history
{
"model": "gpt-6-luna",
"instructions": "用中文简短回答。",
"input": [
{"role": "user", "content": "什么是 Token?"},
{"role": "assistant", "content": "Token 是模型处理文本时使用的计量单位。"},
{"role": "user", "content": "它与字数完全相同吗?"}
],
"stream": false
}
The necessary context should now be submitted as text with this request. Citing upstream sessions previous_response_id, external history, tool calls, or uncheckable media payloads are temporarily not open.
Verify before use
- First, use the one with Bearer authentication
/v1/modelsVerify the actual model name. - Currently, only text mode is open; arbitrary Responses extension fields or SDK automatically added tool features are not supported.
max_output_tokensThese parameters are not guaranteed output or hard limit fees; Reconcile expenses against actual usage and consumption records.- Up to 2 concurrent requests per credential; Wait when encountering a flow limit to avoid automatic infinite retrys.
Full policy and scope not yet open can be seenSite usage rules; View via the Chat clientChat text interface。
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.