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

# Flight Search

> Get live flight pricing: search by route, or re-price a known offer

Fetch live, bookable pricing for a specific route and date pair. Use it once the user has settled on exact travel dates, for example "Paris to New York departing June 1 returning June 8 in economy". It also reprices an offer surfaced earlier by the calendar or destination tools so you can confirm availability before adding it to a trip.

<Accordion title="Tool description (what the LLM sees)" defaultOpen={false}>
  ```text theme={null}
  Get live flight pricing and fare options. Provide exactly one of the "search" or "price_check" nested objects:

  1. search: Live flight search by route and dates.
     Example: { "search": { "origin": "PAR", "destination": "NYC", "departure_date": "2025-06-01" } }
     Required fields: origin, destination, departure_date. Optional: return_date, cabin_class, direct_only, origin_type, destination_type.

  2. price_check: Get live pricing for a specific flight deal from discovery tools (flight_calendar, find_destination, flight_calendar).
     Example: { "price_check": { "offer_token": "token_from_discovery" } }

  IMPORTANT: "search" and "price_check" are nested objects, not string values. Do NOT pass them as strings.

  RESPONSE:
  - Each flight includes detailed segments, fare options with baggage/refund/change rules, and a trip_item_token per fare.
  - price_check may return status "flight_unavailable" with alternatives if the flight is no longer available. Ask the user to choose.

  NEXT STEP: Use the trip tool with add_item and the trip_item_token from the fare the user selects.

  Flow: discovery (flight_calendar / find_destination / flight_calendar) or direct search → flight_search → trip → checkout
  ```
</Accordion>

## Parameters

| Name                      | Type                                                             | Required | Description                                                                                                                                                  |
| ------------------------- | ---------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `search`                  | `object`                                                         | No       | Live flight search by route and dates. Use city codes by default (PAR, NYC); use airport codes (CDG, JFK) only when the user specifies a particular airport. |
| `search.origin`           | `string`                                                         | Yes      | Origin IATA city code (e.g. PAR, NYC, LON) or airport code (e.g. CDG, JFK, LHR). City codes preferred: they search all airports in the city.                 |
| `search.origin_type`      | `enum ("city" \| "airport")`                                     | No       | Whether origin is a city code or airport code. Defaults to "city".                                                                                           |
| `search.destination`      | `unknown`                                                        | Yes      | Destination IATA city code (e.g. MIL, BCN, TYO) or airport code (e.g. MXP, BCN, NRT). City codes preferred.                                                  |
| `search.destination_type` | `enum ("city" \| "airport")`                                     | No       | Whether destination is a city code or airport code. Defaults to "city".                                                                                      |
| `search.departure_date`   | `string`                                                         | Yes      | Departure date (YYYY-MM-DD)                                                                                                                                  |
| `search.return_date`      | `string`                                                         | No       | Return date (YYYY-MM-DD) for round-trip.                                                                                                                     |
| `search.cabin_class`      | `enum ("economy" \| "premium_economy" \| "business" \| "first")` | No       | Cabin class filter.                                                                                                                                          |
| `search.direct_only`      | `boolean`                                                        | No       | Only return nonstop flights.                                                                                                                                 |
| `search.limit`            | `integer`                                                        | No       | Max results to return (1-100). Default 20. Caps how many flights come back; only trims the set, since providers bound the real count.                        |
| `price_check`             | `object`                                                         | No       | Get live pricing for a specific flight deal. Returns confirmed fares with trip\_item\_token for booking.                                                     |
| `price_check.offer_token` | `string`                                                         | Yes      | offer\_token from flight\_calendar, find\_destination, or flight\_calendar results.                                                                          |
| `passengers`              | `object`                                                         | No       | Passenger counts. Defaults to 1 adult.                                                                                                                       |
| `passengers.adults`       | `integer`                                                        | No       | Adult travelers (12+)                                                                                                                                        |
| `passengers.children`     | `integer`                                                        | No       | Child travelers (2-11)                                                                                                                                       |
| `passengers.infants`      | `integer`                                                        | No       | Infant travelers (under 2)                                                                                                                                   |
| `currency`                | `string`                                                         | No       | ISO 4217 currency code. Defaults to "USD".                                                                                                                   |
| `locale`                  | `string`                                                         | No       | BCP 47 locale. Defaults to "en-US".                                                                                                                          |

## Examples

**Price-check a specific offer from discovery:**

```json theme={null}
{
  "name": "flight_search",
  "arguments": {
    "price_check": {
      "offer_token": "offer_ABc123xYz..."
    }
  }
}
```

**Live search by route (no prior discovery):**

```json theme={null}
{
  "name": "flight_search",
  "arguments": {
    "search": {
      "origin": "PAR",
      "destination": "NYC",
      "departure_date": "2026-06-15",
      "return_date": "2026-06-22",
      "direct_only": false,
      "cabin_class": "economy"
    }
  }
}
```

**Live search with passenger mix + max price filter:**

```json theme={null}
{
  "name": "flight_search",
  "arguments": {
    "search": {
      "origin": "CDG",
      "destination": "JFK",
      "departure_date": "2026-07-01",
      "passengers": { "adults": 2, "children": 1 },
      "max_price": 1200,
      "direct_only": true
    }
  }
}
```

The response has detailed segment info per itinerary and multiple fare options per itinerary (economy / premium / business), each with a `trip_item_token` you pass to `trip(add_item)`.

<Note>
  If `price_check` returns `status: "flight_unavailable"`, the offer sold out, use the `alternatives[]` in the response or loop back to discovery.
</Note>
