Gemini content generation interface using the native Vertex AI protocol. The {action} parameter unifies both non-streaming and streaming invocation modes:
generateContent → non-streaming, waits for the complete response and returns it all at once
streamGenerateContent / streamGenerateContent?alt=sse→ streaming, returns the generated content incrementally as SSE data frames
Two authentication methods are supported (choose one):
Header: x-goog-api-key
Query: ?key=
请求参数
Path 参数
Header 参数
Body 参数application/json必填
示例
{"contents":[{"role":"user","parts":[{"text":"reply in one word: capital of France?"}]}]}
请求示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
cURL
curl--location'https://api.aicombo.com/v1/publishers/google/models/:' \
--header'x-goog-api-key: ' \
--header'Content-Type: application/json' \
--data'{
"contents": [
{
"role": "user",
"parts": [
{
"text": "reply in one word: capital of France?"
}
]
}
]
}'