> ## Documentation Index
> Fetch the complete documentation index at: https://getlago.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent tools and contracts

> Which Lago AI agent tools work with contracts today, and which work with the v1 API only.

Most of Lago's AI agent tools were built on the v1 API. They call `/api/v1` and do not read or write products, Rate Cards or Contracts yet.

## Works with contracts

| Tool | How to use it with contracts |
| - | - |
| [Lago CLI](https://github.com/getlago/lago-cli) | `lago v2` commands (CLI 1.3.0 and later) cover the product catalog, plans, contracts, events and current usage. |
| [v2 OpenAPI contract](https://swagger.getlago.com/openapi-v2.yaml) | Exact `/api/v2` schemas for generated clients and agent tools. |
| [Documentation MCP](https://docs.getlago.com/mcp) | Searches public docs, including the Contracts pages. It does not read organization data. |

Start with [AI tools for Lago](https://getlago.com/docs/v2/guide/ai-agents/for-agents.md) and [Build Lago billing with a coding agent](https://getlago.com/docs/v2/guide/ai-agents/coding-agents.md).

## v1 only

| Tool | Why it works with the v1 API (`/api/v1`) only | v1 guide |
| - | - | - |
| Lago MCP server | All its tools call `/api/v1`. No tool reads or writes products, Rate Cards or Contracts. | [Lago MCP Server](https://getlago.com/docs/guide/ai-agents/mcp-server.md) |
| Billing Assistant | Runs on the MCP server's tools, which call `/api/v1`. | [Billing Assistant](https://getlago.com/docs/guide/ai-agents/billing-assistant.md) |
| Finance Assistant | Contract support is unverified: it answers through a separate service, and Lago has not confirmed it reads contract data. Do not rely on it for contracts. | [Finance Assistant](https://getlago.com/docs/guide/ai-agents/finance-assistant.md) |
| Dunning Agent | Calls `/api/v1` for invoices and payments. Dunning campaigns are not part of v2. | [Dunning Agent](https://getlago.com/docs/guide/ai-agents/dunning-agent.md) |
| Lago Agent SDK | Does not send `external_contract_id`, which v2 events use to address a Contract. | [Agent SDK overview](https://getlago.com/docs/guide/ai-agents/agent-sdk/overview.md) |
| Agent Storefront | Enrollment and gate checks run on `/api/v1`. Enrolled agents are not billed through Contracts. | [Agent Storefront](https://getlago.com/docs/guide/ai-agents/agent-storefront.md) |
| x402 | Credit purchases, gate checks and invoice payments run on `/api/v1/x402`. They do not resolve Contracts. | [x402 payments](https://getlago.com/docs/guide/ai-agents/x402.md) |

To meter LLM usage on a Contract today, send token events yourself to [`POST /api/v2/events`](https://getlago.com/docs/v2/api-reference/events/create) with `external_contract_id`. See [Usage ingestion](https://getlago.com/docs/v2/guide/events/ingesting-usage.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.