Request Tracing
Request for usage instructions of link tracing (X-Request-id)
To achieve whole-link request tracing and significantly improve the efficiency of troubleshooting, we strongly recommend that you include the following in the HTTP Header every time you send an API request: X-Request-idparameter.
1. Parameter Description
-
Header Parameter Name:
X-Request-ID -
Value requirement: Each request must be globally unique. It is recommended to use the standard UUID v4 (e. g.,
123e4567-e89b-12d3-a456-426614174000), or a unique string with a business prefix (e. g.,xxx-20231025-123456789).
2. Functions and Advantages
-
Quickly locate issues: When you encounter API errors, abnormal responses, or need to verify specific request information, simply provide the
X-Request-idcorresponding to that request to our technical support team. -
Precise Log Query: We will use this unique ID to quickly retrieve the complete transaction flow records and underlying logs of this request in the system backend, so as to provide you with a faster and more accurate solution.
3. Request Example (cURL)
curl --location 'https://genaiapi.cloudsway.net/v1/ai/{YOUR_ENDPOINT}/chat/completions' \
--header 'Authorization: Bearer {YOUR_AK}' \
--header 'Content-Type: application/json' \
--header 'X-Request-id: {Your sole request ID,for example:550e8400-e29b-41d4-a716-446655440000}' \
--data '{
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "hi"
}
]
}
],
"model": "gemini-3-pro",
"stream": false
}'
⚠️ Precautions: Do not reuse the same X-Request-idacross different requests, otherwise it may cause log association confusion and affect subsequent troubleshooting.