Open AI
请求 URL
https://ai-gateway-intl.eo-edgefunctions7.com
请求方法
POST
请求头
参数名称 | 必选 | 类型 | 描述 |
OE-Key | 是 | string | 网关 API 密钥 |
OE-Gateway-Name | 是 | string | 网关名称 |
OE-AI-Provider | 是 | string | AI 服务提供商,固定值:openai |
OE-Gateway-Version | 是 | string | 网关版本,固定值:2 |
Authorization | 是 | string | LLM 服务商的认证密钥 |
Content-Type | 是 | string | 固定值:application/json |
请求体
参数名称 | 必选 | 类型 | 描述 |
model | 是 | string | 模型名称 |
messages | 是 | array | 消息列表,每个消息包含角色和内容 |
stream | 是 | boolean | 是否启用流式处理 |
请求体示例
{"model": "gpt-3.5-turbo","messages": [{"role": "user","content": "1+1=?"}],"stream": true}
响应示例
响应格式为 JSON,具体内容根据实际 API 返回结果而定。
curl 请求示例
curl --location --request POST 'https://ai-gateway-intl.eo-edgefunctions7.com' \--header 'OE-Key: xxxx' \--header 'OE-Gateway-Name: xxxx' \--header 'OE-AI-Provider: openai' \--header 'OE-Gateway-Version: 2' \--header 'Authorization: Bearer xxxx' \--header 'Content-Type: application/json' \--data-raw '{"model":"gpt-3.5-turbo","messages": [{"role": "user","content": "1+1=?"}],"stream":true}'
注意事项
注意:
1. 请确保所有必填参数都已正确填写。
2. 根据实际情况调整
Authorization
头的填写。3. 请求体中的
messages
数组可以包含多个消息对象,具体根据业务需求而定。