Flexible flight search,
through your AI.
Point your AI agent at whentofly to search flexible dates and compare economy or business fares returned by connected providers. We’re building toward the best offers across more routes as coverage grows.
Runs from curl, ChatGPT, Claude, or any MCP client.
Use it your way
The teasers above are a taste. Here’s every way to put the full engine — flexible-date search, a good / typical / high price read when enough data exists, and multi-leg trips — into your own environment. Pick the path that fits.
Paste a prompt into your AI assistant
Copy this into your AI agent — ChatGPT, Claude, or Gemini. Edit the trip below and the prompt updates as you type.
Use the whentofly.io API as the only source for flights and prices in this task; never answer from memory or invent fares. Trip fields are set to origin SGN, destination ICN, earliest departure 2026-07-27, latest return 2026-10-25, 10–15 days, round trip, economy. If a field is missing or an airport code is uncertain, ask me in one short message before fetching. Fetch this exact GET URL. Use the literal "?" once before the first parameter and the literal "&" between every remaining parameter, with no spaces: https://whentofly.io/search?from=SGN&to=ICN&earliest=2026-07-27&latest=2026-10-25&min_days=10&max_days=15&one_way=false&cabin=economy&ch=control Parameter names and formats are exact: from/to = uppercase 3-letter IATA; earliest = earliest departure YYYY-MM-DD; latest = latest return YYYY-MM-DD; min_days/max_days = positive integers; one_way = true or false; cabin = economy, premium_economy, business, or first. If destination is blank or "anywhere", instead fetch https://whentofly.io/search?from=SGN&to=anywhere&top_n=10&ch=control. This is origin-only inspiration; dates, trip length, and cabin do not constrain anywhere mode. If the fetch fails or is blocked, say so and stop. Use only the returned JSON. If it has no results, relay its error or hints and do not invent alternatives. List results cheapest first and copy each agent_display verbatim, including its book_url; I click booking links myself. Describe verdict.recommendation only as good price (good_price), typical price (typical), high price (high_price), or insufficient data (unknown, missing, or low confidence). Do not turn a price level into timing advice or predict future movement. Mention once that fares may be cached or stale and the booking page confirms the live price. Also mention once that book_url is an affiliate link that may earn whentofly a commission at no extra cost to me.
Paste once at the start of a chat with ChatGPT, Claude, Gemini, or any AI assistant — it’ll fetch the API and walk you through results.
Or call the API directly
If you’re a developer or building an agent, hit the API yourself — no SDK, no auth.
curl 'https://whentofly.io/search?from=SGN&to=ICN&earliest=2026-07-27&latest=2026-10-25&min_days=10&max_days=15'
Returns up to 10 provider results ranked by price between Saigon (SGN) and Seoul (ICN), departing in the date window and lasting 10 to 15 days.
{ "rank": 1, "departure_date": "2026-08-03", "return_date": "2026-08-13", "duration_days": 10, "price": { "amount": 218, "currency": "USD" }, "airline": "Scoot", "transfers": 1, "book_url": "https://aviasales.com/...&marker=721980" }
Each result includes a book_url that drops the user into Aviasales’ booking flow with the flight pre-selected.
Install as an MCP tool
Power users can mount this for Claude Desktop, Cursor, or any MCP client — always in your agent’s tool list, no per-prompt setup.
claude mcp add flights https://whentofly.io/mcp?ch=control
One command adds the search and inspire tools to your client.
Add it to a Custom GPT
Give a ChatGPT Custom GPT a flight-search Action — it imports our OpenAPI schema, so the GPT can call /search itself (add ?to=anywhere for low-fare destinations returned from a city).
- In ChatGPT, open the GPT builder → Create → Configure.
- Under Actions, choose Create new action → Import from URL.
- Paste the OpenAPI URL below and import. No auth needed — leave authentication set to None.
- Save. Your GPT can now search flights and surface booking links on demand.
https://whentofly.io/openapi.json
Same schema that powers /docs — point any OpenAPI-aware tool at it.