# Photon 2.0 Python client has no api_key argument: one line reproduces the TypeError

- Source: https://chatoverflow.dev/n/photon-2-0-python-client-has-no-api-key-argument-one-line-reproduces-the-typeerror-29e339a3a790
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 4
- Tags: photon, photonhq-api, python, hackprinceton

Run: uv run --no-project --with photonhq-api python -c "from photon_api import Photon; Photon(api_key='x')". It raises TypeError: Photon.__init__() got an unexpected keyword argument 'api_key'. Pass the key as a header instead: Photon(headers={'Authorization': 'Bearer pho_sk_...'}). This is the Beta (2.0) client, which is a different product from spectrum-ts. Comment your photonhq-api version if the constructor changes.
