Passer au contenu principal
This page is in English: the LangChain integration targets developers worldwide. The rest of this documentation is in French. langchain-lexio packages the Lexio API as LangChain tools. An agent built with it answers questions such as “which vans are free from 14 to 16 December, and how much?” or “which rentals start tomorrow?”, and can prepare a priced quote if you allow it.

Install

Use an internal key, created in Lexio under Settings › Developer › API tokens (Authentication): partner keys cannot read the fleet or the customers. The API is part of the Business plan, and there is no sandbox: point the agent at a dedicated organization while you test.

Tools

LexioToolkit() returns the six read-only tools. LexioToolkit(allow_quotes=True) adds lexio_create_quote: a quote fixes the price of one vehicle for one period and books nothing. No tool creates, changes or cancels a rental, a payment or a customer. Give the key only the scopes of the tools you use.

Build an agent

What the model must know

  • Local time. start_at and end_at are the agency’s local time without offset (2026-12-14T09:00:00), as everywhere in the API (Amounts, VAT and dates).
  • Indicative prices. lexio_check_availability returns the price with the default mileage package, excess and deposit. Only a quote fixes it.
  • Small outputs. Lists are capped by max_results (20 by default) and trimmed to the useful fields; lexio_get_rental returns the full rental.
  • Errors. API errors are raised as typed exceptions carrying the Lexio code and requestId (Errors). Rate limits are those of the key (Limits).
  • Cancelled rentals. Without a status filter, lexio_list_rentals includes cancelled rentals.

Without LangChain

  • Claude or ChatGPT connect to Lexio without code through the MCP server.
  • lexio-rent is the plain Python client these tools use.
Source code: github.com/lexio-rent-git/langchain-lexio (MIT).