# Image to text description in the API?

**URL:** <https://community.openai.com/t/image-to-text-description-in-the-api/477152>\
**Category:** API\
**Created:** [November 7, 2023, 5:46am UTC](https://community.openai.com/t/image-to-text-description-in-the-api/477152 "2023-11-07T05:46:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![fourchette](https://avatars.discourse-cdn.com/v4/letter/f/ac91a4/32.png) [@fourchette](https://community.openai.com/u/fourchette)\
**Post date:** [November 7, 2023, 5:46am UTC](https://community.openai.com/t/image-to-text-description-in-the-api/477152/1 "2023-11-07T05:46:32Z")

</div>

Hi

I’ve been using some other image to text models out there.

I have been really amazed by the image description feature of chatgpt.

I understood in yesterday’s keynote that the feature would finally be available in the API. looking at the documentation this morning, I do not find it…

Did I miss something?

---

<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 7, 2023, 5:49am UTC](https://community.openai.com/t/image-to-text-description-in-the-api/477152/2 "2023-11-07T05:49:18Z")

</div>

Welcome to the forum.

The [Learn how to use GPT-4 to understand images](https://platform.openai.com/docs/guides/vision) page should help…

---

<div class="post-metadata">

**Author:** ![fourchette](https://avatars.discourse-cdn.com/v4/letter/f/ac91a4/32.png) [@fourchette](https://community.openai.com/u/fourchette)\
**Post date:** [November 7, 2023, 5:54am UTC](https://community.openai.com/t/image-to-text-description-in-the-api/477152/3 "2023-11-07T05:54:29Z")

</div>

😅  
thanks. I does cover my needs.

Can’t understand how I managed to have missed it despite scrolling through it twice

---

<div class="post-metadata">

**Author:** ![Edin](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/edin/32/267837_2.png) [@Edin](https://community.openai.com/u/Edin)\
**Post date:** [December 5, 2023, 6:21pm UTC](https://community.openai.com/t/image-to-text-description-in-the-api/477152/4 "2023-12-05T18:21:30Z")

</div>

Hi PaulBellow, I checked your link and can see the model “gpt-4-vision-preview”.

After checking in my playground, I am not able to see the specific vision version. Is there any reason? Please see below the screenshot.

Thanks for your support. Edin

 ![Bildschirmfoto 2023-12-05 um 19.20.00](https://us1.discourse-cdn.com/openai1/original/4X/7/5/e/75e69103db1127911b423c316d30f1ec89dae776.png)

---

<div class="post-metadata">

**Author:** ![curt.kennedy](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/curt.kennedy/32/709249_2.png) [@curt.kennedy](https://community.openai.com/u/curt.kennedy)\
**Post date:** [December 5, 2023, 6:25pm UTC](https://community.openai.com/t/image-to-text-description-in-the-api/477152/5 "2023-12-05T18:25:54Z")

</div>

To see all models you can use, not just in Playground, goto:

Playground \> Settings \> Limits

Then click Show All Models, should get something like this:

 ![Screenshot 2023-12-05 at 11.25.30 AM](https://us1.discourse-cdn.com/openai1/original/4X/e/4/e/e4e0fc63e784fe2c6506c2681230d6216ec5c839.png)

I don’t see a Vision model variant in Playground, but it is available in the API, and in this list.

Update: Weird, I see it in Playground after selecting Completion and then scroll to Chat

 ![Screenshot 2023-12-05 at 11.33.59 AM](https://us1.discourse-cdn.com/openai1/original/4X/d/b/8/db8827efc2b0161b3cd3e1fe4ffa7639a09e974c.png)

Anyway, it’s best to just use the Playground \> Settings \> Limits and see what you all have. The UI in Playground might be a bit glitchy.

I don’t know you can even use Vision in the Playground now, since I don’t see a URL field to point the model to an image. But I had to go to “Complete” first to even get it to list.

---

<div class="post-metadata">

**Author:** ![Edin](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/edin/32/267837_2.png) [@Edin](https://community.openai.com/u/Edin)\
**Post date:** [December 5, 2023, 6:50pm UTC](https://community.openai.com/t/image-to-text-description-in-the-api/477152/6 "2023-12-05T18:50:17Z")

</div>

Thank you [curt.kennedy](https://community.openai.com/u/curt.kennedy)!

Now I can see it, but how you mentioned already, just in the Playground “Complete” and not having the possibility to link an image.

I tried it also over “Assistant” with GPT-4 model (because the vision model was not listed) and was able to attached the image but get an error message.

---

<div class="post-metadata">

**Author:** ![curt.kennedy](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/curt.kennedy/32/709249_2.png) [@curt.kennedy](https://community.openai.com/u/curt.kennedy)\
**Post date:** [December 5, 2023, 7:02pm UTC](https://community.openai.com/t/image-to-text-description-in-the-api/477152/7 "2023-12-05T19:02:08Z")

</div>

Just run it using your API credentials. Here is a simple example. Just put in your real API Key, actual image url, and what you want in System and User. Just like the chat models, lots of influence with System and User.

```auto
import requests

payload = {"model": "gpt-4-vision-preview",
    "messages": [
     {"role": "system",
      "content": [{"type": "text",
                   "text": "You are a cool image analyst. Your goal is to describe what is in this image."}],
     },
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "What is in the image?"
          },
          {
            "type": "image_url",
            "image_url": {
              "url": "https://link.to.something/image.png"
            }
          }
        ]
      }
    ],
    "max_tokens": 500
  }

headers = {"Authorization": f"Bearer YOUR_API_KEY",
            "Content-Type": "application/json"}

response = requests.post('https://api.openai.com/v1/chat/completions', headers=headers, json=payload)
r = response.json()
print(r)
print(r["choices"][0]["message"]["content"])

```

---

<div class="post-metadata">

**Author:** ![\_j](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/_j/32/766292_2.png) [@\_j](https://community.openai.com/u/_j)\
**Post date:** [April 1, 2024, 4:37pm UTC](https://community.openai.com/t/image-to-text-description-in-the-api/477152/9 "2024-04-01T16:37:23Z")

</div>

> [@benedicttamang92](#):
>
> Two men in love, both clad in black; one dons a black t-shirt while the other sports a vest.

It seems you want **ChatGPT Plus** :

 ![image](https://us1.discourse-cdn.com/openai1/original/4X/c/e/5/ce553b2a177bd8ae959f0b784d39319091775787.jpeg)

Go to [https://chat.openai.com/?e=irni](https://chat.openai.com/?e=irni) - $20 USD/month.

The low quality of following prompts now seems typical. This is “ethnically Filipino Asian” for you:

 ![c14104a6-4041-48c2-8f84-6ceca57b8d3a](https://us1.discourse-cdn.com/openai1/original/4X/0/7/0/070ad4917828930bd9db1f0b27eceed4012c7a07.webp)
