2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Gemini APIが503エラー

2
Last updated at Posted at 2026-11-12

はじめに

  • 簡単な処理(クレカ明細からジャンルを仕分ける)にGeminiのAPIを利用している

問題

  • 503で処理が完了できない

解決

  • 一時的にモデルをgemini-3.8-flash → gemini-3.5-flash で変更して解決。出力も問題なさそう

終わりに

使えるモデルの一覧を取得

curl -s "https://generativelanguage.googleapis.com/v1beta/models?key=YOUR_API_KEY" | grep name

本当にAPI自体のエラーかを確認したコマンド

curl -s -w "\nHTTP_STATUS:%{http_code}\n" \
  "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.5-flash:generateContent?key=YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"contents":[{"parts":[{"text":"hi"}]}]}'
curl -s -w "\nHTTP_STATUS:%{http_code}\n" \
  "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.8-flash:generateContent?key=YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"contents":[{"parts":[{"text":"hi"}]}]}'

いろんなモデル叩いてダメだったので、検索して3.5にあたりをつけた

GeminiのAPIドキュメント

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?