Zhengqbbb / cz-git

cz-git | czg πŸ› οΈ DX first and more engineered, lightweight, customizable, standard output format Commitizen adapter and CLI
https://cz-git.qbb.sh
MIT License
1.05k stars 39 forks source link

[Bug report] The czg ai command does not work. #123

Closed guotingchao closed 1 year ago

guotingchao commented 1 year ago

βœ… Checklist

πŸ“„ System Info

System:
    OS: macOS 13.3
    CPU: (12) arm64 Apple M2 Max
    Memory: 956.44 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 19.8.1 - /opt/homebrew/bin/node
    Yarn: 3.5.0 - /opt/homebrew/bin/yarn
    npm: 9.5.1 - /opt/homebrew/bin/npm
  npmGlobalPackages:
    commitizen: 4.3.0

πŸ”Ž Description

Concise Description

Using czg CLi in my git repository folder path, the czg ai command does not work.

Expected behavior

I'm pretty sure I still have a balance of about $17 in my account, and I haven't made any calls recently, and api key is rebound.

Steps to reproduce

$> czg ai

Error Message

? Select the type of change that you're committing: feat:     A new feature
β„Ή Generating your AI commit subject...
[err]>>>: Fetch OpenAI API message failureThe response HTTP Code: 429
You exceeded your current quota, please check your plan and billing details.

πŸ”— Reproduction link / repo:

No response

Zhengqbbb commented 1 year ago

You exceeded your current quota, please check your plan and billing details.

The error is openAI response. I'm also pretty sure it can work ~ Please check your API key billing details:

https://platform.openai.com/account/usage

AugusDogus commented 1 month ago

I just experienced this issue after setting up a fresh API key with 0 usage.

image

image

Zhengqbbb commented 1 month ago

@AugusDogus

I just experienced this issue after setting up a fresh API key with 0 usage.

The error message is from OpenAI. please try a mini example by curl command: https://platform.openai.com/docs/quickstart/step-3-sending-your-first-api-request

image

Just tested and everything works fine.

AugusDogus commented 1 month ago

Thanks for taking a look @Zhengqbbb; after further investigation this was because I did not have a paid plan and misunderstood the usage limits for a free account.

TL;DR: You need to upgrade to a paid plan. Set up a paid account, add a credit or debit card, and generate a new API key if your old one was generated before the upgrade. It might take 10 minutes or so after you upgrade to a paid plan before the paid account becomes active and the error disappears.

Relevant stackoverflow.

Might be worth noting this in the readme - I'm happy to open a PR if you think this would be useful.