API ReferenceChat APIGemini
Gemini Text Chat
Last updated:
Chat — native Gemini format
POST /v1beta/models/{model}:generateContent
Authentication
Store your API key in AICENTOS_API_KEY; the shell examples expand it in the Authorization: Bearer header.
The API Key obtained under "Token Management" in the console
Location: header
Path Parameters
model*string
Request Body
application/json
TypeScript type definition
Use the request body type in TypeScript
Response Body
application/json
export AICENTOS_API_KEY="sk-your-aicentos-api-key"
curl -X POST "https://aicentos.com/v1beta/models/gemini-2.0-pro:generateContent" \
-H "Authorization: Bearer $AICENTOS_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "contents": [ { "role": "user", "parts": [ { "text": "Introduce yourself in one sentence" } ] } ] }'{
"candidates": [
{
"content": {},
"finishReason": "string",
"index": 0
}
],
"usageMetadata": {
"promptTokenCount": 0,
"candidatesTokenCount": 0,
"totalTokenCount": 0
}
}