# API connection problem with BLENDER application

**URL:** <https://community.openai.com/t/api-connection-problem-with-blender-application/1026584>\
**Category:** API\
**Tags:** api-usage-tiers\
**Created:** [November 21, 2024, 12:29pm UTC](https://community.openai.com/t/api-connection-problem-with-blender-application/1026584 "2024-11-21T12:29:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![marco.luigiano75](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/marco.luigiano75/32/503364_2.png) [@marco.luigiano75](https://community.openai.com/u/marco.luigiano75)\
**Post date:** [November 21, 2024, 12:29pm UTC](https://community.openai.com/t/api-connection-problem-with-blender-application/1026584/1 "2024-11-21T12:29:54Z")

</div>

i try to use the following python script to connect blender to chatgpt between Api but the error that the console show me is:

```auto
The model `gpt-4` does not exist or you do not have access to it.

```

Here is the code:

```auto
import bpy
import openai

def send_prompt_to_chatgpt(prompt):
api_key = 'KEY' # Inserisci qui la tua chiave API
client = openai.OpenAI(api_key=api_key)

try:
completion = client.chat.completions.create(
model="gpt-4", # Specifica il modello che vuoi utilizzare
messages=[
{"role": "system", "content": "You are an AI trained by OpenAI."},
{"role": "user", "content": prompt}
]
)

# Estrai il contenuto del messaggio generato dal modello
generated_message = completion.choices[0].message.content
print("ChatGPT Response:", generated_message) # Stampa la risposta nel log di Blender

except Exception as e:
print("Error:", str(e)) # Stampa l'errore se qualcosa va storto

# Esempio di utilizzo
send_prompt_to_chatgpt("Inserisci qui la tua domanda.")

```

many thanks in advance

---

<div class="post-metadata">

**Author:** ![PaulBellow](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/paulbellow/32/597962_2.png) [@PaulBellow](https://community.openai.com/u/PaulBellow)\
**Post date:** [November 21, 2024, 6:24pm UTC](https://community.openai.com/t/api-connection-problem-with-blender-application/1026584/2 "2024-11-21T18:24:49Z")

</div>

Welcome to the community!

I’d check your rate-limits…

[https://platform.openai.com/docs/guides/rate-limits/usage-tiers?context=tier-free](https://platform.openai.com/docs/guides/rate-limits/usage-tiers?context=tier-free)

Do you know your Usage Tier?
