gemini-2.5-flash

Text

Strong in coding, math \& reasoning

Giá đầu vào

$0.255Giảm 15%

Thị trường: $0.3

/ M

Giá đầu ra

$2.125Giảm 15%

Thị trường: $2.5

/ M

Đọc cache

$0.0255Giảm 15%

Thị trường: $0.03

/ M

Ghi cache

$0.0708Giảm 15%

Thị trường: $0.0833

/ M

Đầu vào

Văn bản

Đầu ra

Văn bản

API

Bắt đầu nhanh

Mã sẵn sàng để gọi mô hình này qua API tương thích OpenAI của EasyAPI.

1

Lấy API key

Tạo API token trong console và đặt làm biến môi trường:

Thay sk-xxxxxxxx bằng mã API từ console (Bearer Token).

Tạo API token
shell
export EASYAPI_API_KEY=sk-xxxxxxxx
2

Gửi yêu cầu đầu tiên

Dùng google/gemini-2.5-flash với API EasyAPI:

cURL
curl https://token.easyapi.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $EASYAPI_API_KEY" \
  -d '{"model":"google/gemini-2.5-flash","messages":[{"role":"user","content":"Hello!"}]}'
3

Bật streaming

Thêm "stream": true vào body để nhận phản hồi qua SSE:

curl
curl -N https://token.easyapi.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $EASYAPI_API_KEY" \
  -d '{"model":"google/gemini-2.5-flash","messages":[{"role":"user","content":"Hello!"}],"stream":true}'

Endpoint

Gửi yêu cầu chat completion. Hỗ trợ streaming và non-streaming.

POSThttps://token.easyapi.com/v1/chat/completions
Authorization
Bearer $EASYAPI_API_KEY
Content-Type
application/json
Model
google/gemini-2.5-flash

发送对话补全请求,支持流式与非流式。 Tài liệu

GEThttps://token.easyapi.com/v1/models
Authorization
Bearer $EASYAPI_API_KEY

获取当前账户可用模型列表。 Tài liệu

Tham số

TênKiểuMặc địnhMô tả
modelstring模型 ID,如 openai/gpt-4o、anthropic/claude-3-5-sonnet
messagesarray对话消息列表,每项含 role 与 content
streambooleanfalse设为 true 时以 SSE 流式返回
temperaturefloat1采样温度,越高越随机
max_tokensinteger单次回复最大生成 Token 数
top_pfloat1核采样,限制候选词累积概率
frequency_penaltyfloat0频率惩罚,降低重复用词
presence_penaltyfloat0存在惩罚,鼓励新话题

Dùng SDK bên thứ ba

SDK chính thức OpenAI và khác hoạt động khi đổi base URL. Xem hướng dẫn tích hợp