There are 2 ways to add your Azure OpenAI credentials to your requests:

Add it from the UI

1

Go to the Credentials page

2

Add your Azure OpenAI credentials.

3

(Optional) Choose models you want to use credits

You can choose the models you want to use your credits with. Just simply type the model ID from the Models page and copy the model id and paste it in the input field. Press Enter to add the model.

Leave it empty to apply your credentials for all Azure OpenAI models.

Add it in code

1

Map your deployment name

We understand that you may have a custom name for your Azure deployment. Keywords AI is using the model’s origin name which may not be able to match your deployment. You can use model_name_map to map the default name to your custom name.

Here’s an example: if you want to use azure/gpt-4o on Keywords AI with your own Azure credentials and custom deployment name, you should put your custom deployment name in the model_name_map object, and we’ll use it to make requests to your deployment.

{
    "model": "azure/gpt-4o",
    "model_name_map": {
      "original_model_name": "azure/your_custom_model_name"
      // e.g, "azure/gpt-4o": "azure/{your gpt-4o's deployment name}"
    }
}
2

Add your own credentials

Add customer_credentials parameter in your request body to use your own Azure OpenAI credits.

model_name_map only works when your credentials is Valid.
{
  // Rest of the request body
  "customer_credentials": {
    "azure_openai": {
      "api_key": "YOUR_AZURE_OPENAI_API_KEY",
      "api_base": "YOUR_AZURE_OPENAI_API_BASE_URL",
      "api_version": "YOUR_AZURE_OPENAI_API_VERSION",
    }
  }
}
3

Override credentials for a particular model. (Optional)

One-off credential overrides. Instead of using what is uploaded for each provider, this targets credentials for individual models.

{
  // Rest of the request body
  "customer_credentials": {
    "azure_openai": {
      "api_key": "YOUR_AZURE_OPENAI_API_KEY",
      "api_base": "YOUR_AZURE_OPENAI_API_BASE_URL",
      "api_version": "YOUR_AZURE_OPENAI_API_VERSION",
    }
  },
  "credential_override": {
    "azure/gpt-4o":{ // override for a specific model.
      "api_key": "YOUR_ANOTHER_AZURE_OPENAI_API_KEY",
      "api_base": "YOUR_AZURE_OPENAI_API_BASE_URL",
      "api_version": "YOUR_AZURE_OPENAI_API_VERSION",
    }
  }
}

Requirements

  1. Ensure your deployment name matches those listed on our Models page.
  2. Confirm that your models are available in the region specified by your credentials.
    Credentials validation is not supported. Failure to comply with these requirements will result in errors!

Full request example

How to get your Azure OpenAI credentials

To find the parameters needed, you can follow these steps:

  • Visit your Azure Portal.
  • You will see your deployments via the above link, choose the deployment you want to use.
  • Click on the “Endpoints” link to get the API base URL.
  • Click on the “Manage Keys” link to get the API key.