AI agents and API
Tekoälyagentit · Suomeksi
You can let your own AI or tool read your Ajos driving log. Access is always read-only and covers only the user's own data. It requires an Ajos Plus or Pro subscription.
1. Connect an AI by signing in (recommended)
In your AI app (Claude, ChatGPT or any MCP client) add a new connector with this address:
https://app.afir.fi/mcp
The app sends you to the Ajos sign-in (Google, Apple or email) and a consent page. After you approve, the connection works without keys. Connections are listed, and can be removed, at ajos.app/oma.
2. Your own script or agent: personal key
Sign in at ajos.app/oma and create a key under AI connections. The key (afk_…) is shown only once. Store it in your tool's secret storage, not in a message or in code.
curl -H "Authorization: Bearer afk_..." \
-H "User-Agent: MyAgent/1.0" \
"https://app.afir.fi/api/data/summary?from=2026-01-01&to=2026-12-31&group_by=month"
Send your own User-Agent
Cloudflare blocks requests that carry a programming language's default identifier (for example Python-urllib). The result is 403 with error code: 1010, and the request never reaches Ajos. Always set your own:
import json, urllib.request
req = urllib.request.Request(
"https://app.afir.fi/api/data/trips?limit=5",
headers={"Authorization": "Bearer afk_...", "User-Agent": "MyAgent/1.0"},
)
print(json.load(urllib.request.urlopen(req)))
MCP tools (read-only)
list_vehicles: vehicles (make, model, plate, odometer)list_trips: trips, newest first; filtersfrom,to,purpose(workorprivate),vehicle_id,limit,offsettrip_summary: number of trips, kilometres and compensation for a period;fromandtorequired,group_by:none,month,vehicleorpurposeexport_trips_csv: the driving log as CSV (at most 366 days), the same as the app's export
Dates use YYYY-MM-DD. Questions an AI can answer: "How many work kilometres did I drive in October?", "Make a monthly summary for my accountant."
REST API
Base address https://app.afir.fi/api/data: /vehicles, /trips, /summary, /export.csv. Description: openapi.json. The same sign-in (OAuth) or a personal key works.
Limits and errors
- Read-only. Nothing can be added, changed or deleted.
- 120 requests per minute, at most 1000 trips per request, at most 5 active keys.
401: missing or invalid key or sign-in.403witherror code: 1010: add your own User-Agent (above).403without 1010: the subscription does not include API access.- A key stops working when the subscription ends. You can remove a key at any time at ajos.app/oma.
Using the data
The data belongs to the user. Use it only for what the user asks and do not share it further. The user is responsible for their own data once they give an outside app access (privacy policy, section 8).
More
- llms.txt (summary for machines)
- Support · info@afir.fi