Chat route with Azure OpenAI Servicev3.8+

Configure a chat route using Azure OpenAI Service with the latest GPT-3.5 Turbo model and version 2023-01-01 of the Azure API.

Prerequisites

  • Azure OpenAI instance

  • Azure OpenAI model deployment

Environment variables

  • AZURE_INSTANCE_NAME: The name of the Azure OpenAI instance.

  • AZURE_DEPLOYMENT_ID: The ID of the Azure OpenAI deployment.

  • AZURE_OPENAI_API_KEY: The API key to use to connect to Azure OpenAI.

Set up the plugin

Add this section to your declarative configuration file:

_format_version: "3.0"
plugins:
  - name: ai-proxy-advanced
    config:
      targets:
      - route_type: llm/v1/chat
        auth:
          header_name: api-key
          header_value: ${{ env "DECK_AZURE_OPENAI_API_KEY" }}
        model:
          provider: azure
          name: gpt-35-turbo
          options:
            azure_api_version: '2023-01-01'
            azure_instance: ${{ env "DECK_AZURE_INSTANCE_NAME" }}
            azure_deployment_id: ${{ env "DECK_AZURE_DEPLOYMENT_ID" }}
Copied to clipboard!

Did this doc help?

Something wrong?

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!