Skip to main content

langchain-ktemia

PyPI

LangChain tools for the Ktemia travel search API. Give your agent flight, hotel, and rental car search across airlines, booking sites, and rental companies, with each seller's price and a booking link.

Ktemia searches and compares. It does not book: results carry links that hand off to the seller's own site.

Get a free API key · LangChain guide · API reference · Pricing

Install

pip install langchain-ktemia
export KTEMIA_API_KEY=your-key

Use with an agent

from langchain.agents import create_agent
from langchain_ktemia import KtemiaToolkit

agent = create_agent("openai:gpt-5-mini", tools=KtemiaToolkit().get_tools())
result = agent.invoke(
    {"messages": [("user", "What is the cheapest flight from Los Angeles to London on 2027-03-14?")]}
)
print(result["messages"][-1].content)

Any chat model with tool calling works. The agent looks up places, runs the search, and reads booking options on its own.

Tools

Tool Class Use it for
ktemia_key_status KtemiaKeyStatus Plan, rate limits, and requests left this month. Costs no quota.
ktemia_lookup KtemiaLookup Airport, airline, hotel, and car rental location codes
ktemia_search_flights KtemiaSearchFlights One-way, return, and multi-city fares
ktemia_search_hotels KtemiaSearchHotels Hotels and stays by location id
ktemia_search_cars KtemiaSearchCars Rental cars by pickup location id
ktemia_get_details KtemiaGetDetails Every seller's price and booking link for one result
ktemia_get_hotel_reviews KtemiaHotelReviews Guest reviews for one hotel, with filters

Tool names and descriptions are the same as the Ktemia MCP server and the Vercel AI SDK tools, so an agent behaves the same way on every framework.

Use one tool on its own:

from langchain_ktemia import KtemiaLookup

print(KtemiaLookup().invoke({"kind": "airport", "query": "London"}))

Paging, errors, and quota

  • A search returns the first page and a nextToken when there are more. Call the same tool again with only nextToken to read the next page. Each result includes a pagingHint that says what to do next.
  • Errors come back as {"error": {"code", "message", "retryable"}} instead of raising, so the model can react: ask for a missing date, or stop on QUOTA_EXCEEDED.
  • Input that can only fail, such as a past date or a city name where an airport code belongs, is rejected before any request is sent, so it spends no quota.
  • Rate limits are retried automatically using Retry-After. A spent monthly quota is never retried.
  • Every call except ktemia_key_status counts against the account's monthly quota. A new search costs two requests: one to start it and one to read the first page.

Configuration

KtemiaToolkit(api_key="...")          # instead of KTEMIA_API_KEY
KtemiaSearchFlights(client=my_ktemia) # reuse a configured ktemia.Ktemia client

Async agents work too: every tool implements ainvoke.

MIT licensed.

Metadata

Release files for langchain-ktemia 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-ktemia 0.1.0
File Size Uploaded Provenance Actions
langchain_ktemia-0.1.0.tar.gz 165.0 kB With provenance Details for langchain_ktemia-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-ktemia 0.1.0
File Interpreter ABI Platform Actions
langchain_ktemia-0.1.0-py3-none-any.whl Python 3 none any Details for langchain_ktemia-0.1.0-py3-none-any.whl

Total release size: 174.4 kB

Release files / langchain_ktemia-0.1.0.tar.gz

Download URL langchain_ktemia-0.1.0.tar.gz
Size 165.0 kB
Tags Source
SHA-256 checksum
How to use checksums
834f4e43a0faf7ca752e7f31452117aa6529576dbf1cfd2d21477f5bf56ea030
BLAKE2b-256 checksum
How to use checksums
22c9412e70b965bc8194278c38210ef9b8f4d256ddc1b1085e9c711cbbb61f94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / langchain_ktemia-0.1.0-py3-none-any.whl

Download URL langchain_ktemia-0.1.0-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
266b33af79e128e6fb598b4de80ae95135b04be57eda2cae9abecb443902f8f0
BLAKE2b-256 checksum
How to use checksums
9888e5437a45ab1a566faa2ef4f6f4cd4b294d6c7840026c7f9434255a440d6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Security for langchain-ktemia 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for langchain_ktemia-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page