Python SDK: Getting Started
The Keito Python SDK (keito-python) provides a client for Python applications, agent frameworks, and notebooks.
Install
pip install keito-python
# or
poetry add keito-python
Initialise
import os
from keito import Keito
client = Keito(
api_key=os.environ["KEITO_API_KEY"],
account_id=os.environ["KEITO_ACCOUNT_ID"],
)
Like the Node SDK, the Python client reads from environment variables by default:
client = Keito() # reads KEITO_API_KEY and KEITO_ACCOUNT_ID from env
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
api_key | str | env | Your API key |
account_id | str | env | Your workspace ID |
base_url | str | https://api.keito.ai/v1 | API base URL |
max_retries | int | 2 | Max retry attempts on failure |
timeout | float | 30.0 | Request timeout in seconds |
Your First Request
# List all projects
projects = client.projects.list()
for project in projects.data:
print(f"{project.name} ({project.id})")
Next Steps
- Time Entries — create, list, and manage time entries
- Expenses — log LLM token costs
- Agent Integration — context manager and decorator patterns