認証
すべてのAPIリクエストはAPIキーを使用した認証が必要です。すべてのリクエストのAuthorizationヘッダーにAPIキーを含めてください。
ヘッダー例
Authorization: Bearer YOUR_API_KEY重要: APIキーを安全に保ち、クライアントサイドコードで公開しないでください。
レート制限
無料プラン
1,000
1日あたりのリクエスト
1分あたり
60
1分あたりのリクエスト
コンテキストウィンドウ
1M
トークンコンテキストウィンドウ
APIエンドポイント
POST
/v1/generateGenerate text using Gemini models
リクエスト
curl -X POST \
https://api.gemini-guide.com/v1/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "Your prompt here"}'
レスポンス
{
"status": "success",
"data": {
"response": "Generated content...",
"model": "gemini-pro",
"usage": {
"tokens": 150
}
}
}
POST
/v1/chatStart or continue a chat conversation
リクエスト
curl -X POST \
https://api.gemini-guide.com/v1/chat \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "Your prompt here"}'
レスポンス
{
"status": "success",
"data": {
"response": "Generated content...",
"model": "gemini-pro",
"usage": {
"tokens": 150
}
}
}
GET
/v1/modelsList available models
リクエスト
curl -X GET \
https://api.gemini-guide.com/v1/models \
-H "Authorization: Bearer YOUR_API_KEY" \
レスポンス
{
"status": "success",
"data": {
"response": "Generated content...",
"model": "gemini-pro",
"usage": {
"tokens": 150
}
}
}
GET
/v1/usageGet API usage statistics
リクエスト
curl -X GET \
https://api.gemini-guide.com/v1/usage \
-H "Authorization: Bearer YOUR_API_KEY" \
レスポンス
{
"status": "success",
"data": {
"response": "Generated content...",
"model": "gemini-pro",
"usage": {
"tokens": 150
}
}
}
エラーコード
400Bad Request
Invalid request parameters
401Unauthorized
Invalid or missing API key
429Too Many Requests
Rate limit exceeded
500Internal Server Error
Server error occurred