0
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?

your account is not active, please check your billing details on our website.

Posted at

OpenAI APIを久しぶりに使おうとしたができない?

タイトルと同じエラーが発生した😅

your account is not active, please check your billing details on our website.

こちらのサイトに解決策が書いてあるようだが人によってケースが違うみたいだ?

  • クレジットカード情報を登録してない?
  • api keyを新しく発行する

私の場合だと、Billingのところで、$5だろうかお支払いしたら使えるようになった😅
しかし2回請求が来た?

海外のサイトを見て参考に解決できた。

スクリーンショット 2025-03-17 23.45.00.png

登録したあとですが、JCBのデビッドカードを登録しました。
スクリーンショット 2025-03-17 23.36.46.png

Pythonで動作確認したソースコードです。ご自分のapi keyを使用して試してみください。

from openai import OpenAI

# APIクライアントを初期化
client = OpenAI(
    api_key="my-api-key"  # あなたのAPIキーを入力
)

# チャット完了リクエストを送信
response = client.chat.completions.create(
    model="gpt-3.5-turbo",
    messages=[
        {"role": "user", "content": "今日の天気を教えてください"}
    ]
)

# レスポンスを表示
print(response.choices[0].message.content)

API KEYを隠した状態で撮影
スクリーンショット 2025-03-17 23.48.57.png

最後に

はじめての方、久しぶりに登録した方でOpenAIが使用できないことがあったらチャージする画面でクレジットカードの入力をしていない可能性があります。

それと新規プロジェクト作ったので、APIの使用制限していなかったので、Limitsというタブで設定しましょう。デフォルトだと$120だったような😅
危ないので慎重に使いましょう🚨

スクリーンショット 2025-03-17 23.51.31.png

0
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
0
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?