Quickstart
Create your first agent time entry in under 5 minutes.
Prerequisites
- A Keito workspace (sign up at keito.ai if you don’t have one)
- An API key (see Authentication)
- An agent user created in your workspace
Step 1: Get Your API Key
Navigate to Settings → API in the Keito web app and create a new API key. Copy it — you’ll need it for every request.
Step 2: Create a Time Entry
cURL
curl -X POST https://api.keito.ai/v1/time-entries \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"project_id": "prj_abc",
"task_id": "tsk_001",
"spent_date": "2026-03-06",
"hours": 1.5,
"notes": "Implemented OAuth flow",
"source": "agent",
"metadata": {
"agent_id": "my-bot-01",
"agent_type": "claude-code",
"session_id": "550e8400-e29b-41d4-a716-446655440000",
"model": "claude-opus-4-6"
}
}'
Node SDK
import { Keito } from '@keito/sdk';
const keito = new Keito({
apiKey: process.env.KEITO_API_KEY,
accountId: process.env.KEITO_ACCOUNT_ID,
});
const entry = await keito.timeEntries.create({
project_id: 'prj_abc',
task_id: 'tsk_001',
spent_date: '2026-03-06',
hours: 1.5,
notes: 'Implemented OAuth flow',
source: 'agent',
metadata: {
agent_id: 'my-bot-01',
agent_type: 'claude-code',
session_id: crypto.randomUUID(),
model: 'claude-opus-4-6',
},
});
console.log(`Created entry: ${entry.id}`);
Python SDK
import os
from keito import Keito
client = Keito(
api_key=os.environ["KEITO_API_KEY"],
account_id=os.environ["KEITO_ACCOUNT_ID"],
)
entry = client.time_entries.create(
project_id="prj_abc",
task_id="tsk_001",
spent_date="2026-03-06",
hours=1.5,
notes="Implemented OAuth flow",
source="agent",
metadata={
"agent_id": "my-bot-01",
"agent_type": "claude-code",
"session_id": "550e8400-e29b-41d4-a716-446655440000",
"model": "claude-opus-4-6",
},
)
print(f"Created entry: {entry.id}")
CLI
keito time log --project acme --task development \
--hours 1.5 \
--notes "Implemented OAuth flow" \
--source agent \
--agent-id my-bot-01
Step 3: Log an LLM Expense
After the agent finishes work, log the token cost:
cURL
curl -X POST https://api.keito.ai/v1/expenses \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"project_id": "prj_abc",
"expense_category_id": "cat_llm_usage",
"spent_date": "2026-03-06",
"units": 45,
"notes": "claude-opus-4-6: 30k input + 15k output tokens",
"source": "agent",
"metadata": {
"agent_id": "my-bot-01",
"session_id": "550e8400-e29b-41d4-a716-446655440000",
"model": "claude-opus-4-6",
"input_tokens": 30000,
"output_tokens": 15000
}
}'
Node SDK
await keito.expenses.create({
project_id: 'prj_abc',
expense_category_id: 'cat_llm_usage',
spent_date: '2026-03-06',
units: 45,
notes: 'claude-opus-4-6: 30k input + 15k output tokens',
source: 'agent',
metadata: {
agent_id: 'my-bot-01',
session_id: entry.metadata.session_id,
model: 'claude-opus-4-6',
input_tokens: 30000,
output_tokens: 15000,
},
});
Python SDK
client.expenses.create(
project_id="prj_abc",
expense_category_id="cat_llm_usage",
spent_date="2026-03-06",
units=45,
notes="claude-opus-4-6: 30k input + 15k output tokens",
source="agent",
metadata={
"agent_id": "my-bot-01",
"session_id": entry.metadata["session_id"],
"model": "claude-opus-4-6",
"input_tokens": 30000,
"output_tokens": 15000,
},
)
CLI
keito expense log --project acme --quantity 45 \
--notes "claude-opus-4-6: 30k input + 15k output tokens"
Step 4: Verify in the UI
Open the Keito web app. Navigate to your project’s time entries. You should see your new entry with a violet Agent badge.
What’s Next?
- Agent Integration Patterns — learn the start/stop timer pattern for real-time tracking.
- Node SDK Guide — full SDK setup.
- Python SDK Guide — full SDK setup.
- CLI Guide — install and configure the CLI.