К обзору модели
API-документация
Подробное подключение и примеры запросов для Gemini Pro 3.1
Google
Чат
gemini-3.1-pro-preview
API-документация
Базовый URL
https://api.mashagpt.ru/v1Эндпоинт
POST
/v1/chat/completionsМодель
gemini-3.1-pro-previewАвторизация
x-api-key: YOUR_API_KEYили
Authorization: Bearer YOUR_API_KEYСтримингПоддерживается через
stream: true (Server-Sent Events)Пример запроса
cURL
curl https://api.mashagpt.ru/v1/chat/completions \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"model": "gemini-3.1-pro-preview",
"messages": [
{"role": "system", "content": "Ты полезный ассистент."},
{"role": "user", "content": "Привет!"}
]
}'cURL (стриминг)
curl https://api.mashagpt.ru/v1/chat/completions \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"model": "gemini-3.1-pro-preview",
"stream": true,
"messages": [
{"role": "system", "content": "Ты полезный ассистент."},
{"role": "user", "content": "Привет!"}
]
}'