Skip to content

Commit 950a2d5

Browse files
committed
wip
1 parent 66f3c78 commit 950a2d5

File tree

5 files changed

+58
-43
lines changed

5 files changed

+58
-43
lines changed

articles/api-management/azure-ai-foundry-api.md

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,44 @@ ms.service: azure-api-management
55
author: dlepow
66
ms.author: danlep
77
ms.topic: how-to
8-
ms.date: 05/15/2025
8+
ms.date: 05/16/2025
99
ms.collection: ce-skilling-ai-copilot
1010
ms.custom: template-how-to, build-2024
1111
---
1212

13-
# Import an LLM API
13+
# Import an Azure AI Foundry API
1414

1515
[!INCLUDE [api-management-availability-all-tiers](../../includes/api-management-availability-all-tiers.md)]
1616

17-
[INTRO]
17+
You can import AI model endpoints deployed in Azure AI Foundry to your API Management instance as a REST API. Use AI gateway policies and other capabilities in API Management to simplify integration, improve observability, and enhance control over the model endpoints.
1818

1919
Learn more about managing AI APIs in API Management:
2020

21-
* [Generative AI gateway capabilities in Azure API Management](genai-gateway-capabilities.md)
21+
* [AI gateway capabilities in Azure API Management](genai-gateway-capabilities.md)
2222

2323

24-
## AI service options
25-
* **Azure OpenAI service** - Deployment name of a model is passed in the URL path of the API request.
24+
## Client compatibility options
2625

27-
* **Azure AI** - These are models that are available in Azure AI Foundry through the [Azure AI Model Inference API](/azure/ai-studio/reference/reference-model-inference-api). Deployment name of a model is passed in the request body of the API request.
26+
API Management supports two client compatibility options for AI APIs. The option you select determines how clients call the API and how the API Management instance routes requests to the AI service.
2827

28+
* **Azure AI** - Manage model endpoints in Azure AI Foundry that are exposed through the [Azure AI Model Inference API](/azure/ai-studio/reference/reference-model-inference-api).
29+
30+
Clients call the deployment at a `/models` endpoint such as `/Deepseek-3/models/chat/completions`. Deployment name is passed in the request body. Use this option if your service includes models exposed through the Azure AI Model Inference API.
31+
32+
* **Azure OpenAI Service** - Manage model endpoints deployed in Azure OpenAI Service.
33+
34+
Clients call the deployment at an `/openai` endpoint such as `/openai/deployments/my-deployment/chat/completions`. Deployment name is passed in the request path. Use this option if your service only includes Azure OpenAI Service model deployments.
2935

3036
## Prerequisites
3137

3238
- An existing API Management instance. [Create one if you haven't already](get-started-create-service-instance.md).
3339
- One or more Azure AI services with models deployed, such as:
34-
- An Azure OpenAI resource. For information about model deployment in Azure OpenAI service, see the [resource deployment guide](/azure/ai-services/openai/how-to/create-resource).
35-
- An Azure AI Foundry project. For information about creating a project, see [Create a project in the Azure AI Foundry portal](/azure/ai-foundry/how-to/create-projects).
36-
3740

41+
- An Azure AI service in your subscription with one or more models deployed. Examples include models deployed in Azure AI Foundry or Azure OpenAI Service.
3842

39-
## Import AI Foundry API using the portal
43+
## Import AI API using the portal
4044

41-
Use the following steps to import an AI Foundry API directly to API Management.
45+
Use the following steps to import an AI API to API Management.
4246

4347
[!INCLUDE [api-management-workspace-availability](../../includes/api-management-workspace-availability.md)]
4448

@@ -58,19 +62,21 @@ To import an AI Foundry API to API Management:
5862

5963
:::image type="content" source="media/azure-ai-foundry-api/ai-foundry-api.png" alt-text="Screenshot of creating an OpenAI-compatible API in the portal." :::
6064
1. On the **Select AI service** tab:
61-
1. Select the **Subscription** in which to search for AI services (Azure OpenAI services or Azure AI Foundry projects). To get information about the deployments in a service, select the **deployments** link next to the service name.
65+
1. Select the **Subscription** in which to search for AI services such as Azure AI Foundry or Azure OpenAI Service. To get information about the model deployments in a service, select the **deployments** link next to the service name.
6266
:::image type="content" source="media/azure-ai-foundry-api/deployments.png" alt-text="Screenshot of deployments for an AI service in the portal.":::
6367
1. Select an AI service.
6468
1. Select **Next**.
6569
1. On the **Configure API** tab:
6670
1. Enter a **Display name** and optional **Description** for the API.
67-
1. In **Path**, enter a path that your API Management instance uses to access the API endpoints.
71+
1. In **Path**, enter a path that your API Management instance uses to access the deployment endpoint.
6872
1. Optionally select one or more **Products** to associate with the API.
69-
1. In **Client compatibility**, select either of the following based on the types of client you intend to support:
70-
* **Azure OpenAI** - Clients call the model deployment using the OpenAI API format. Select this option if you use only Azure OpenAI deployments.
71-
* **Azure AI** - Clients call the model deployment by passing
72-
1. In **Access key**, optionally enter the authorization header name and API key used to access the LLM API.
73+
1. In **Client compatibility**, select either of the following based on the types of client you intend to support. See [AI service options](#ai-service-options) for more information.
74+
* **Azure OpenAI** - Select this option if your deployment only includes Azure OpenAI Service model deployments.
75+
* **Azure AI** - Select this option if your deployment includes other models available through Azure AI Foundry.
7376
1. Select **Next**.
77+
78+
:::image type="content" source="media/azure-ai-foundry-api/client-compatibility.png" alt-text="Screenshot of AI Foundry API configuration in the portal.":::
79+
7480
1. On the **Manage token consumption** tab, optionally enter settings or accept defaults that define the following policies to help monitor and manage the API:
7581
* [Manage token consumption](llm-token-limit-policy.md)
7682
* [Track token usage](llm-emit-token-metric-policy.md)
@@ -81,19 +87,19 @@ On the **AI content safety**, optionally enter settings or accept defaults to co
8187
1. Select **Review**.
8288
1. After settings are validated, select **Create**.
8389

84-
## Test the LLM API
90+
## Test the AI API
8591

86-
To ensure that your LLM API is working as expected, test it in the API Management test console.
92+
To ensure that your AI API is working as expected, test it in the API Management test console.
8793
1. Select the API you created in the previous step.
8894
1. Select the **Test** tab.
89-
1. Select an operation that's compatible with the model in the LLM API.
95+
1. Select an operation that's compatible with the model in the lanaguage API.
9096
The page displays fields for parameters and headers.
91-
1. Enter parameters and headers as needed. Depending on the operation, you may need to configure or update a **Request body**.
97+
1. Enter parameters and headers as needed. Depending on the operation, you might need to configure or update a **Request body**.
9298
> [!NOTE]
9399
> In the test console, API Management automatically populates an **Ocp-Apim-Subscription-Key** header, and configures the subscription key of the built-in [all-access subscription](api-management-subscriptions.md#all-access-subscription). This key enables access to every API in the API Management instance. Optionally display the **Ocp-Apim-Subscription-Key** header by selecting the "eye" icon next to the **HTTP Request**.
94100
1. Select **Send**.
95101

96-
When the test is successful, the backend responds with a successful HTTP response code and some data. Appended to the response is token usage data to help you monitor and manage your Azure OpenAI API token consumption.
102+
When the test is successful, the backend responds with a successful HTTP response code and some data. Appended to the response is token usage data to help you monitor and manage your language model token consumption.
97103

98104

99105
[!INCLUDE [api-management-define-api-topics.md](../../includes/api-management-define-api-topics.md)]

articles/api-management/azure-openai-api-from-specification.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ms.service: azure-api-management
55
author: dlepow
66
ms.author: danlep
77
ms.topic: how-to
8-
ms.date: 05/14/2025
8+
ms.date: 05/16/2025
99
ms.collection: ce-skilling-ai-copilot
1010
ms.custom: template-how-to, build-2024
1111
---
@@ -14,14 +14,17 @@ ms.custom: template-how-to, build-2024
1414

1515
[!INCLUDE [api-management-availability-all-tiers](../../includes/api-management-availability-all-tiers.md)]
1616

17-
This article shows two options to import an [Azure OpenAI Service](/azure/ai-services/openai/overview) API into an Azure API Management instance as a REST API:
17+
You can import AI model endpoints deployed in [Azure OpenAI Service](/azure/ai-services/openai/overview) to your API Management instance as a REST API. Use AI gateway policies and other capabilities in API Management to simplify integration, improve observability, and enhance control over the model endpoints.
18+
19+
20+
This article shows two options to import an Azure OpenAI API into an Azure API Management instance as a REST API:
1821

1922
- [Import an Azure OpenAI API directly from Azure OpenAI Service](#option-1-import-api-from-azure-openai-service) (recommended)
2023
- [Download and add the OpenAPI specification](#option-2-add-an-openapi-specification-to-api-management) for Azure OpenAI and add it to API Management as an OpenAPI API.
2124

2225
Learn more about managing AI APIs in API Management:
2326

24-
* [Generative AI gateway capabilities in Azure API Management](genai-gateway-capabilities.md)
27+
* [AI gateway capabilities in Azure API Management](genai-gateway-capabilities.md)
2528

2629
## Prerequisites
2730

@@ -134,7 +137,7 @@ To ensure that your Azure OpenAI API is working as expected, test it in the API
134137
* `deployment-id` - the ID of a deployment in the Azure OpenAI service
135138
* `api-version` - a valid Azure OpenAI API version, such as the API version you selected when you imported the API.
136139
:::image type="content" source="media/azure-openai-api-from-specification/test-azure-openai-api.png" alt-text="Screenshot of testing an Azure OpenAI Service API in the portal." lightbox="media/azure-openai-api-from-specification/test-azure-openai-api.png" :::
137-
1. Enter other parameters and headers as needed. Depending on the operation, you may need to configure or update a **Request body**.
140+
1. Enter other parameters and headers as needed. Depending on the operation, you might need to configure or update a **Request body**.
138141
> [!NOTE]
139142
> In the test console, API Management automatically populates an **Ocp-Apim-Subscription-Key** header, and configures the subscription key of the built-in [all-access subscription](api-management-subscriptions.md#all-access-subscription). This key enables access to every API in the API Management instance. Optionally display the **Ocp-Apim-Subscription-Key** header by selecting the "eye" icon next to the **HTTP Request**.
140143
1. Select **Send**.
144 KB
Loading
136 KB
Loading

articles/api-management/openai-compatible-llm-api.md

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,34 +14,37 @@ ms.custom: template-how-to, build-2024
1414

1515
[!INCLUDE [api-management-availability-all-tiers](../../includes/api-management-availability-all-tiers.md)]
1616

17-
[INTRO]
17+
You can import AI model endpoints deployed outside Azure to your API Management instance as a REST API. Use AI gateway policies and other capabilities in API Management to simplify integration, improve observability, and enhance control over the model endpoints.
1818

1919
Learn more about managing AI APIs in API Management:
2020

2121
* [Generative AI gateway capabilities in Azure API Management](genai-gateway-capabilities.md)
2222

23+
## Language model API types
24+
25+
API Management supports two types of self-hosted language model APIs. The option you select determines how clients call the API and how the API Management instance routes requests to the AI service.
26+
27+
* **OpenAI-compatible** - Self-hosted model endpoints that are compatible with OpenAI's API. Examples include models exposed by inference providers such as [Hugging Face Text Generation Inference (TGI)](https://huggingface.co/docs/text-generation-inference/en/index).
28+
29+
API Management configures an OpenAI-compatible chat completions endpoint. Clients call the deployment at an `/openai` endpoint such as `/openai/deployments/my-deployment/chat/completions`.
30+
31+
* **Passthrough** - Other self-hosted model endpoints that aren't compatible with OpenAI's API. Examples include models deployed in [Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-bedrock.html) or other providers.
32+
33+
API Management configures wildcard operations for common HTTP verbs. Clients can append paths to the wildcard operations, and API Management passes requests to the backend.
34+
2335
## Prerequisites
2436

2537
- An existing API Management instance. [Create one if you haven't already](get-started-create-service-instance.md).
26-
- A self-hosted LLM with an API endpoint. You can use an OpenAI-compatible LLM that's exposed by an inference provider such as [Hugging Face Text Generation Inference (TGI)](https://huggingface.co/docs/text-generation-inference/en/index). Alternatively, you can access an LLM through a provider such as [Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-bedrock.html).
27-
> [!NOTE]
28-
> API Management policies such as [llm-token-limit](llm-token-limit-policy.md) and [llm-emit-token-metric](llm-emit-token-metric-policy.md) are supported for APIs available through the [Azure AI Model Inference API](/azure/ai-studio/reference/reference-model-inference-api) or with OpenAI-compatible models served through third-party inference providers.
38+
- A self-hosted (non-Azure-hosted) language model deployment with an API endpoint.
2939

3040

3141
## Import language model API using the portal
3242

33-
Use the following steps to import an LLM API directly to API Management.
43+
Use the following steps to import a language model API to API Management.
3444

3545
[!INCLUDE [api-management-workspace-availability](../../includes/api-management-workspace-availability.md)]
3646

37-
Depending on the API type you select to import, API Management automatically configures different operations to call the API:
38-
39-
* **OpenAI-compatible API** - An operation for the LLM API's chat completion endpoint
40-
* **Passthrough API** - Wildcard operations for standard verbs `GET`, `HEAD`, `OPTIONS`, and `TRACK`. When you call the API, append any required path or parameters to the API request to pass a request to an LLM API endpoint.
41-
42-
For an OpenAI-compatible API, you can optionally configure policies to help you monitor and manage the API.
43-
44-
To import an LLM API to API Management:
47+
To import a language model API to API Management:
4548

4649
1. In the [Azure portal](https://portal.azure.com), navigate to your API Management instance.
4750
1. In the left menu, under **APIs**, select **APIs** > **+ Add API**.
@@ -54,9 +57,12 @@ To import an LLM API to API Management:
5457
1. Enter the **URL** to the LLM API endpoint.
5558
1. Optionally select one or more **Products** to associate with the API.
5659
1. In **Path**, append a path that your API Management instance uses to access the LLM API endpoints.
57-
1. In **Type**, select either **Create OpenAI API** or **Create a passthrough API**.
60+
1. In **Type**, select either **Create OpenAI API** or **Create a passthrough API**. See [Language model API types](#language-model-api-types) for more information.
5861
1. In **Access key**, optionally enter the authorization header name and API key used to access the LLM API.
5962
1. Select **Next**.
63+
64+
:::image type="content" source="media/openai-compatible-llm-api/configure-api.png" alt-text="Screenshot of language model API configuration in the portal.":::
65+
6066
1. On the **Manage token consumption** tab, optionally enter settings or accept defaults that define the following policies to help monitor and manage the API:
6167
* [Manage token consumption](llm-token-limit-policy.md)
6268
* [Track token usage](llm-emit-token-metric-policy.md)
@@ -74,12 +80,12 @@ To ensure that your LLM API is working as expected, test it in the API Managemen
7480
1. Select the **Test** tab.
7581
1. Select an operation that's compatible with the model in the LLM API.
7682
The page displays fields for parameters and headers.
77-
1. Enter parameters and headers as needed. Depending on the operation, you may need to configure or update a **Request body**.
83+
1. Enter parameters and headers as needed. Depending on the operation, you might need to configure or update a **Request body**.
7884
> [!NOTE]
7985
> In the test console, API Management automatically populates an **Ocp-Apim-Subscription-Key** header, and configures the subscription key of the built-in [all-access subscription](api-management-subscriptions.md#all-access-subscription). This key enables access to every API in the API Management instance. Optionally display the **Ocp-Apim-Subscription-Key** header by selecting the "eye" icon next to the **HTTP Request**.
8086
1. Select **Send**.
8187

82-
When the test is successful, the backend responds with a successful HTTP response code and some data. Appended to the response is token usage data to help you monitor and manage your Azure OpenAI API token consumption.
88+
When the test is successful, the backend responds with a successful HTTP response code and some data. Appended to the response is token usage data to help you monitor and manage your language model token consumption.
8389

8490

8591
[!INCLUDE [api-management-define-api-topics.md](../../includes/api-management-define-api-topics.md)]

0 commit comments

Comments
 (0)