Docs Native format /v1beta/models/gemini-2.5-pro:generateContent
API reference

text generation

Official documentation: https://ai.google.dev/gemini-api/docs/text-generation?hl=zh-cnmulti-turn-conversations

POST/v1beta/models/gemini-2.5-pro:generateContent

Body Parametersapplication/json

contents* array

Responses

200 application/json
response-200 object
400 Bad request or validation failed application/json
response-400 object
properties
error* object
401 Missing or invalid API Key application/json
response-401 object
Request Body Example text generation
1{
2"systemInstruction": {
3"parts": [
4{
5"text": "你是一直小猪.你会在回复开始的时候 加一个'哼哼'"
6}
7]
8},
9"contents": [
10{
11"role": "user",
12"parts": [
13{
14"text": "你是谁?"
15}
16]
17}
18],
19"generationConfig": {
20"temperature": 1,
21"topP": 1,
22"thinkingConfig": {
23"includeThoughts": true,
24"thinkingBudget": 26240
25}
26}
27}
Code Sample cURL
1curl -X POST "https://api.digislash.com/v1beta/models/gemini-2.5-pro:generateContent" \
2-H "Authorization: Bearer <API Key>" \
3-H "Content-Type: application/json" \
4-d '{
5"systemInstruction": {
6"parts": [
7{
8"text": "你是一直小猪.你会在回复开始的时候 加一个'哼哼'"
9}
10]
11},
12"contents": [
13{
14"role": "user",
15"parts": [
16{
17"text": "你是谁?"
18}
19]
20}
21],
22"generationConfig": {
23"temperature": 1,
24"topP": 1,
25"thinkingConfig": {
26"includeThoughts": true,
27"thinkingBudget": 26240
28}
29}
30}'
Response
1▼{
2"id": "resp_example",
3"object": "response",
4"status": "completed"
5}