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 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
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
Headers
Optional Gemini-style API key header.
Path Parameters
Gemini model id (as exposed in Model Square / GET /v1/models).
"gemini-2.0-flash"
Query Parameters
Optional Gemini-style API key query param.
Body
Native Gemini generateContent request body, relayed by Omniall AI. One contents turn is the minimum; add prior user/model turns for multi-turn chat.
Ordered conversation turns sent to Gemini. Each item is one message from either the user or the model. For a first request, usually a single user turn is enough.
Show child attributes
Show child attributes
Optional system-level instruction that steers model behavior for the whole request (persona, output format, safety rules). Not counted as a user/model turn in contents.
Show child attributes
Show child attributes
Optional tools the model may call. Examples: { "googleSearch": {} } for grounding/web search (when enabled), or { "functionDeclarations": [ ... ] } for your own agent functions. Availability depends on the model/channel.
Controls how tools are selected (for example function-calling mode). Pass through as Gemini toolConfig when you need to force/auto function calls.
Sampling and output controls for this generation.
Show child attributes
Show child attributes
Per-category safety thresholds (harassment, hate, sexual, dangerous content, etc.). Use when you need stricter or looser filtering than defaults.
Response
Gemini response JSON (or SSE for streamGenerateContent).