文本生成
curl --request POST \
--url https://www.anyfast.ai/v1beta/models/gemini-3.5-flash:generateContent \
--header 'Content-Type: application/json' \
--data '
{
"contents": [
{
"role": "user",
"parts": [
{
"text": "解释并行智能体执行的工作原理。"
}
]
}
],
"systemInstruction": {
"parts": [
{
"text": "你是一个有帮助的助手。"
}
]
},
"generationConfig": {
"temperature": 1,
"topP": 1
},
"thinkingConfig": {
"thinkingLevel": "medium"
}
}
'import requests
url = "https://www.anyfast.ai/v1beta/models/gemini-3.5-flash:generateContent"
payload = {
"contents": [
{
"role": "user",
"parts": [{ "text": "解释并行智能体执行的工作原理。" }]
}
],
"systemInstruction": { "parts": [{ "text": "你是一个有帮助的助手。" }] },
"generationConfig": {
"temperature": 1,
"topP": 1
},
"thinkingConfig": { "thinkingLevel": "medium" }
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
contents: [{role: 'user', parts: [{text: '解释并行智能体执行的工作原理。'}]}],
systemInstruction: {parts: [{text: '你是一个有帮助的助手。'}]},
generationConfig: {temperature: 1, topP: 1},
thinkingConfig: {thinkingLevel: 'medium'}
})
};
fetch('https://www.anyfast.ai/v1beta/models/gemini-3.5-flash:generateContent', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.anyfast.ai/v1beta/models/gemini-3.5-flash:generateContent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'contents' => [
[
'role' => 'user',
'parts' => [
[
'text' => '解释并行智能体执行的工作原理。'
]
]
]
],
'systemInstruction' => [
'parts' => [
[
'text' => '你是一个有帮助的助手。'
]
]
],
'generationConfig' => [
'temperature' => 1,
'topP' => 1
],
'thinkingConfig' => [
'thinkingLevel' => 'medium'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.anyfast.ai/v1beta/models/gemini-3.5-flash:generateContent"
payload := strings.NewReader("{\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"text\": \"解释并行智能体执行的工作原理。\"\n }\n ]\n }\n ],\n \"systemInstruction\": {\n \"parts\": [\n {\n \"text\": \"你是一个有帮助的助手。\"\n }\n ]\n },\n \"generationConfig\": {\n \"temperature\": 1,\n \"topP\": 1\n },\n \"thinkingConfig\": {\n \"thinkingLevel\": \"medium\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.anyfast.ai/v1beta/models/gemini-3.5-flash:generateContent")
.header("Content-Type", "application/json")
.body("{\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"text\": \"解释并行智能体执行的工作原理。\"\n }\n ]\n }\n ],\n \"systemInstruction\": {\n \"parts\": [\n {\n \"text\": \"你是一个有帮助的助手。\"\n }\n ]\n },\n \"generationConfig\": {\n \"temperature\": 1,\n \"topP\": 1\n },\n \"thinkingConfig\": {\n \"thinkingLevel\": \"medium\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.anyfast.ai/v1beta/models/gemini-3.5-flash:generateContent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"text\": \"解释并行智能体执行的工作原理。\"\n }\n ]\n }\n ],\n \"systemInstruction\": {\n \"parts\": [\n {\n \"text\": \"你是一个有帮助的助手。\"\n }\n ]\n },\n \"generationConfig\": {\n \"temperature\": 1,\n \"topP\": 1\n },\n \"thinkingConfig\": {\n \"thinkingLevel\": \"medium\"\n }\n}"
response = http.request(request)
puts response.read_body{
"candidates": [
{
"content": {
"parts": [
{
"text": "并行智能体执行允许多个 AI 智能体同时工作..."
}
],
"role": "model"
},
"finishReason": "STOP"
}
],
"usageMetadata": {
"promptTokenCount": 123,
"candidatesTokenCount": 123,
"totalTokenCount": 123
}
}{
"error": {
"code": 123,
"message": "<string>",
"status": "<string>"
}
}{
"error": {
"code": 123,
"message": "<string>",
"status": "<string>"
}
}Google
gemini-3.5-flash
根据对话内容生成模型响应。Gemini 3.5 Flash 是 Google 最智能的 Flash 模型,针对智能体和编码任务进行了优化。
POST
/
v1beta
/
models
/
gemini-3.5-flash:generateContent
文本生成
curl --request POST \
--url https://www.anyfast.ai/v1beta/models/gemini-3.5-flash:generateContent \
--header 'Content-Type: application/json' \
--data '
{
"contents": [
{
"role": "user",
"parts": [
{
"text": "解释并行智能体执行的工作原理。"
}
]
}
],
"systemInstruction": {
"parts": [
{
"text": "你是一个有帮助的助手。"
}
]
},
"generationConfig": {
"temperature": 1,
"topP": 1
},
"thinkingConfig": {
"thinkingLevel": "medium"
}
}
'import requests
url = "https://www.anyfast.ai/v1beta/models/gemini-3.5-flash:generateContent"
payload = {
"contents": [
{
"role": "user",
"parts": [{ "text": "解释并行智能体执行的工作原理。" }]
}
],
"systemInstruction": { "parts": [{ "text": "你是一个有帮助的助手。" }] },
"generationConfig": {
"temperature": 1,
"topP": 1
},
"thinkingConfig": { "thinkingLevel": "medium" }
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
contents: [{role: 'user', parts: [{text: '解释并行智能体执行的工作原理。'}]}],
systemInstruction: {parts: [{text: '你是一个有帮助的助手。'}]},
generationConfig: {temperature: 1, topP: 1},
thinkingConfig: {thinkingLevel: 'medium'}
})
};
fetch('https://www.anyfast.ai/v1beta/models/gemini-3.5-flash:generateContent', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.anyfast.ai/v1beta/models/gemini-3.5-flash:generateContent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'contents' => [
[
'role' => 'user',
'parts' => [
[
'text' => '解释并行智能体执行的工作原理。'
]
]
]
],
'systemInstruction' => [
'parts' => [
[
'text' => '你是一个有帮助的助手。'
]
]
],
'generationConfig' => [
'temperature' => 1,
'topP' => 1
],
'thinkingConfig' => [
'thinkingLevel' => 'medium'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.anyfast.ai/v1beta/models/gemini-3.5-flash:generateContent"
payload := strings.NewReader("{\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"text\": \"解释并行智能体执行的工作原理。\"\n }\n ]\n }\n ],\n \"systemInstruction\": {\n \"parts\": [\n {\n \"text\": \"你是一个有帮助的助手。\"\n }\n ]\n },\n \"generationConfig\": {\n \"temperature\": 1,\n \"topP\": 1\n },\n \"thinkingConfig\": {\n \"thinkingLevel\": \"medium\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.anyfast.ai/v1beta/models/gemini-3.5-flash:generateContent")
.header("Content-Type", "application/json")
.body("{\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"text\": \"解释并行智能体执行的工作原理。\"\n }\n ]\n }\n ],\n \"systemInstruction\": {\n \"parts\": [\n {\n \"text\": \"你是一个有帮助的助手。\"\n }\n ]\n },\n \"generationConfig\": {\n \"temperature\": 1,\n \"topP\": 1\n },\n \"thinkingConfig\": {\n \"thinkingLevel\": \"medium\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.anyfast.ai/v1beta/models/gemini-3.5-flash:generateContent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"text\": \"解释并行智能体执行的工作原理。\"\n }\n ]\n }\n ],\n \"systemInstruction\": {\n \"parts\": [\n {\n \"text\": \"你是一个有帮助的助手。\"\n }\n ]\n },\n \"generationConfig\": {\n \"temperature\": 1,\n \"topP\": 1\n },\n \"thinkingConfig\": {\n \"thinkingLevel\": \"medium\"\n }\n}"
response = http.request(request)
puts response.read_body{
"candidates": [
{
"content": {
"parts": [
{
"text": "并行智能体执行允许多个 AI 智能体同时工作..."
}
],
"role": "model"
},
"finishReason": "STOP"
}
],
"usageMetadata": {
"promptTokenCount": 123,
"candidatesTokenCount": 123,
"totalTokenCount": 123
}
}{
"error": {
"code": 123,
"message": "<string>",
"status": "<string>"
}
}{
"error": {
"code": 123,
"message": "<string>",
"status": "<string>"
}
}查询参数
API 密钥
请求体
application/json
包含用户和模型消息的对话内容数组。
Show child attributes
Show child attributes
示例:
[ { "role": "user", "parts": [{ "text": "解释并行智能体执行的工作原理。" }] } ]
系统指令
Show child attributes
Show child attributes
示例:
{ "parts": [{ "text": "你是一个有帮助的助手。" }] }
Show child attributes
Show child attributes
思考配置,用于控制推理深度
Show child attributes
Show child attributes
此页面对您有帮助吗?
⌘I