tesla-fleet-api
Tesla Fleet API library for Python
What it is and what it does
Tesla Fleet API is a Python client for Tesla's official Fleet API, designed to let developers control Tesla vehicles and energy infrastructure programmatically. It wraps the cloud-based Fleet API with support for signed commands (cryptographic verification of mutations), local Bluetooth communication for vehicles, and a routing layer that automatically fails over between local and cloud backends. The library also integrates with Teslemetry and Tessie services as alternative backends.
The package is built on async/await patterns using aiohttp and includes specialized classes for vehicles (TeslaFleetApi, VehicleBluetooth, VehicleSigned), energy sites (EnergySites), and routers that compose multiple backends. It handles Bluetooth transport errors, connection state, and command confirmation ladders for reliability. All API interactions are asynchronous, and the library manages BLE keepalive, key generation, and failover logic internally.
Use it for:
- Build a home automation system that controls Tesla vehicles and Powerwall/energy sites via local Bluetooth when available, falling back to cloud API.
- Implement a fleet management dashboard that lists vehicles, sends signed commands (lock/unlock, climate control), and monitors energy site status.
- Create a local-first Tesla vehicle integration for Home Assistant or similar platforms, prioritizing Bluetooth over cloud to reduce latency and API calls.
- Develop a monitoring service that listens to unsolicited Bluetooth broadcasts for real-time vehicle status updates without polling.
- Integrate Tesla vehicle control into a custom mobile or web app using signed commands for security-sensitive operations.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides Python bindings to Tesla's Fleet API for controlling vehicles and energy sites, with support for signed commands, local Bluetooth communication, and routing/failover across cloud and local backends.
Yes, if you need to control Tesla vehicles or energy sites programmatically. The library is actively maintained, has no known vulnerabilities, and offers both cloud and local Bluetooth pathways with automatic failover. The Python 3.13+ requirement is restrictive but matches current best practice. Install it if you're building Tesla integrations; skip it if you only need read-only telemetry or cannot upgrade to Python 3.13.
Install
tesla-fleet-api on PyPI
pip
pip install tesla-fleet-apiuv
uv add tesla-fleet-apipoetry
poetry add tesla-fleet-apiInstalling tesla-fleet-api
Before you install
Low friction: pure Python wheel with no compiled dependencies. Active maintenance—last commit 2026-08-13, released 1 day ago. Requires Python 3.13+, which narrows compatibility to current versions only.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; you must include a copy of the license and note material changes.
Quickstart
pip install tesla-fleet-api
import asyncio
import aiohttp
from tesla_fleet_api import TeslaFleetApi
async def main():
async with aiohttp.ClientSession() as session:
api = TeslaFleetApi(
access_token="<token>",
session=session,
region="na"
)
vehicles = await api.vehicles.list()
print(vehicles)
asyncio.run(main())
Requires Python 3.13+; all API calls are async and require an aiohttp ClientSession.
Verify before relying
- Whether Teslemetry and Tessie integrations require separate API credentials or configuration beyond the Fleet API token.
- Specific latency and reliability characteristics of local Bluetooth vs. cloud failover routing in practice.
- Whether the keepalive interval behavior (default ~20 seconds) can be tuned or disabled per-vehicle instance.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.13) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 8 — aiohttp, aiofiles, aiolimiter, cryptography, protobuf, tesla-protocol, bleak, bleak-retry-connector |
| Maintenance | actively maintained — 1 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 94,955/month — #13,295 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: tesla_fleet_api-1.9.0-py3-none-any.whl
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
fleet-pythonFleet SDK provides programmatic access to…
permissive · top 15,000 on PyPI
hyundai-kia-connect-apiProvides a Python API to authenticate with and…
permissive · top 15,000 on PyPI
myskodaMySkoda is an async Python library that…
unclear · top 15,000 on PyPI
renault-apiCommunicates with Renault's private API to read…
permissive · top 15,000 on PyPI
teslajsonpyAn async Python library for interacting with…
permissive · top 15,000 on PyPI
govee-bleProvides Python bindings to discover, connect…
permissive · top 15,000 on PyPI
xiaomi-bleManages Xiaomi BLE (Bluetooth Low Energy)…
permissive · top 15,000 on PyPI
subarulinkInteract with Subaru's MySubaru Connected…
permissive · top 15,000 on PyPI
aiobmsbleAsynchronous Python library for querying…
permissive · top 15,000 on PyPI
python-otbr-apiProvides a Python client to interact with an…
permissive · top 15,000 on PyPI