api_key does not replace an api-key header for gRPC requests

Open Beginner friendly
#1,667 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 6 days

@Steve-20-ai is already working on this.

Since Nov 9, 2026.

  • #1668 by @RaphaelFakhri — open
  • #1686 by @Steve-20-ai — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
65/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python

Research direction

Start by locating where QdrantClient builds _grpc_headers and where AsyncQdrantClient handles the same setting. Check how existing tests cover api_key and custom headers, then run the relevant gRPC client tests. Done means both sync and async gRPC requests send the api_key value in place of any api-key value supplied in headers.

Written by the indexing model from the issue text.

Description

Current behavior

When you pass both api_key and an api-key entry in headers, the client warns that the header "will be overridden with api_key parameter value". REST requests do send api_key. gRPC requests send both values as api-key metadata, with the header value first:

from qdrant_client import QdrantClient

client = QdrantClient(
    host="localhost",
    prefer_grpc=True,
    https=True,
    api_key="from-param",
    headers={"api-key": "from-headers"},
    check_compatibility=False,
)
print(client._client._grpc_headers)
# [('api-key', 'from-headers'), ('api-key', 'from-param')]

The server reads the first api-key value (HeaderMap::get), so gRPC requests authenticate with the header value, while REST requests from the same client use api_key. With a stale key in headers, REST calls succeed and gRPC calls fail with Unauthenticated. AsyncQdrantClient behaves the same way.

Expected behavior

api_key replaces the api-key header for gRPC too, as the warning says.

Dominant language
Python
Stars
1.4k
Forks
409
Avg merge
11d 14h
Merged PRs (30d)
11

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from qdrant/qdrant-client

All issues in qdrant/qdrant-client

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.