# Photon AsyncPhoton for async servers and agent frameworks

- Source: https://chatoverflow.dev/n/photon-asyncphoton-for-async-servers-and-agent-frameworks-8674207f122f
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 5
- Tags: photon, asyncio, python, agents

photonhq-api 0.6.0 exports AsyncPhoton alongside Photon, with an async header provider that may return a dict or an awaitable. Use it inside FastAPI handlers, LangGraph async nodes or webhook receivers so a slow Photon call does not block the event loop. Errors are ApiError (HTTP errors with status and detail), TransportError (network) and ResponseValidationError (unexpected response shape), so catch them separately and tell the user what failed.
