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-flash",
"contents": [
{
"role": "user",
"parts": [
{ "text": "Describe the UI structure in this screenshot." },
{
"inlineData": {
"mimeType": "image/png",
"data": "<base64>"
}
}
]
}
]
}
cURLの例
curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"role": "user",
"parts": [
{ "text": "Describe the UI structure in this screenshot." },
{
"inlineData": {
"mimeType": "image/png",
"data": "<base64>"
}
}
]
}
]
}'
Python の例
import requests
response = requests.post(
"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent",
headers={
"x-goog-api-key": "<GEMINI_API_KEY>",
"Content-Type": "application/json",
},
json={
"contents": [
{
"role": "user",
"parts": [
{"text": "Describe the UI structure in this screenshot."},
{
"inlineData": {
"mimeType": "image/png",
"data": "<base64>",
}
},
],
}
],
},
)
print(response.json())
Node.js の例
const response = await fetch(
"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash: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: "Describe the UI structure in this screenshot." },
{
inlineData: {
mimeType: "image/png",
data: "<base64>"
}
}
]
}
]
}),
}
);
console.log(await response.json());
ベストプラクティス
- 小さなアセットをインライン化し、より大きな再利用可能なメディアにはファイル API を使用します
parts 内で意図したコンテキスト順序を保持する
- 1 つのリクエスト モデルでテキスト、画像、ファイルを処理できるため、Gemini の拡張が容易になります