Hello! I am creating a react native expo application where I use the openai api. However all requests I make return error 429 meaning that I have been ratelimited.
My subscription is paid and I have much usage left.
I am the only one making requests and I am making them very rarely max(1 request / 30sec)
My api key is correct and I created it recently.
I have tried many different pieces of code and all have returned the same error.
If the staff tries to check if something is wrong with my account, the account name is 'Juho Korhonen'
My code:
import { View, Text, StyleSheet, TouchableOpacity } from 'react-native'
import { useState} from 'react'
import {Configuration, OpenAIApi} from 'openai';
import "react-native-url-polyfill/auto"
const MainScreen = () => {
const [Input, setInput] = useState('');
const openai = new OpenAIApi(new Configuration({
apiKey: 'Not gonna show this :)'
}))
function createResponse(){
openai.createChatCompletion({
model: "text-davinci-002",
prompt: "Hello",
max_tokens: 50,
}).then(res => {
console.log(res.data.choices[0].text);
}).catch(err => {
console.error(err);
});
}
return (
<View>
<TouchableOpacity onPress={createResponse}>
<Text>Enter</Text>
</TouchableOpacity>
</View>
)
}
Please if you have any recommendations on how to fix this or further questions, message me! Thanks