curl --request POST \
--url https://api.omnirelay.ai/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": "<string>"
}
'import requests
url = "https://api.omnirelay.ai/v1/responses"
payload = {
"model": "<string>",
"input": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: '<string>', input: '<string>'})
};
fetch('https://api.omnirelay.ai/v1/responses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"object": "response",
"status": "completed",
"model": "<string>",
"output": [
{}
],
"usage": {
"input_tokens": 1,
"output_tokens": 1,
"total_tokens": 1,
"input_tokens_details": {
"cached_tokens": 1,
"cache_write_tokens": 1
},
"output_tokens_details": {
"reasoning_tokens": 1
}
},
"cost_microusd": 123,
"created_at": 123,
"error": {},
"incomplete_details": {},
"store": false
}{
"error": {
"code": "unsupported_parameter"
},
"request_id": "2f6c1d0e9a"
}{
"error": {
"code": "unauthorized"
}
}{
"error": {
"code": "insufficient_balance"
},
"request_id": "2f6c1d0e9a"
}{
"error": {
"code": "model_not_allowed"
},
"request_id": "2f6c1d0e9a"
}{
"error": {
"code": "model_unavailable"
},
"request_id": "2f6c1d0e9a"
}{
"error": {
"code": "payload_too_large"
},
"request_id": "2f6c1d0e9a"
}{
"error": {
"code": "rate_limited"
},
"request_id": "2f6c1d0e9a"
}{
"error": {
"code": "model_unavailable",
"message": "The model does not exist or is disabled.",
"type": "not_found_error",
"param": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "live_provider_not_configured"
},
"request_id": "2f6c1d0e9a"
}创建响应
调用已启用模型,通过 GET /v1/models 查询工具、JSON 格式、采样、推理及组合限制。能力审查覆盖全部可调用路由;新增组合依据文档,仍待逐项真实调用验证。预留费用并按可信用量结算,请关闭 SDK 自动重试。Responses 为无状态/store:false,不支持托管工具及存储引用。所有可调用路由采用参数透传(parameter_policy upstream-first);能力列表提供建议,普通 Schema 与扩展字段透传。保留原生响应与推理输出;模型服务方 400/422 拒绝释放预留,模型服务方故障、超时或断流需要对账。
curl --request POST \
--url https://api.omnirelay.ai/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": "<string>"
}
'import requests
url = "https://api.omnirelay.ai/v1/responses"
payload = {
"model": "<string>",
"input": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: '<string>', input: '<string>'})
};
fetch('https://api.omnirelay.ai/v1/responses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"object": "response",
"status": "completed",
"model": "<string>",
"output": [
{}
],
"usage": {
"input_tokens": 1,
"output_tokens": 1,
"total_tokens": 1,
"input_tokens_details": {
"cached_tokens": 1,
"cache_write_tokens": 1
},
"output_tokens_details": {
"reasoning_tokens": 1
}
},
"cost_microusd": 123,
"created_at": 123,
"error": {},
"incomplete_details": {},
"store": false
}{
"error": {
"code": "unsupported_parameter"
},
"request_id": "2f6c1d0e9a"
}{
"error": {
"code": "unauthorized"
}
}{
"error": {
"code": "insufficient_balance"
},
"request_id": "2f6c1d0e9a"
}{
"error": {
"code": "model_not_allowed"
},
"request_id": "2f6c1d0e9a"
}{
"error": {
"code": "model_unavailable"
},
"request_id": "2f6c1d0e9a"
}{
"error": {
"code": "payload_too_large"
},
"request_id": "2f6c1d0e9a"
}{
"error": {
"code": "rate_limited"
},
"request_id": "2f6c1d0e9a"
}{
"error": {
"code": "model_unavailable",
"message": "The model does not exist or is disabled.",
"type": "not_found_error",
"param": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "live_provider_not_configured"
},
"request_id": "2f6c1d0e9a"
}授权
在 OmniRelay 控制台创建的 API Key。所有者确认身份后可在控制台再次查看。
请求头
本次调用的标签,以逗号分隔的 key=value,例如 client=acme,env=prod。与 API Key 的默认标签合并;同名 key 以请求体 tags 字段为准。X-OmniRelay-Tags 是同一个请求头的旧名,继续接受。
传 enabled 时,响应会附带 gateway_metadata,说明网关为本次调用做出的决定。其他值或不传此头,响应保持不变。X-OmniRelay-Metadata 是同一个请求头的旧名,继续接受。
enabled 请求体
参数透传:普通扩展字段透传,仍执行鉴权、文本/函数协议及预算结算边界。
文本或显式消息/函数调用历史。仅文本片段,不支持托管工具或已存储响应引用。
10485761048576x >= 1false 仅真实模式且模型支持 tools 时可用。只支持 function 工具;严格工具和 JSON Schema 关键字另需支持。详见模型接入指南。
1 - 64 elementsShow child attributes
Show child attributes
模型声明 tool_choice 时可使用 auto、none 或 required。指定函数名选择还要求 capabilities.named_tool_choice。
auto, none, required Show child attributes
Show child attributes
Show child attributes
Show child attributes
本次调用的标签。与请求头和 Key 默认标签合并后最多 10 个。key 为 1 至 64 个字符,统一存为小写;value 为 1 至 128 个字符。两者只能包含字母、数字和 - _ . : /。以 gateway: 或 omnirelay: 开头的 key 为保留字。tags 不是对象时会被忽略。
Show child attributes
Show child attributes
{ "client": "acme", "project": "invoices" }
响应
已验证结果,包含已结算用量和费用。
response completed, incomplete Show child attributes
Show child attributes
按冻结价格、Token 分项、阶梯和折扣计算的已结算费用,单位微美元。整次费用取整后应用折扣,再向上取整。这是最终费用,不是最高预留。
false