Anthropic Claude transport for Axio
Project description
axio-transport-anthropic
Anthropic Claude transport for axio.
Streams Claude responses over the Anthropic Messages API using aiohttp and
SSE parsing. Supports prompt caching, extended thinking, and automatic retry
on rate-limit and overload errors.
Features
- All Claude models — Opus, Sonnet, Haiku; configurable via
ANTHROPIC_MODELS - Prompt caching —
cache_control: ephemeralapplied automatically to the system prompt and the last tool definition - Extended thinking —
ReasoningDeltaevents emitted for thinking blocks - Retry logic — automatic backoff on 429 / 529; honours
Retry-Afterheader - TUI integration — settings screen for API key and model selection
Installation
pip install axio-transport-anthropic
With the TUI settings screen:
pip install "axio-transport-anthropic[tui]"
Or as part of the full TUI bundle:
pip install "axio-tui[anthropic]"
Usage
import aiohttp
from axio.agent import Agent
from axio.context import MemoryContextStore
from axio_transport_anthropic import AnthropicTransport, ANTHROPIC_MODELS
async def main() -> None:
async with aiohttp.ClientSession() as session:
transport = AnthropicTransport(
api_key="sk-ant-...",
model=ANTHROPIC_MODELS["claude-sonnet-4-6"],
session=session,
)
agent = Agent(system="You are helpful.", tools=[], transport=transport)
ctx = MemoryContextStore()
print(await agent.run("Hello!", ctx))
Set the API key via environment variable instead of passing it directly:
export ANTHROPIC_API_KEY="sk-ant-..."
Models
| Model ID | Context | Max output | Notes |
|---|---|---|---|
claude-opus-4-6 |
1 M | 128 k | Most capable |
claude-sonnet-4-6 |
1 M | 64 k | Balanced (default) |
claude-haiku-4-5-20251001 |
200 k | 64 k | Fastest / cheapest |
claude-opus-4-5 |
200 k | 64 k | — |
claude-sonnet-4-5 |
200 k | 64 k | — |
Configuration
| Parameter | Default | Description |
|---|---|---|
api_key |
"" |
Anthropic API key |
model |
claude-sonnet-4-6 |
Active model |
base_url |
https://api.anthropic.com/v1 |
API base URL |
max_retries |
10 |
Max retry attempts on 429/529 |
retry_base_delay |
5.0 |
Base delay (seconds) for exponential backoff |
Part of the axio ecosystem
axio · axio-tui · axio-transport-openai · axio-transport-codex
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file axio_transport_anthropic-0.6.0.tar.gz.
File metadata
- Download URL: axio_transport_anthropic-0.6.0.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
658deec639bf02038b568235629859532a07242e93ff99941479ac15aba7c7ed
|
|
| MD5 |
3afeae315235024ab959d9d790e1eb4a
|
|
| BLAKE2b-256 |
87d576e6a3df638d6c8a2a9164c84a5ca19bcc3133a4008c3ebe20c0b5ccc2e1
|
Provenance
The following attestation bundles were made for axio_transport_anthropic-0.6.0.tar.gz:
Publisher:
publish.yml on axio-agent/monorepo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
axio_transport_anthropic-0.6.0.tar.gz -
Subject digest:
658deec639bf02038b568235629859532a07242e93ff99941479ac15aba7c7ed - Sigstore transparency entry: 1322167194
- Sigstore integration time:
-
Permalink:
axio-agent/monorepo@9e5c1e46072eadfc89eb4c76340cbfb6b5f2d22c -
Branch / Tag:
refs/tags/0.6.0 - Owner: https://github.com/axio-agent
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9e5c1e46072eadfc89eb4c76340cbfb6b5f2d22c -
Trigger Event:
release
-
Statement type:
File details
Details for the file axio_transport_anthropic-0.6.0-py3-none-any.whl.
File metadata
- Download URL: axio_transport_anthropic-0.6.0-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d637c25513008e493aed91c1245936f0fa98665a76fc80e46dddace1e97af37c
|
|
| MD5 |
64d83a1b63d4b118007bcb7b9e80a764
|
|
| BLAKE2b-256 |
7d0bb62049a2e4e0cbd08fc592eecfe072493504ec3acb6a18aeaac0bf431f98
|
Provenance
The following attestation bundles were made for axio_transport_anthropic-0.6.0-py3-none-any.whl:
Publisher:
publish.yml on axio-agent/monorepo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
axio_transport_anthropic-0.6.0-py3-none-any.whl -
Subject digest:
d637c25513008e493aed91c1245936f0fa98665a76fc80e46dddace1e97af37c - Sigstore transparency entry: 1322167271
- Sigstore integration time:
-
Permalink:
axio-agent/monorepo@9e5c1e46072eadfc89eb4c76340cbfb6b5f2d22c -
Branch / Tag:
refs/tags/0.6.0 - Owner: https://github.com/axio-agent
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9e5c1e46072eadfc89eb4c76340cbfb6b5f2d22c -
Trigger Event:
release
-
Statement type: