Skip to main content
POST
/
api
/
ai
/
v1beta
/
models
/
{model}
:generateContent
Gemini Chat
curl --request POST \
  --url https://aitoearn.cn/api/ai/v1beta/models/{model}:generateContent \
  --header 'Content-Type: application/json' \
  --header 'x-goog-api-key: <api-key>' \
  --data '
{
  "model": "<string>",
  "contents": [
    {
      "parts": [
        {
          "text": "<string>"
        }
      ]
    }
  ]
}
'
{}

Authorizations

x-goog-api-key
string
header
required

API Key header used by Gemini SDK-compatible endpoints.

Path Parameters

model
string
required

Model ID. First call the "Conversation Model List" interface (GET /api/ai/models/chat) and pass in the data[n].name returned by it.

Body

application/json
model
string
required

Model ID, consistent with the path parameter model. The value comes from data[n].name returned by the "Conversation Model List" interface.

contents
object[]
required

Contents list

config
object

Generate configuration

Response

Native third-party protocol response or SSE data, not wrapped in the AiToEarn common response envelope.

Native third-party protocol response, not wrapped in the AiToEarn common response envelope.