You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/api-management/openai-compatible-google-gemini-api.md
+12-14Lines changed: 12 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,42 +19,40 @@ This article shows you how to import an OpenAI-compatible Google Gemini API to a
19
19
Learn more about managing AI APIs in API Management:
20
20
21
21
*[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)
23
23
24
24
## Prerequisites
25
25
26
26
- An existing API Management instance. [Create one if you haven't already](get-started-create-service-instance.md).
27
27
- 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.
28
28
29
-
## Import language model API using the portal
30
29
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).
## Import an OpenAI-compatible Gemini model using the portal
39
31
40
32
1. In the [Azure portal](https://portal.azure.com), navigate to your API Management instance.
41
33
1. In the left menu, under **APIs**, select **APIs** > **+ Add API**.
42
34
1. Under **Define a new API**, select **Language Model API**.
43
35
1. On the **Configure API** tab:
44
36
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):
1. In **Path**, append a path that your API Management instance uses to route requests to the Gemini API endpoints.
49
41
1. In **Type**, select **Create OpenAI API**.
50
42
1. In **Access key**, enter the following:
51
43
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.
53
45
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).
54
46
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.":::
56
48
1. Select **Create**.
57
49
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
+
58
56
### Test Gemini model
59
57
60
58
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.
85
83
86
84
:::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.":::
0 commit comments