Overview
This API provides streaming content generation compatible with Google Vertex AI. It returns generated content incrementally, which is suitable for applications that process output as it becomes available.
API details
Constraints
- You must have an API key. For more information, see Manage AI API keys.
Request path
POST {BASE_URL}/api/vertex-ai/v1/publishers/{provider}/models/{model}:streamGenerateContent
Note: The same processor is also mounted under the /api/v1 and /api/vertex-ai/v1beta paths and supports the /models/{provider}/{model}:streamGenerateContent alias.
Request header
Name |
Required |
Example value |
Description |
|---|---|---|---|
| Authorization | Yes | Bearer YOUR_API_KEY | Authentication information |
| Content-Type | No | application/json | Request body format |
Request parameters
Path
Name |
Type |
Required |
Example value |
Description |
|---|---|---|---|---|
| provider | string | Yes | Model publisher | |
| model | string | Yes | gemini-pro | Model name |
Body
Name |
Type |
Required |
Example value |
Description |
|---|---|---|---|---|
| model | string | Yes | gemini-pro | Specify the model to use |
| contents | array[object] | No | [{"role": "user", "parts": [{"text": "Hello"}]}] | List of conversation contents |
| instances | array[object] | No | [] | List of instances |
| parameters | object | No | {"temperature": 0.7} | Generation parameters |
| voice | object | No | {} | Voice parameters |
Response
Response parameters
Name |
Type |
Description |
|---|---|---|
| success | boolean | Whether the request was successful |
| code | string | Return code |
| message | string | Response message. |
| data | object | Response data. |
data
Name |
Type |
Description |
|---|---|---|
| id | string | Resource unique ID |
| name | string | Resource name |
| status | string | Resource status |
| createTime | string | Creation time |
Request example
curl --request POST '{BASE_URL}/api/vertex-ai/v1/publishers/google/models/gemini-pro:streamGenerateContent' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "gemini-pro",
"contents": [
{
"role": "user",
"parts": [
{
"text": "Please introduce artificial intelligence."
}
]
}
],
"parameters": {
"temperature": 0.7,
"maxOutputTokens": 256
}
}'
Response example
{
"success": true,
"code": "200",
"message": "successful",
"data": {
"id": "gen-123456",
"name": "stream-generation-task",
"status": "STREAMING",
"createTime": "2026-04-10T10:00:00Z"
}
}
