Curl 调用示例
2026/10/24大约 1 分钟
Curl 命令参考
GPT-Codex
responses接口
curl https://rightapi.ai/v1/responses \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {此处填写ApiKey}' \
-d '{
"model": "gpt-6-sol",
"input": [
{
"type": "message",
"role": "user",
"content": [
{
"type": "input_text",
"text": "你好"
}
]
}
],
"stream": true
}'相关信息
鉴权请求头兼容Authorization和x-api-key,可任选其一
completions接口
curl https://rightapi.ai/v1/chat/completions \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {此处填写ApiKey}' \
-d '{
"model": "gpt-6-sol",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"stream": true
}'相关信息
/v1/chat/completions的响应由/v1/responses的响应转化而来,部分软件/插件可能存在兼容性问题;请求体中的system prompt会被自动替换为codex的默认instructions而无效
提醒:/v1/chat/completions(completions接口)不支持缓存。
Claude
curl https://rightapi.ai/v1/messages \
-H 'Content-Type: application/json' \
-H 'x-api-key: {此处填写ApiKey}' \
-d '{
"model": "claude-sonnet-5-5",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "你好",
"cache_control": { "type": "ephemeral" }
}
]
}
],
"max_tokens": 32000,
"stream": true
}'相关信息
鉴权请求头兼容Authorization和x-api-key,可任选其一
Gemini
curl --location 'https://rightapi.ai/v1beta/models/gemini-3.8-flash:streamGenerateContent?alt=sse' \
--header 'connection: keep-alive' \
--header 'x-goog-api-key: {此处填写ApiKey}' \
--header 'content-type: application/json' \
--data '{
"generationConfig": {
"temperature": 1
},
"contents": [
{
"role": "user",
"parts": [
{
"text": "你好"
}
]
}
]
}'Jev
Jev 是决策模型,不生成文本:对 state 回答带类型的问题,返回概率和置信度。完整说明见 Jev 决策模型。
curl https://www.rightapi.ai/v1/systemone \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {此处填写ApiKey}' \
-d '{
"model": "jev-1.14.0",
"state": "My card was charged twice for the same order.",
"questions": {
"is_billing": {
"type": "noul",
"instructions": "Is this message about billing?"
}
}
}'相关信息
Jev 只支持 Authorization: Bearer 鉴权,请使用绑定了 Jev 渠道的 ApiKey;不支持流式。
