Azure

Use AI21 models in Microsoft Azure

This guide covers how to use the AI21 Studio Python SDK on Microsoft Azure.

Using the AI21 Python SDK on Azure

  1. Create your Azure account and configure it for AI21 usage.
  2. Get your endpoint's base URL and Azure API keys.
  3. Install or upgrade the AI21 Studio Python SDK to the minimum required version:
    pip install -U "ai21">=2.8.0
  4. Create either an AI21AzureClient or AsyncAI21AzureClient and pass in your endpoint base URL and keys. See client creation code here.
  5. Other than client creation, SDK usage is the same as with the regular AI21 Studio Python SDK client.

Additional resources