Gemini 音频理解
curl --request POST \
--url https://zero.cat/v1beta/models/{model}:generateContent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contents": [
{
"parts": [
{
"text": "<string>"
}
]
}
],
"generationConfig": {
"responseModalities": [
"<string>"
],
"speechConfig": {
"voiceConfig": {
"prebuiltVoiceConfig": {
"voiceName": "<string>"
}
}
}
}
}
'import requests
url = "https://zero.cat/v1beta/models/{model}:generateContent"
payload = {
"contents": [{ "parts": [{ "text": "<string>" }] }],
"generationConfig": {
"responseModalities": ["<string>"],
"speechConfig": { "voiceConfig": { "prebuiltVoiceConfig": { "voiceName": "<string>" } } }
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contents: [{parts: [{text: '<string>'}]}],
generationConfig: {
responseModalities: ['<string>'],
speechConfig: {voiceConfig: {prebuiltVoiceConfig: {voiceName: '<string>'}}}
}
})
};
fetch('https://zero.cat/v1beta/models/{model}:generateContent', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"candidates": [
{
"content": {
"role": "<string>",
"parts": [
{}
]
},
"finishReason": "<string>",
"safetyRatings": [
{}
]
}
],
"usageMetadata": {
"promptTokenCount": 123,
"candidatesTokenCount": 123,
"totalTokenCount": 123
}
}音频
Gemini 音频理解
Gemini 音频生成接口。 可使用gemini-2.5-flash-preview-tts等模型
POST
/
v1beta
/
models
/
{model}
:generateContent
Gemini 音频理解
curl --request POST \
--url https://zero.cat/v1beta/models/{model}:generateContent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contents": [
{
"parts": [
{
"text": "<string>"
}
]
}
],
"generationConfig": {
"responseModalities": [
"<string>"
],
"speechConfig": {
"voiceConfig": {
"prebuiltVoiceConfig": {
"voiceName": "<string>"
}
}
}
}
}
'import requests
url = "https://zero.cat/v1beta/models/{model}:generateContent"
payload = {
"contents": [{ "parts": [{ "text": "<string>" }] }],
"generationConfig": {
"responseModalities": ["<string>"],
"speechConfig": { "voiceConfig": { "prebuiltVoiceConfig": { "voiceName": "<string>" } } }
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contents: [{parts: [{text: '<string>'}]}],
generationConfig: {
responseModalities: ['<string>'],
speechConfig: {voiceConfig: {prebuiltVoiceConfig: {voiceName: '<string>'}}}
}
})
};
fetch('https://zero.cat/v1beta/models/{model}:generateContent', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"candidates": [
{
"content": {
"role": "<string>",
"parts": [
{}
]
},
"finishReason": "<string>",
"safetyRatings": [
{}
]
}
],
"usageMetadata": {
"promptTokenCount": 123,
"candidatesTokenCount": 123,
"totalTokenCount": 123
}
}授权
ZeroCat API 密钥(sk- 开头),在控制台「API 密钥」页面创建。
格式:Authorization: Bearer sk-xxxxxx
路径参数
模型名称
请求体
application/json

