curl --request POST \
--url https://api.omniall.ai/v1beta/models/{model}:streamGenerateContent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Hello Gemini"
}
]
}
]
}
'{
"candidates": [
{
"content": {
"role": "<string>",
"parts": [
{}
]
},
"finishReason": "<string>"
}
],
"usageMetadata": {
"promptTokenCount": 123,
"candidatesTokenCount": 123,
"totalTokenCount": 123
}
}{
"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>"
}
}Gemini
Gemini streamGenerateContent
Google Gemini streamGenerateContent relayed by Omniall AI.
Path: POST https://api.omniall.ai/v1beta/models/{model}:streamGenerateContent
Streaming native Gemini call (SSE).
Auth: Authorization: Bearer sk-..., or x-goog-api-key / ?key=.
Scenarios
- Vision:
inlineDataimage parts - Files:
fileData.fileUri - Grounding / web:
tools: [{ googleSearch: {} }]when supported - Agent:
functionDeclarations - Image generation:
generationConfig.responseModalitiesincludingIMAGE
Official reference: https://ai.google.dev/api/generate-content
POST
/
v1beta
/
models
/
{model}
:streamGenerateContent
curl --request POST \
--url https://api.omniall.ai/v1beta/models/{model}:streamGenerateContent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Hello Gemini"
}
]
}
]
}
'{
"candidates": [
{
"content": {
"role": "<string>",
"parts": [
{}
]
},
"finishReason": "<string>"
}
],
"usageMetadata": {
"promptTokenCount": 123,
"candidatesTokenCount": 123,
"totalTokenCount": 123
}
}{
"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
Path Parameters
Body
application/json
Native Gemini generateContent request body, relayed by Omniall AI. One contents turn is the minimum; add prior user/model turns for multi-turn chat.
Response
Gemini response JSON (or SSE for streamGenerateContent).