How to Interpret Images in OpenAI GPT-4 API with External Links?

I’m trying to use the OpenAI GPT-4 API to interpret images provided as external URLs, specifically screenshots related to Autodesk Revit issues. My application sends a problem description and a screenshot link to the API, but the response indicates that the image cannot be processed.

Here is the code snippet I am using:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>private async Task<string> SendMessageToGPT(string description, string imageUrl)
{
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization", apiKey);
var content = new
{
model = "gpt-4o-mini",
messages = new[]
{
new { role = "system", content = "You are a Revit Support Assistant, solving issues related to Autodesk Revit." },
new { role = "user", content = $"Here is a problem description: {description}. Also, take a look at this screenshot: {imageUrl}. Interpret the screenshot and provide a detailed response." }
}
};
string jsonContent = JsonConvert.SerializeObject(content);
HttpContent httpContent = new StringContent(jsonContent, Encoding.UTF8, "application/json");
HttpResponseMessage response = await client.PostAsync("https://api.openai.com/v1/chat/completions", httpContent);
string responseBody = await response.Content.ReadAsStringAsync();
dynamic result = JsonConvert.DeserializeObject(responseBody);
if (result?.choices != null && result.choices.Count > 0)
{
return result.choices[0].message.content;
}
else
{
return "There was an issue with the API response. Please check the response structure.";
}
}
}
</code>
<code>private async Task<string> SendMessageToGPT(string description, string imageUrl) { using (HttpClient client = new HttpClient()) { client.DefaultRequestHeaders.Add("Authorization", apiKey); var content = new { model = "gpt-4o-mini", messages = new[] { new { role = "system", content = "You are a Revit Support Assistant, solving issues related to Autodesk Revit." }, new { role = "user", content = $"Here is a problem description: {description}. Also, take a look at this screenshot: {imageUrl}. Interpret the screenshot and provide a detailed response." } } }; string jsonContent = JsonConvert.SerializeObject(content); HttpContent httpContent = new StringContent(jsonContent, Encoding.UTF8, "application/json"); HttpResponseMessage response = await client.PostAsync("https://api.openai.com/v1/chat/completions", httpContent); string responseBody = await response.Content.ReadAsStringAsync(); dynamic result = JsonConvert.DeserializeObject(responseBody); if (result?.choices != null && result.choices.Count > 0) { return result.choices[0].message.content; } else { return "There was an issue with the API response. Please check the response structure."; } } } </code>
private async Task<string> SendMessageToGPT(string description, string imageUrl)
{
    using (HttpClient client = new HttpClient())
    {
        client.DefaultRequestHeaders.Add("Authorization", apiKey);

        var content = new
        {
            model = "gpt-4o-mini",
            messages = new[]
            {
                new { role = "system", content = "You are a Revit Support Assistant, solving issues related to Autodesk Revit." },
                new { role = "user", content = $"Here is a problem description: {description}. Also, take a look at this screenshot: {imageUrl}. Interpret the screenshot and provide a detailed response." }
            }
        };

        string jsonContent = JsonConvert.SerializeObject(content);
        HttpContent httpContent = new StringContent(jsonContent, Encoding.UTF8, "application/json");

        HttpResponseMessage response = await client.PostAsync("https://api.openai.com/v1/chat/completions", httpContent);
        string responseBody = await response.Content.ReadAsStringAsync();

        dynamic result = JsonConvert.DeserializeObject(responseBody);

        if (result?.choices != null && result.choices.Count > 0)
        {
            return result.choices[0].message.content;
        }
        else
        {
            return "There was an issue with the API response. Please check the response structure.";
        }
    }
}

Unfortunately, I keep receiving a message indicating that images cannot be processed.

I understand that the GPT-4 model may not directly support image analysis through a link in a text-based request. Is there a specific way to send an image (via URL or otherwise) for it to be interpreted by the API? Is there another OpenAI model or API endpoint that allows image processing or should I be using a different approach?

Any guidance on how to properly integrate image recognition within the GPT-4 API or related services would be greatly appreciated.

Thank you for your time!

1

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật