Skip to content

How to add authentication (e.g., API key) when using Python A2A client? #82

@magicbrighter

Description

@magicbrighter

Hi team,

I'm trying to use the Python A2A client to interact with an A2A-compatible agent endpoint that requires authentication via an API key. For example, the endpoint can be accessed via curl like this:

curl 'https://mcp.amap.com/a2a/agent/agent_card/.well-known/agent.json' \
  -H 'key: {your-developer-api-key}'

However, I don't see a straightforward way to pass custom headers (like the key header above) when initializing or using the A2A client in Python.

Could you please provide guidance or an example on how to include authentication headers (such as an API key) when making requests through the Python A2A library?

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions