# Api playground davinci 003 python

**URL:** <https://community.openai.com/t/api-playground-davinci-003-python/55022>\
**Category:** API\
**Created:** [February 9, 2023, 7:01pm UTC](https://community.openai.com/t/api-playground-davinci-003-python/55022 "2023-02-09T19:01:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lotus64santon](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/lotus64santon/32/27468_2.png) [@lotus64santon](https://community.openai.com/u/lotus64santon)\
**Post date:** [February 9, 2023, 7:01pm UTC](https://community.openai.com/t/api-playground-davinci-003-python/55022/1 "2023-02-09T19:01:49Z")

</div>

bonjour j’ai fait ce code en python pour utiliser l’api de playground de openai, mais j’ai une erreur pourriez vous m’aider svp.

hello i made this code in python to use the playground api from openai, but i have an error could you please help me.

**please don’t use my api keys**

code :  
import requests

# Définition de la clé API

api\_key = “[api-key]EP9rXtiJ”

# Définition de l’URL pour la requête API

url = “[https://api.openai.com/v1/engines/playground/run](https://api.openai.com/v1/engines/playground/run)”

# Paramètres de la requête API

payload = {  
“engine”: “text-davinci-003”,  
“prompt”: “What is the capital of France?”,  
“max\_tokens”: 100,  
“temperature”: 0.5,  
}

# Ajout de la clé API aux en-têtes de la requête

headers = {  
“Content-Type”: “application/json”,  
“Authorization”: "Bearer " + api\_key  
}

# Exécution de la requête API

response = requests.post(url, json=payload, headers=headers)

# Affichage de la réponse

print(response.text)

error:  
{  
“error”: {  
“message”: “That model does not exist”,  
“type”: “invalid\_request\_error”,  
“param”: null,  
“code”: null  
}  
}

---

<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:** [February 9, 2023, 7:06pm UTC](https://community.openai.com/t/api-playground-davinci-003-python/55022/2 "2023-02-09T19:06:13Z")

</div>

> [@lotus64santon](#):
>
> “error”: {  
> “message”: “That model does not exist”,

> [@lotus64santon](#):
>
> url = “[https://api.openai.com/v1/engines/playground/run”](https://api.openai.com/v1/engines/playground/run%E2%80%9D)

Have you checked out the Docs?

[https://platform.openai.com/docs/api-reference/completions/create](https://platform.openai.com/docs/api-reference/completions/create)

---

<div class="post-metadata">

**Author:** ![lotus64santon](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/lotus64santon/32/27468_2.png) [@lotus64santon](https://community.openai.com/u/lotus64santon)\
**Post date:** [February 9, 2023, 8:03pm UTC](https://community.openai.com/t/api-playground-davinci-003-python/55022/3 "2023-02-09T20:03:04Z")

</div>

no but i the code was make by ChatGPT

---

<div class="post-metadata">

**Author:** ![raymonddavey](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/raymonddavey/32/14125_2.png) [@raymonddavey](https://community.openai.com/u/raymonddavey)\
**Post date:** [February 9, 2023, 8:10pm UTC](https://community.openai.com/t/api-playground-davinci-003-python/55022/4 "2023-02-09T20:10:54Z")

</div>

ChatGPT makes things up. It tends to use old information, and this is an old endpoint

Most of the code will still work - but you need to look at the completion endpoint in the documentation @PaulBellow pointed you to
