#Trying to create an AI cartoon thing, but encountering error 429

6 messages · Page 1 of 1 (latest)

coral iris
#

I currently have this code, but it recieves error 429 when running it
NodeJS v18.14.0

const axios = require('axios');

async function generateSimpsonsScript(prompt) {
  const apiUrl = 'https://api.openai.com/v1/chat/completions';
  const token = 'sk';
  try {
    const response = await axios.post(apiUrl, {
      prompt: prompt,
      max_tokens: 4096,
      temperature: 0.7,
      top_p: 1.0,
      frequency_penalty: 0.0,
      presence_penalty: 0.6,
      stop: '\n',
      n: 1,
      model: "gpt-3.5-turbo"
    }, {
      headers: {
        'Authorization': `Bearer ${token}`,
        'Content-Type': 'application/json',
      },
    });

    const completion = response.data.choices[0].text.trim();
    return completion;
  } catch (error) {
    console.error('Error generating Simpsons script:', error);
    return null;
  }
}

const prompt = 'Bart: ';
generateSimpsonsScript(prompt)
  .then(script => {
    console.log('Generated Simpsons script:');
    console.log(script);
  })
  .catch(error => {
    console.error('Error generating Simpsons script:', error);
  });
coral iris
#

Trying to create an AI cartoon thing, but encountering error 402

#

Trying to create an AI cartoon thing, but encountering error 429

tulip girder
#

Please make sure you use correct token (api key)

#

Note:Please don't share api key to others(that is related with billing)