Gemini
Gemini 3.1 Pro (Preview)
Model ID:gemini-3.1-pro-preview
gemini-3.1-pro-preview
| Context window | 1000000 |
|---|---|
| Input (CNY / Million Tokens) | ¥20 |
| Output (CNY / million tokens) | ¥120 |
| Cache read (CNY / million tokens) | ¥0 |
| Cache write (1h, yuan / million tokens) | ¥200 |
Prices by channel
| Channel | Input | Output | Read Cache | Cache hit | Cache Write (1h) | Cache write (5m) | Multiplier |
|---|---|---|---|---|---|---|---|
| 谷歌官方 | ¥20 | ¥120 | ¥0 | ¥3 | ¥200 | ¥60 | 1.00x |
| default-1 | ¥7 | ¥40 | ¥0 | ¥1 | ¥70 | ¥2 | 1.00x |
Call example
Compatible with the Anthropic Messages native protocol; just fill in your API Key to get started.
Request examplecurl
curl https://<你的中转接口域名>/v1/messages \
-H "x-api-key: sk-你的Key" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "gemini-3.1-pro-preview",
"max_tokens": 1024,
"messages": [
{ "role": "user", "content": "你好,请简单介绍一下自己" }
]
}'Back to examplesJSON
{
"id": "msg_01abcDEF...",
"type": "message",
"role": "assistant",
"model": "gemini-3.1-pro-preview",
"content": [
{ "type": "text", "text": "你好!我是 Gemini 3.1 Pro (Preview),很高兴为你服务。\n\n有什么可以帮你?" }
],
"stop_reason": "end_turn",
"usage": {
"input_tokens": 303,
"output_tokens": 73
}
}Tool Integration Tutorial
Use this model with your usual AI coding tool, billed per token.
How to Integrate Cline with API Gateways: VS Code Coding Agent Configuration
A tutorial on integrating the VS Code open-source coding agent Cline: how to create an sk- key, configure the API Provider and Base URL, and connect to Claude, GPT, or Gemini models.
Tutorial: Integrating Relay API in Cursor with Custom Base URL
Configure custom API Keys and Base URLs in Cursor's Settings → Models to use your own keys for accessing Claude, GPT, and Gemini models.
Continue Integration Guide: Custom Provider Setup for VS Code
A guide to integrating the Continue extension: add a custom Provider in config.yaml, configure the Base URL and sk- key to unify your usage of Claude, GPT, and Gemini.
