curl --request POST \
--url https://api.omniall.ai/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-4o-mini",
"messages": [
{
"role": "user",
"content": "Hello"
}
]
}
'{
"id": "chatcmpl-...",
"object": "chat.completion",
"created": 1710000000,
"model": "gpt-4o-mini",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello!"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 4,
"total_tokens": 14
}
}{
"error": {
"message": "<string>",
"type": "new_api_error",
"code": "<string>"
}
}{
"error": {
"message": "无效的令牌 (request id: ...)",
"type": "new_api_error",
"code": ""
}
}{
"error": {
"message": "<string>",
"type": "new_api_error",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "new_api_error",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "new_api_error",
"code": "<string>"
}
}ChatGPT
Chat Completions
OpenAI Chat Completions API relayed by Omniall AI.
Base path: POST https://api.omniall.ai/v1/chat/completions
Compatible with the official OpenAI Chat Completions schema. Use model IDs from the Model Square.
Common scenarios
- Vision: multimodal
messages[].contentwithimage_url - File analysis:
type: filecontent parts (when the upstream model supports it) - Web search:
web_search_options/ provider search fields when the model supports search - Agent:
tools+tool_choicefunction calling loop - Streaming:
stream: true(SSE)
Official reference: https://platform.openai.com/docs/api-reference/chat
POST
/
v1
/
chat
/
completions
curl --request POST \
--url https://api.omniall.ai/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-4o-mini",
"messages": [
{
"role": "user",
"content": "Hello"
}
]
}
'{
"id": "chatcmpl-...",
"object": "chat.completion",
"created": 1710000000,
"model": "gpt-4o-mini",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello!"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 4,
"total_tokens": 14
}
}{
"error": {
"message": "<string>",
"type": "new_api_error",
"code": "<string>"
}
}{
"error": {
"message": "无效的令牌 (request id: ...)",
"type": "new_api_error",
"code": ""
}
}{
"error": {
"message": "<string>",
"type": "new_api_error",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "new_api_error",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "new_api_error",
"code": "<string>"
}
}Authorizations
Use Authorization: Bearer sk-... from https://omniall.ai/dashboard
Body
application/json
OpenAI Chat Completions request (POST /v1/chat/completions). Maps to Omniall gateway GeneralOpenAIRequest.
Response
Chat completion JSON, or SSE stream when stream=true.
Non-streaming Chat Completions response.