Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Build a Basic ChatGPT Clone with Vanilla JavaScript

Rez Ghali
Rez Ghali
10,527 Points

I get error 429.

I get error 429. Looks like API only works for paid account. Is that correct? Does it mean I have to be on a paid account to have this workshop work for me?

I ran into the same issue and I believe we do need a paid account in order for it to work.

I'm trying to figure out currently, if/how it's possible to use Google Bard instead.

3 Answers

I'm not sure if anyone is experiencing this but you also need to set up a pay account in order to have a 'free' account.

Rohald van Merode
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Rohald van Merode
Treehouse Staff

Hey Reza Ghaeli & Jamie McKenzie 👋

The 429 status code indicates that you've made too many requests in a given amount of time and are being rate limited. You can definitely follow along with an API key on the free plan but I'd recommend testing your code sparingly in development. You can find more information about the rate limits in the API Documentation 🙂

After a few minute wait your code should be working as expected.

Hope this clears things up!

Rohald van Merode, thanks for the response. I've had a look through the documentation that you linked above and I'm unsure as to why this would happen, even after decreasing the max_tokens to 20.

I am getting the following error within my DevTools

    "error": {
        "message": "You exceeded your current quota, please check your plan and billing details.",
        "type": "insufficient_quota",
        "param": null,
        "code": null
    }
Rohald van Merode
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Rohald van Merode
Treehouse Staff

Hi Jamie McKenzie,

The error will occur when one of the two limits is reached (requests or tokens / minute). On the free plan you get a rate limit of 3 requests per minute which you're more likely to hit than the TPM limit, every request after that will be responded with a 429 status. After a minute the API should start responding again as expected 🙂