Skip to content

Commit 5e87886

Browse files
author
gitName
committed
draft complete
1 parent 3e50475 commit 5e87886

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed
132 KB
Loading

articles/api-management/openai-compatible-google-gemini-api.md

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,42 +19,40 @@ This article shows you how to import an OpenAI-compatible Google Gemini API to a
1919
Learn more about managing AI APIs in API Management:
2020

2121
* [Generative AI gateway capabilities in Azure API Management](genai-gateway-capabilities.md)
22-
* [Importing and managing OpenAI-compatible language model APIs in Azure API Management](openai-compatible-llm-api.md)
22+
* [Import an OpenAI-compatible language model API](openai-compatible-llm-api.md)
2323

2424
## Prerequisites
2525

2626
- An existing API Management instance. [Create one if you haven't already](get-started-create-service-instance.md).
2727
- An API key for the Gemini API. If you don't have one, create it at [Google AI Studio](https://aistudio.google.com/apikey) and store it in a safe location.
2828

29-
## Import language model API using the portal
3029

31-
32-
33-
## Import an OpenAI-compatible Gemini model
34-
35-
1. Create an API key for the Gemini API at [Google AI Studio](https://aistudio.google.com/apikey) and store it in a safe location.
36-
1. Note the following base URL from the [Gemini OpenAI compatibility documentation](https://ai.google.dev/gemini-api/docs/openai).
37-
38-
`https://generativelanguage.googleapis.com/v1beta/openai`
30+
## Import an OpenAI-compatible Gemini model using the portal
3931

4032
1. In the [Azure portal](https://portal.azure.com), navigate to your API Management instance.
4133
1. In the left menu, under **APIs**, select **APIs** > **+ Add API**.
4234
1. Under **Define a new API**, select **Language Model API**.
4335
1. On the **Configure API** tab:
4436
1. Enter a **Display name** and optional **Description** for the API.
45-
1. In **URL**, enter the following base URL base URL from the [Gemini OpenAI compatibility documentation](https://ai.google.dev/gemini-api/docs/openai):
37+
1. In **URL**, enter the following base URL from the [Gemini OpenAI compatibility documentation](https://ai.google.dev/gemini-api/docs/openai):
4638
`https://generativelanguage.googleapis.com/v1beta/openai`
4739

4840
1. In **Path**, append a path that your API Management instance uses to route requests to the Gemini API endpoints.
4941
1. In **Type**, select **Create OpenAI API**.
5042
1. In **Access key**, enter the following:
5143
1. **Header name**: *Authorization*.
52-
1. **Header value (key)**: `Bearer` followed by your API key for the Gemini API .
44+
1. **Header value (key)**: `Bearer` followed by your API key for the Gemini API.
5345
1. On the remaining tabs, optionally configure policies to manage token consumption, semantic caching, and AI content safety. For details, see [Import an OpenAI-compatible language model API](openai-compatible-llm-api.md).
5446

55-
:::image type="content" source="media/openai-compatible-llm-api/gemini-import.png" alt-text="Screenshot of importing a Gemini LLM API in the portal.":::
47+
:::image type="content" source="media/openai-compatible-google-gemini-api/gemini-import.png" alt-text="Screenshot of importing a Gemini LLM API in the portal.":::
5648
1. Select **Create**.
5749

50+
API Management creates the API and configures the following:
51+
52+
* A [backend](backends.md) resource and a [set-backend-service](set-backend-service-policy.md) policy that direct API requests to the Google Gemini endpoint.
53+
* Access to the LLM backend using the Gemini API key you provided. The key is protected as a secret [named value](api-management-howto-properties.md) in API Management.
54+
* (optionally) Policies to help you monitor and manage the API.
55+
5856
### Test Gemini model
5957

6058
After importing the API, you can test the chat completions endpoint for the API.
@@ -85,4 +83,4 @@ After importing the API, you can test the chat completions endpoint for the API.
8583

8684
:::image type="content" source="media/openai-compatible-google-gemini-api/gemini-test.png" alt-text="Screenshot of testing a Gemini LLM API in the portal.":::
8785

88-
[!INCLUDE [api-management-define-api-topics.md](../../includes/api-management-define-api-topics.md)]
86+
[!INCLUDE [api-management-define-api-topics.md](../../includes/api-management-define-api-topics.md)]

0 commit comments

Comments
 (0)