Gemini 2.5 Flash

1M context
ПровайдерGoogle

gemini-2.5-flash — текстовая модель-модель от Google.

document_understandingfunction_callingstreamingvisionweb_search

Попробуйте прямо здесь

Что умеет Gemini 2.5 Flash

  • Document Understanding
  • Function Calling
  • Streaming
  • Vision
  • Веб-поиск

Стоимость

за 1М cache read
8.4 ₽
за 1М input
84 ₽
за 1М output
700 ₽
web_search
9.8 ₽

Цены указаны в рублях и списываются с баланса проекта за успешные запросы. Надбавки (+) суммируются с базовой ставкой.

Технические характеристики

Контекст
1,048,576
токенов
Output
65,536
токенов
Vendor
google
Modality
text

Параметры запроса

Параметры, которые принимает модель. Передаются в теле запроса.

ПараметрТипДиапазон / значенияПо умолчаниюОписание
maxOutputTokens
integer
min: 1 · max: 65536
8192
Максимум токенов в ответе.
temperature
number
min: 0 · max: 2
1
Креативность 0-2.
topP
number
min: 0 · max: 1
0.95
Nucleus sampling.
topK
integer
min: 1
Top-K sampling.
candidateCount
integer
min: 1 · max: 8
1
Количество вариантов ответа.
stopSequences
array
Стоп-последовательности (макс 5).
responseMimeType
enum
text/plain, application/json
text/plain
application/json для structured output.
responseSchema
object
JSON Schema для структурированного ответа (требует responseMimeType=application/json).
responseModalities
array
Модальности ответа: ["TEXT"], ["IMAGE"], ["AUDIO"], etc.
thinkingConfig
object
{thinkingBudget:N} — для 2.5-pro / 3.x reasoning моделей.
seed
integer
Для воспроизводимости.
presencePenalty
number
min: -2 · max: 2
Штраф за уже использованные токены.
frequencyPenalty
number
min: -2 · max: 2
Штраф за повторение токенов.
responseLogprobs
boolean
false
Возвращать log-вероятности.
logprobs
integer
min: 1 · max: 20
Количество top-N logprobs.
mediaResolution
enum
MEDIA_RESOLUTION_LOW, MEDIA_RESOLUTION_MEDIUM, MEDIA_RESOLUTION_HIGH
Разрешение обработки картинок/видео.
tools
array
Function declarations / google_search / code_execution.
toolConfig
object
{functionCallingConfig:{mode:"AUTO|ANY|NONE",allowedFunctionNames:[...]}}.
safetySettings
array
Список {category, threshold} для блокировки harmful content.
contentsreq
array
Массив контента: история сообщений в формате Gemini. Каждый элемент — {role: "user"|"model", parts: [{text}|{inlineData}|{fileData}|{functionCall}|{functionResponse}|...]}.
1 пример
Примеры
[
  {
    "role": "user",
    "parts": [
      {
        "text": "Привет!"
      }
    ]
  }
]
systemInstruction
object
System prompt — описание роли модели. Формат: {parts: [{text: "..."}]}.
1 пример
Примеры
{
  "parts": [
    {
      "text": "You are a helpful assistant."
    }
  ]
}
cachedContent
string
Имя кэшированного контента (для prompt caching через cachedContents API). Формат: cachedContents/{id}.

Пример кода

gemini-2.5-flash_example.py
from openai import OpenAI

client = OpenAI(api_key="rk_live_...", base_url="https://api.ranvik.ru/v1")
resp = client.chat.completions.create(
    model="gemini-2.5-flash",
    messages=[{"role": "user", "content": "Привет!"}],
)
print(resp.choices[0].message.content)

# ── С веб-поиском ──
resp = client.chat.completions.create(
    model="gemini-2.5-flash",
    messages=[{"role": "user", "content": "Что нового в AI сегодня?"}],
    tools=[{"type": "web_search"}],
)
print(resp.choices[0].message.content)
Полная документация модели