响应头
X-Oneapi-Request-Id:平台请求 IDrequest-id:别名,值相同
自定义请求 ID
请求头可传X-Oneapi-Request-Id(优先)或 request-id(别名);去除首尾空白,空值或超 128 字符时平台重新生成。
错误响应中的请求 ID
错误响应error.request_id 字段,格式如 20260320153045abcdefgh。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
X-Oneapi-Request-Id:平台请求 IDrequest-id:别名,值相同X-Oneapi-Request-Id(优先)或 request-id(别名);去除首尾空白,空值或超 128 字符时平台重新生成。
error.request_id 字段,格式如 20260320153045abcdefgh。
curl -i "https://api.gregapi.com/v1/chat/completions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"hi"}]}'
from openai import OpenAI
client = OpenAI(
base_url="https://api.gregapi.com/v1",
api_key="YOUR_API_KEY",
)
resp = client.chat.completions.with_raw_response.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "hi"}],
)
print(resp.headers.get("X-Oneapi-Request-Id"))
const OpenAI = require("openai");
const client = new OpenAI({
baseURL: "https://api.gregapi.com/v1",
apiKey: "YOUR_API_KEY",
});
const resp = await client.chat.completions
.create({ model: "gpt-4o-mini", messages: [{ role: "user", content: "hi" }] })
.asResponse();
console.log(resp.headers.get("X-Oneapi-Request-Id"));