# Using smolagents with openAI api

**URL:** <https://discuss.huggingface.co/t/using-smolagents-with-openai-api/149923>\
**Category:** Beginners\
**Created:** [April 11, 2025, 8:19am UTC](https://discuss.huggingface.co/t/using-smolagents-with-openai-api/149923 "2025-04-11T08:19:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![javidr](https://avatars.discourse-cdn.com/v4/letter/j/7cd45c/32.png) [@javidr](https://discuss.huggingface.co/u/javidr)\
**Post date:** [April 11, 2025, 8:19am UTC](https://discuss.huggingface.co/t/using-smolagents-with-openai-api/149923/1 "2025-04-11T08:19:04Z")

</div>

Hi

Do you know if smolagentd can interact with OpenAI when connecting via azure endpoint?

It is, I am using an OpenAI instance in azure but I need to connect to it via url, sending a request to the api endpoint instead of using the library

Can smolagents be integrated with this?

Thanks

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [April 11, 2025, 10:08am UTC](https://discuss.huggingface.co/t/using-smolagents-with-openai-api/149923/2 "2025-04-11T10:08:07Z")

</div>

Since **OpenAIServerModel** and **AzureOpenAIServerModel** are provided as standard, I think it should be possible to achieve this by using one of these.

> **[Models](https://huggingface.co/docs/smolagents/reference/models#smolagents.OpenAIServerModel)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

> **[Models](https://huggingface.co/docs/smolagents/reference/models#smolagents.AzureOpenAIServerModel)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.
