feat(providers): add native Azure OpenAI and Foundry header support (#319)

This commit is contained in:
badgerbees authored and GitHub committed 2026-03-21 07:33:18 +07:00
1 parent 551b6670d5
commit 7200ecb7fe
1 file changed
+6 -1
+6 -1
View File
@@ -412,7 +412,12 @@ func (p *OpenAIProvider) doRequest(ctx context.Context, body any) (io.ReadCloser
}
httpReq.Header.Set("Content-Type", "application/json")
httpReq.Header.Set("Authorization", "Bearer "+p.apiKey)
// Azure OpenAI/Foundry support for now atleast
if strings.Contains(strings.ToLower(p.apiBase), "azure.com") {
httpReq.Header.Set("api-key", p.apiKey)
} else {
httpReq.Header.Set("Authorization", "Bearer "+p.apiKey)
}
resp, err := p.client.Do(httpReq)
if err != nil {