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

# Gemini 拡張パラメーターの例

> Gemini プロバイダー固有のパススルーの例。

## これをいつ使用するか

* `generationConfig`、`thinkingConfig`、またはモダリティ設定を転送する必要があります
* 統合レイヤーでは Google 固有の機能を引き続き保持する必要があります

## Example

```json theme={null}
{
  "model": "gemini-2.5-flash",
  "contents": [
    {
      "role": "user",
      "parts": [{ "text": "Summarize this report." }]
    }
  ],
  "model_extra": {
    "generationConfig": {
      "thinkingConfig": { "thinkingBudget": 512 },
      "responseMimeType": "application/json"
    }
  }
}
```

## cURLの例

```bash theme={null}
curl "https://maas.apigo.ai/v1beta/models/gemini-2.5-flash:generateContent" \
  -H "Authorization: Bearer $YOUR API KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-2.5-flash",
    "contents": [
      {
        "role": "user",
        "parts": [{ "text": "Summarize this report." }]
      }
    ],
    "model_extra": {
      "generationConfig": {
        "thinkingConfig": { "thinkingBudget": 512 },
        "responseMimeType": "application/json"
      }
    }
  }'
```

## Python の例

```python theme={null}
import requests

response = requests.post(
    "https://maas.apigo.ai/v1beta/models/gemini-2.5-flash:generateContent",
    headers={
        "Authorization": "Bearer <YOUR API KEY>",
        "Content-Type": "application/json",
    },
    json={
        "model": "gemini-2.5-flash",
        "contents": [
            {
                "role": "user",
                "parts": [{"text": "Summarize this report."}],
            }
        ],
        "model_extra": {
            "generationConfig": {
                "thinkingConfig": {"thinkingBudget": 512},
                "responseMimeType": "application/json",
            }
        },
    },
)

print(response.json())
```

## Node.js の例

```js theme={null}
const response = await fetch(
  "https://maas.apigo.ai/v1beta/models/gemini-2.5-flash:generateContent",
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.YOUR API KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      model: "gemini-2.5-flash",
      contents: [
        {
          role: "user",
          parts: [{ text: "Summarize this report." }]
        }
      ],
      model_extra: {
        generationConfig: {
          thinkingConfig: { thinkingBudget: 512 },
          responseMimeType: "application/json"
        }
      }
    }),
  }
);

console.log(await response.json());
```

## ベストプラクティス

* パススルーの前にネストされた構成オブジェクトを検証する
* 回帰追跡のためにモデル名と拡張パラメータの両方を記録します。
