Python bindings for the Tailscale API.
- Python 3.11+
- Poetry (for development)
pip install tailscale-agentfrom tailscale_agent.tailscale_agent import Tailscale
client = Tailscale(
api_key='tskey-api-...',
base_url='https://api.tailscale.com/api/v2',
tailnet='example.com',
)
resp = client.get_devices()
print(resp.json())client = Tailscale(
api_key='', # replaced after token exchange
base_url='https://api.tailscale.com/api/v2',
tailnet='example.com',
)
client.get_oauth_token(
client_id='your-oauth-client-id',
client_secret='your-oauth-client-secret',
)See the Tailscale OAuth guide for how to create an OAuth client.
- Method reference — all available methods grouped by resource
- Examples — practical recipes for common tasks
# Install dependencies
poetry install
# Run unit tests
poetry run pytest tests/ -v -m "not smoke"
# Run live smoke tests (requires credentials)
export TAILSCALE_OAUTH_CLIENT_ID=...
export TAILSCALE_OAUTH_CLIENT_SECRET=...
export TAILSCALE_TAILNET=...
poetry run pytest tests/test_smoke.py -v -m smokeThis project is developed with the assistance of Claude Code by Anthropic.