---
title: "generateContent - Vertex AI 生成内容 - OB Cloud 云数据库 master | OceanBase 文档中心"
description: "generateContent - Vertex AI 生成内容 功能说明 Vertex AI 兼容同步生成接口。相同 handler 也挂载在 /api/v1 与 /api/vertex-ai/v1beta ，并支持 /models/{provider}/{model}:generateContent 别名。 调用…"
---
切换语言

- 中文站 - 简体中文
- International - English
- 日本站 - 日本語

文档反馈![](https://mdn.alipayobjects.com/huamei_22khvb/afts/img/A*qbZXRo_94ZEAAAAAAAAAAAAADiGDAQ/original) OB Cloud 云数据库

# generateContent - Vertex AI 生成内容

更新时间：2026-07-03 13:45:54

## 功能说明

Vertex AI 兼容同步生成接口。相同 handler 也挂载在 `/api/v1` 与 `/api/vertex-ai/v1beta`，并支持 `/models/{provider}/{model}:generateContent` 别名。

## 调用说明

### 接口约束

- 调用者需要拥有 API Key，详情请参见 [管理 AI API Key](https://www.oceanbase.com/docs/common-oceanbase-cloud-1000000005766992)。

### 请求路径

`POST {BASE_URL}/api/vertex-ai/v1/publishers/{provider}/models/{model}:generateContent`

### 请求头

| 名称 | 是否必选 | 示例值 | 描述 |
| --- | --- | --- | --- |
| Authorization | 是 | Bearer {token} | 鉴权信息 |
| Content-Type | 否 | application/json | 请求体格式 |

## 请求参数

### Path 参数

| 名称 | 类型 | 是否必填 | 示例值 | 描述 |
| --- | --- | --- | --- | --- |
| provider | string | 是 | - | 无 |
| model | string | 是 | - | 无 |

### Query 参数

无

### Body 参数

| 名称 | 类型 | 是否必填 | 示例值 | 描述 |
| --- | --- | --- | --- | --- |
| model | string | - | - | 无 |
| contents | array[object] | - | - | 无 |
| instances | array[object] | - | - | 无 |
| parameters | object | - | - | 无 |
| voice | object | - | - | 无 |

## 返回结果

### 返回参数

| 名称 | 类型 | 描述 |
| --- | --- | --- |
| success | boolean | 请求是否成功 |
| code | string | 返回码 |
| message | string | 返回信息 |
| data | object | 业务返回数据 |

### data 字段说明

返回数据结构为 `unknown`。

## 请求示例

```bash
curl --request POST '{BASE_URL}/api/vertex-ai/v1/publishers/{provider}/models/{model}:generateContent' \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "",
    "contents": [],
    "instances": [],
    "parameters": {},
    "voice": {}
  }'

```

## 返回示例

```json
{
  "success": true,
  "code": "200",
  "message": "successful",
  "data": {}
}

```

 上一篇 下一篇 ![有帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*y6ocSqN8cqsAAAAAAAAAAAAAARQnAQ)![无帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*BG9IQJyLHF8AAAAAAAAAAAAAARQnAQ)![反馈](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*eTWdQKCRKHwAAAAAAAAAAAAAARQnAQ)[AI](https://www.oceanbase.com/obi) 咨询热线
