https://www.boundaryml.com logo
🟡 Adding Azure AI Foundry Clients
# questions
t
How to add Azure AI foundary clients ? I can see azure now provides openai response api models as well.
https://{resource.name}-eastus2.cognitiveservices.azure.com/openai/responses?api-version=2025-04-01-preview
a
There are some docs [here](https://docs.boundaryml.com/ref/llm-client-providers/azure-ai-foundary). But yes you're on the right track, you use OpenAI API format:
Copy code
ts
client<llm> AzureAiFoundary {
  provider "openai-generic"
  options {
    base_url "https://RESOURCE_NAME.REGION.models.ai.azure.com"
    api_key env.MY_API_KEY
  }
}
t
Tried with both full url and base url getting
Copy code
Unspecified error code: 404 Request failed with status code: 404 Not Found, 
{"error":{"code":"404","message": "Resource not found"}}

Request options: {}
Copy code
client<llm> AzureOpenAI5_1_Chat {
  provider "azure-openai"
  options {
    base_url "https://{{resource}}-eastus2.cognitiveservices.azure.com/openai/deployments/gpt-5.1-chat"
    api_version "2024-12-01-preview"
    api_key env.AZURE_OPENAI_API_KEY
    // max_completion_tokens 4096
  }
}
Working with 'max_completion_tokens', without this getting below error
Copy code
Unspecified error code: 400 Request failed with status code: 400 Bad Request, 
{
  "error": {
    "message": "Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.",
    "type": "invalid_request_error",
    "param": "max_tokens",
    "code": "unsupported_parameter"
  }
}

Request options: {"max_tokens":4096}