Python SDK: Async Usage
AsyncKeito has the same credentials and configuration options as Keito. Use its async context manager to close HTTP connections.
import asyncio
from keito import AsyncKeito
async def main():
async with AsyncKeito() as client:
async for entry in client.time_entries.list(
source="api",
from_date="2026-10-01",
to_date="2026-10-31",
):
print(entry.id, entry.hours)
expense = await client.expenses.get("YOUR_EXPENSE_ID")
print(expense.total_cost)
asyncio.run(main())
List calls return an AsyncPageIterator immediately. Do not write await client.time_entries.list(...) or read .data; fetching occurs during async for. Mutations and item reads are coroutines and must be awaited.
Parallel work
Each user has one running timer. For parallel jobs, record completed durations with separate operation IDs instead of switching one user’s active timer repeatedly. Keep concurrency bounded so the API and your provider stay within their rate limits.
An application may define its own async tracking function, but track_agent_work, track, automatic token pricing and implicit deletion on failure are not SDK features. See explicit agent integration for the choices your wrapper should make.