Skip to main content
POST
/
v1beta
/
models
/
gemini-3-flash-preview:generateContent
Text Generation
curl --request POST \
  --url https://www.anyfast.ai/v1beta/models/gemini-3-flash-preview:generateContent \
  --header 'Content-Type: application/json' \
  --data '
{
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "text": "Hello, tell me about yourself."
        }
      ]
    }
  ],
  "systemInstruction": {
    "parts": [
      {
        "text": "You are a helpful assistant."
      }
    ]
  },
  "generationConfig": {
    "temperature": 1,
    "topP": 1
  }
}
'
{
  "candidates": [
    {
      "content": {
        "parts": [
          {
            "text": "Hello! I am Gemini, nice to meet you."
          }
        ],
        "role": "model"
      },
      "finishReason": "STOP"
    }
  ],
  "usageMetadata": {
    "promptTokenCount": 123,
    "candidatesTokenCount": 123,
    "totalTokenCount": 123
  }
}

Query Parameters

key
string
required

API Key

Body

application/json
contents
object[]
required

Array of conversation contents with user and model messages.

Example:
[
  {
    "role": "user",
    "parts": [
      { "text": "Hello, tell me about yourself." }
    ]
  }
]
systemInstruction
object

System instruction

Example:
{
  "parts": [{ "text": "You are a helpful assistant." }]
}
generationConfig
object

Response

Response generated successfully

candidates
object[]
usageMetadata
object