# Manage API endpoints

As a space owner or admin, you can set up [API endpoints](https://autosheet.com/docs/resources/guides/concepts#api-endpoint) for your [space](https://autosheet.com/docs/resources/guides/concepts#space). Models available through the endpoints will be accessible to all users in the space

> **Info**
>
> API endpoints are available only for GPT for Excel Word – Autosheet spaces.

## Connect to Azure OpenAI

GPT for Excel – Autosheet and GPT for Word can connect to [Azure AI](https://azure.microsoft.com/en-us/products/ai-foundry/tools) to use [OpenAI models](https://learn.microsoft.com/en-us/azure/foundry/foundry-models/concepts/models-sold-directly-by-azure). In Azure AI, each model has a dedicated API endpoint that you use to access the model.

**Prerequisites**

- You are the owner or an admin of the space.
- Your space is on the [Business or Enterprise plan](https://autosheet.com/docs/resources/pricing/subscription) or [pay-as-you-go pricing](https://autosheet.com/docs/resources/pricing/pay-as-you-go).
- You have an [Azure account](https://azure.microsoft.com/en-us/pricing/purchase-options/azure-account) with Azure AI service access.
- You have [deployed a model](https://learn.microsoft.com/en-us/azure/foundry-classic/openai/how-to/create-resource) in a project.

To connect to an Azure OpenAI API endpoint:

1. [Get the Azure OpenAI API endpoint details.](https://autosheet.com/docs/admin/ai-configuration/manage-api-endpoints#get-the-azure-openai-api-endpoint-details)
2. [Set up the Azure OpenAI API endpoint.](https://autosheet.com/docs/admin/ai-configuration/manage-api-endpoints#set-up-the-azure-openai-api-endpoint)

### Get the Azure OpenAI API endpoint details

To connect to Azure AI from GPT for Excel – Autosheet and GPT for Word, you need the endpoint URL, API key, deployment name, and model name for the Azure OpenAI model you want to use.

1. Sign in to [Microsoft Foundry](https://ai.azure.com/).

2. Select the project that has the model you want to use.

3. Click **View deployments**.

4. In **Deployed models**, in the models list, click the name of the model you want to use.

   ![Select the deployed model](https://autosheet.com/docs/article-images/servers/azure-select-deployed-model.png)

5. Select **Details**.

6. In the model details, copy the **Target URI**, **Key**, **Deployment name**, and **Model name**.

   ![Copy the endpoint details](https://autosheet.com/docs/article-images/servers/azure-copy-endpoint-details.png)

### Set up the Azure OpenAI API endpoint

1. Sign in to the [Autosheet dashboard](https://dashboard.autosheet.com/) with your Microsoft or Google account.

2. In the sidebar, select **Custom API endpoints**.

3. Select the **Bulk models** tab.

4. Click **Azure OpenAI endpoints (Chat Completions API)**.

   > **Tip**
   >
   > If you already have Azure OpenAI API endpoints set up, click **Add an Azure OpenAI API endpoint**.

5. Define the endpoint settings:

   - **Endpoint URL**: Enter the endpoint URL for the model using the Azure OpenAI Chat Completions API endpoint format:

     ```
     https://<resource-name>.<domain>/openai/deployments/<deployment-name>/chat/completions?api-version=<api-version>
     ```

     If the URL you copied does not use the above format, rewrite it. For example, let's assume that your deployment name is `gpt-5.4-mini`, the API version is `2025-04-01-preview`, and you copied the following URL:

     ```
     https://company-resource.services.ai.azure.com/openai/v1/responses
     ```

     To rewrite the URL into the Chat Completions API format, replace everything after the domain with `/openai/deployments/<deployment-name>/chat/completions?api-version=<api-version>` and replace the placeholders with your deployment name and the API version:

     ```
     https://company-resource.services.ai.azure.com/openai/deployments/gpt-5.4-mini/chat/completions?api-version=2025-04-01-preview
     ```

     > **Info**
     >
     > The `api-version` is the Azure OpenAI REST API version, which is not shown on the Microsoft Foundry model details page. As a rule, use `2025-04-01-preview` as the value.

   - **Model name**: Enter the model name.

   - **API key**: Enter the API key for accessing the endpoint.

   - **Display name (optional)**: Enter a custom display name for the model. If not set, the model switcher uses **Model name** as the display name.

   ![Define Azure OpenAI API endpoint settings](https://autosheet.com/docs/article-images/dashboard/api-endpoints-settings-azure-bulk.png)

6. Click **Check** to validate the settings and click **Save**.

   ![Save Azure OpenAI API endpoint settings](https://autosheet.com/docs/article-images/dashboard/api-endpoints-settings-azure-save.png)

You have set up the Azure OpenAI API endpoint. All space users can now use the endpoint model in GPT for Excel – Autosheet and GPT for Word.

## Connect to OpenAI-compatible API endpoints

> **Info**
>
> This feature is only available if your space is on the [Business or Enterprise plan](https://autosheet.com/docs/resources/pricing/subscription) or [pay-as-you-go pricing](https://autosheet.com/docs/resources/pricing/pay-as-you-go).

GPT for Excel – Autosheet and GPT for Word can connect to any AI service that provides an [OpenAI-compatible API endpoint](https://developers.openai.com/api/reference/overview). You can connect to two main types of services: [**cloud-based platforms**](https://autosheet.com/docs/resources/guides/concepts#cloud-hosted-model), which provide access to models over the internet with no software installation or setup required on your part, and [**local servers**](https://autosheet.com/docs/resources/guides/concepts#local-model), which you run on a local machine, such as your own computer or another computer on a local network.

You can use the endpoint-connected models both as [Agent models](https://autosheet.com/docs/resources/guides/concepts#agent-model) (only in Excel) and [bulk models](https://autosheet.com/docs/resources/guides/concepts#bulk-model), but the endpoint requirements are different:

- **Agent models**: The endpoint must be compatible with the [OpenAI Responses API](https://developers.openai.com/api/reference/responses/overview) and be publicly accessible over the internet through HTTPS. In addition, the model must support a context size of at least 32K tokens.
- **Bulk models**: The endpoint must be compatible with the [OpenAI Chat Completions API](https://developers.openai.com/api/reference/chat-completions/overview).

Here are some popular services that provide an OpenAI-compatible API endpoint:

- **Cloud-based platforms:**

  - [Anyscale](https://www.anyscale.com/)
  - [Fireworks AI](https://fireworks.ai/)
  - [Together AI](https://www.together.ai/)

- **Local servers:**

  - [LM Studio](https://lmstudio.ai/)
  - [LocalAI](https://localai.io/)
  - [Ollama](https://ollama.com/)

> **Info**
>
> Depending on the model you use, the model settings defined in GPT for Excel – Autosheet or GPT for Word (temperature (creativity), top-p, frequency penalty, and presence penalty) may not work as expected. If you get bad results, try tweaking the settings.

**Agent models**

**Prerequisites**

- You are the owner or an admin of the space.
- You have an endpoint URL and, if needed, an API key for accessing the service.
- The endpoint supports the following OpenAI-compatible API resource path: `/v1/responses`
- The endpoint is publicly accessible over the internet through HTTPS.
- The model supports a context size of at least 32K tokens.

1. Sign in to the [Autosheet dashboard](https://dashboard.autosheet.com/) with your Microsoft or Google account.

2. In the sidebar, select **Custom API endpoints**.

3. Select the **Agent models** tab.

4. Click **OpenAI-compatible endpoints (Responses API)**.

   > **Tip**
   >
   > If you already have OpenAI-compatible API endpoints set up, click **Add an OpenAI-compatible API endpoint**.

5. Define the endpoint settings:

   - **Endpoint URL**: Enter the URL of the service that provides the endpoint.
   - **Model ID**: Enter the ID of the model to use through the endpoint. The model ID is sent to the endpoint in the request payload.
   - **Display name (optional)**: Enter a short name that identifies the model in the Agent model switcher.
   - **API key (optional)**: If required, enter the API key for accessing the service.

   ![Define OpenAI-compatible API endpoint settings](https://autosheet.com/docs/article-images/dashboard/api-endpoints-settings-openai-agent.png)

6. Click **Check** to validate the settings and click **Save**.

   ![Save OpenAI-compatible API endpoint settings](https://autosheet.com/docs/article-images/dashboard/api-endpoints-settings-openai-save.png)

You have set up the OpenAI-compatible API endpoint. All space users can now select the model in the Agent model switcher in GPT for Excel – Autosheet.

**Bulk models**

**Prerequisites**

- You are the owner or an admin of the space.

- You have an endpoint URL and, if needed, an API key for accessing the service.

- The endpoint supports the following OpenAI-compatible API resource paths:

  - `/v1/models`
  - `/v1/chat/completions`

1. Sign in to the [Autosheet dashboard](https://dashboard.autosheet.com/) with your Microsoft or Google account.

2. In the sidebar, select **Custom API endpoints**.

3. Select the **Bulk models** tab.

4. Click **OpenAI-compatible endpoints (Chat Completions API)**.

   > **Tip**
   >
   > If you already have OpenAI-compatible API endpoints set up, click **Add an OpenAI-compatible API endpoint**.

5. Define the endpoint settings:

   - **Endpoint URL**: Enter the URL of the service that provides the endpoint.
   - **Display name (optional)**: Enter a short name that is prefixed to the model names in the model switcher. By default, the model names are prefixed with "custom/".
   - **API key (optional)**: If required, enter the API key for accessing the service.

   ![Define OpenAI-compatible API endpoint settings](https://autosheet.com/docs/article-images/dashboard/api-endpoints-settings-openai-bulk.png)

6. Click **Check** to validate the settings and click **Save**.

   ![Define OpenAI-compatible API endpoint settings](https://autosheet.com/docs/article-images/dashboard/api-endpoints-settings-openai-save.png)

   > **Tip**
   >
   > If you get an error saying that the URL is invalid, make sure that the endpoint supports:
   >
   > - **Cross-origin resource sharing (CORS).** See the LM Studio setup instructions for [macOS](https://autosheet.com/docs/gpt-for-excel/setup/manage-models/connect-to-api-endpoints/set-up-lm-studio-on-macos#start-and-configure-the-lm-studio-server) or [Windows](https://autosheet.com/docs/gpt-for-excel/setup/manage-models/connect-to-api-endpoints/set-up-lm-studio-on-windows#start-and-configure-the-lm-studio-server).
   > - **HTTPS (needed with Safari and with Microsoft Office for Mac).** See the LM Studio setup instructions for [macOS](https://autosheet.com/docs/gpt-for-excel/setup/manage-models/connect-to-api-endpoints/set-up-lm-studio-on-macos#enable-https-for-the-lm-studio-server).

You have set up the OpenAI-compatible API endpoint. All space users can now use all models available through the endpoint in GPT for Excel – Autosheet and GPT for Word.

## What's next

- [Manage API keys for your space.](https://autosheet.com/docs/admin/ai-configuration/manage-api-keys)
- [Manage models for your space.](https://autosheet.com/docs/admin/ai-configuration/manage-models)
- [Manage users in your team.](https://autosheet.com/docs/admin/user-management)
