Skip to main content
POST
/
v1beta
/
models
/
gemini-2.5-pro:
{method}
curl --request POST \
--url https://api.evolink.ai/v1beta/models/gemini-2.5-pro:{method} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Please introduce yourself"
}
]
}
]
}'
{
  "candidates": [
    {
      "content": {
        "role": "model",
        "parts": [
          {
            "text": "Hello! I'm pleased to introduce myself.\n\nI'm a large language model, trained and developed by Google..."
          }
        ]
      },
      "finishReason": "STOP",
      "index": 0,
      "safetyRatings": [
        {}
      ]
    }
  ],
  "promptFeedback": {
    "safetyRatings": [
      {}
    ]
  },
  "usageMetadata": {
    "promptTokenCount": 4,
    "candidatesTokenCount": 611,
    "totalTokenCount": 2422,
    "thoughtsTokenCount": 1807,
    "promptTokensDetails": [
      {
        "modality": "TEXT",
        "tokenCount": 4
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

##All APIs require Bearer Token authentication##

Get API Key:

Visit API Key Management Page to get your API Key

Add to request header:

Authorization: Bearer YOUR_API_KEY

Headers

X-Async-Mode
boolean
default:false

Enable async processing mode. When set to true, the request will be processed asynchronously and immediately return a task ID instead of waiting for the complete response.

Notes:

  • Async mode has the highest priority, even if streaming method is set, it will return a task ID
  • After receiving the task ID, use the task query API to get the generation result, which will always be in non-streaming format

Path Parameters

method
enum<string>
required

Generation method:

  • generateContent: Returns complete response at once
  • streamGenerateContent: Streaming generation, returns content in real-time chunks
Available options:
generateContent,
streamGenerateContent

Body

application/json
contents
object[]
required

List of conversation contents, supports multi-turn dialogue and multimodal input

Minimum length: 1
generationConfig
object

Generation configuration parameters (optional)

Response

Content generated successfully

Response format description:

  • When X-Async-Mode=true, returns AsyncTaskResponse (async task response, immediately returns task ID)
  • When method=generateContent and no async mode, returns GenerateContentResponse (returns complete response at once)
  • When method=streamGenerateContent and no async mode, returns StreamGenerateContentResponse (streaming response, returns content in chunks)
  • Sync Response
  • Stream Response
  • Async Response
candidates
object[]

List of candidate responses

promptFeedback
object
usageMetadata
object

Usage statistics