Skip to content

Embeddings

POST https://www.kkiai.com/v1beta/models/gemini-2.5-pro:generateContent

Official Documentation: https://ai.google.dev/gemini-api/docs/text-generation?hl=zh-cn#multi-turn-conversations

Request Parameters

Query Parameters

Parameter NameTypeRequiredDescriptionExample
keystringRequired{{YOUR_API_KEY}}

Header Parameters

Parameter NameTypeRequiredDescriptionExample
Content-TypestringRequiredapplication/json
x-goog-api-keystringOptional{{YOUR_API_KEY}}

Body Parameters (application/json)

Parameter NameTypeRequiredDescription
contentsarray[object]Required
  └ partsarray[object]Optional

Request Example

json
{
  "systemInstruction": {
    "parts": [
      {
        "text": "You are a friendly AI assistant. Start each response with a brief greeting."
      }
    ]
  },
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "text": "Who are you?"
        }
      ]
    }
  ],
  "generationConfig": {
    "temperature": 1,
    "topP": 1,
    "thinkingConfig": {
      "includeThoughts": true,
      "thinkingBudget": 26240
    }
  }
}

cURL Example

bash
curl --location --request POST 'https://www.kkiai.com/v1beta/models/gemini-2.5-pro:generateContent' \
--header 'x-goog-api-key: <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "systemInstruction": {
    "parts": [
      {
        "text": "You are a friendly AI assistant. Start each response with a brief greeting."
      }
    ]
  },
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "text": "Who are you?"
        }
      ]
    }
  ],
  "generationConfig": {
    "temperature": 1,
    "topP": 1,
    "thinkingConfig": {
      "includeThoughts": true,
      "thinkingBudget": 26240
    }
  }
}'

Response

🟢 200 Success

Response Example

json
{}