axio-transport-anthropic

Anthropic Claude completion transport for the direct API and Vertex AI.

It reads the stream with an axio-sse Reader keyed on the format’s own event: field. That reader is axio_transport_anthropic.Messages, with one @on(...) method per published event. Its unmatched() forwards anything else as ProviderEvent(provider="anthropic").

Its usage counts are converted into the axio rule before they leave the transport. The API reports input_tokens as only what follows the last cache breakpoint. The cache read and cache write counts are therefore added back to make an inclusive total.

class axio_transport_anthropic.AnthropicTransport(name: 'str' = 'Anthropic', base_url: 'str' = <factory>, api_key: 'str' = <factory>, vertexai: 'bool' = False, project: 'str' = '', location: 'str' = '', model: 'ModelSpec' = <factory>, models: 'ModelRegistry' = <factory>, session: 'aiohttp.ClientSession | None' = None, temperature: 'float | None' = None, top_p: 'float | None' = None, top_k: 'int | None' = None, thinking_budget: 'int | None' = None, max_retries: 'int' = 10, retry_base_delay: 'float' = 5.0)[source]