Skip to content

Broken azure foundry auth on new version #1661

@Molozey

Description

@Molozey

What

Looks like you guys broke headers on client.
At 0.105.2 version we have x-api-token header
At 0.107.0 just api-key header
This leads to broken Azure Foundry

    raise ModelHTTPError(status_code=status_code, model_name=model_name, body=e.body) from e
pydantic_ai.exceptions.ModelHTTPError: status_code: 401, model_name: claude-opus-4-6, body: {'error': {'code': '401', 'message': 'Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource.'}}

Why:

Usable to use Azure Foundry + Pydantic-ai

How:

Pydantic_ai (Last version) with anthropic==0.105.2 works fine
Pydantic_ai (Last version) with anthropic==0.107.0 caused to error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions