Connect an agent
Connecting an agent to Aikount is two steps: get a token and plug that token into your agent client. From there, the agent runs the books for you while you or your accountant supervise.
Step 1 — Get an API key
From a logged-in session, mint an API key (prefix agl_) at POST /api/v1/auth/api-keys. Store it as a secret; it is shown only once. The details are in Authentication and API keys.
Check it works before continuing:
curl https://api.aikount.com/api/v1/tenants/me \
-H "Authorization: Bearer agl_your_key_here"
Step 2 — Plug it into your agent
An agent can use Aikount two ways: over MCP (the agent discovers the accounting tools) or over direct HTTP (the agent calls the endpoints). The MCP route is the most convenient for agent clients:
- Claude Code — add the Aikount MCP server. Remote:
https://api.aikount.com/mcpwith theAuthorization: Bearer agl_...header. Local:uvx aikount-mcpwithAIKOUNT_TOKEN=agl_.... - Cursor — configure Aikount as an MCP server, remote or local, with the same token.
- Gemini CLI — register it as an MCP server, with the token in the header (remote) or in
AIKOUNT_TOKEN(local). - Codex — same: add the Aikount MCP server with your
agl_key.
The transport and authentication details for each mode (streamable-HTTP with header, or stdio with AIKOUNT_TOKEN) are in MCP.
The skill file (drop-in)
To let an agent grasp how to use Aikount at once —what it is, how it authenticates, what endpoints exist— we publish a ready-to-add skill file:
https://aikount.com/skills/agentledger/SKILL.md
Give it to your agent as context (or place it where your client loads skills). It summarizes the authentication model and the core endpoints, so the agent starts operating without you explaining it.
Good practices
- Use one key per agent/environment, so you can revoke one without affecting the others.
- Don't put the key in the repository or in logs; pass it via environment variable or secrets manager.
- Start on the demo or on test data before letting the agent operate on real data.