> ## Documentation Index
> Fetch the complete documentation index at: https://mixroute.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Gemini 4 Carbon

> Google 為複雜軟體工程、數學和科學問題設計的推理模型。

Google 為複雜軟體工程、數學和科學問題設計的推理模型。

MixRoute 公開目錄列出此模型的 Gemini 原生和 OpenAI 相容介面。實際可用性取決於 API Key 所屬群組。

## 模型規格

| 項目 | 說明 |
| - | - |
| 模型 ID | `gemini-4-carbon` |
| 輸入 | 文字、圖片、影片、音訊和 PDF |
| 輸出 | 文字 |
| 上下文視窗 | 輸入與輸出共用 1,048,576 個 Token |
| 標準同步輸出上限 | 65,536 Token |

上表是 Google 公布的模型限制，MixRoute 路由限制可能不同。Google 的長輸出需要另一套呼叫流程，不適用於以下範例。

## 快速範例

請將 `MIXROUTE_API_KEY` 設為你的 MixRoute API Key。

### Gemini 原生 API

```bash theme={null}
curl --fail-with-body --request POST "https://api.mixroute.ai/v1beta/models/gemini-4-carbon:generateContent" \
  --header "Authorization: Bearer $MIXROUTE_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "contents": [{"role": "user", "parts": [{"text": "Reply with OK only."}]}],
    "generationConfig": {"maxOutputTokens": 1024}
  }'
```

### OpenAI 相容 Chat Completions

```bash theme={null}
curl --fail-with-body --request POST "https://api.mixroute.ai/v1/chat/completions" \
  --header "Authorization: Bearer $MIXROUTE_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gemini-4-carbon",
    "messages": [{"role": "user", "content": "Reply with OK only."}],
    "max_tokens": 1024
  }'
```

## API 參考

* [`POST /v1beta/models/gemini-4-carbon:generateContent`](https://mixroute.ai/docs/zh-Hant/api-reference/endpoint/gemini-native)
* [`POST /v1/chat/completions`](https://mixroute.ai/docs/zh-Hant/api-reference/endpoint/chat-openai)
* [Google 模型文件](https://aistudio.google.com/docs/models/gemini-4-carbon)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.