Hi - I’m getting the below response when passing in a 600x300 .jpg with a short prompt:
Rate limit reached for gpt-4-vision-preview in organization org-[MY-ORGANIZATION] on tokens per min. Limit: 10000 / min. Please try again in 6ms. Visit https://platform.openai.com/account/rate-limits to learn more.
Any ideas on why this might be? I’ve also tried using the API from my personal account with the same result.
Calling it using:
OpenAI Vision API function
def get_image_analysis(api_key, prompt_text, image_path=None):
client = OpenAI(api_key=api_key)
headers = {
“Content-Type”: “application/json”,
“Authorization”: f"Bearer {api_key}"
}
image_data = encode_image_to_base64(image_path)
payload = {
"model": "gpt-4-vision-preview",
"messages": [
{
"role": "user",
"content": prompt_text
},
{
"role": "user",
"content": f"data:image/jpeg;base64,{image_data}"
}
],
"max_tokens": 300
}
response = requests.post("https://api.openai.com/v1/chat/completions", headers=headers, json=payload)
return response.json()