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.
推奨エンドポイント
最低限のお願い
{
"model": "gemini-2.5-pro",
"contents": [
{
"role": "user",
"parts": [{ "text": "Compare three cache architectures and recommend one." }]
}
],
"generationConfig": {
"thinkingConfig": {
"thinkingBudget": 1024
}
}
}
cURLの例
curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"role": "user",
"parts": [{ "text": "Compare three cache architectures and recommend one." }]
}
],
"generationConfig": {
"thinkingConfig": {
"thinkingBudget": 1024
}
}
}'
Python の例
import requests
response = requests.post(
"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent",
headers={
"x-goog-api-key": "<GEMINI_API_KEY>",
"Content-Type": "application/json",
},
json={
"contents": [
{
"role": "user",
"parts": [{"text": "Compare three cache architectures and recommend one."}],
}
],
"generationConfig": {
"thinkingConfig": {
"thinkingBudget": 1024,
},
},
},
)
print(response.json())
Node.js の例
const response = await fetch(
"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent",
{
method: "POST",
headers: {
"x-goog-api-key": process.env.GEMINI_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
contents: [
{
role: "user",
parts: [{ text: "Compare three cache architectures and recommend one." }]
}
],
generationConfig: {
thinkingConfig: {
thinkingBudget: 1024
}
}
}),
}
);
console.log(await response.json());
ベストプラクティス
- より深い推論品質のためにプロクラスのモデルを使用する
thinkingBudget をすぐに最大値にするのではなく、徐々に増やします。
- レイテンシの影響を受けやすいリクエストのために
thinkingBudget: 0 フォールバック パスを保持する