# Using smolagents with openAI api

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fusing-smolagents-with-openai-api%2F149923%3E%5C
**Category:** Beginners\
**Created:** [April 11, 2025, 8:19am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fusing-smolagents-with-openai-api%2F149923 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fjavidr)%5C
**Post date:** [April 11, 2025, 8:19am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fusing-smolagents-with-openai-api%2F149923%2F1 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [April 11, 2025, 10:08am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fusing-smolagents-with-openai-api%2F149923%2F2 "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.
