> ## 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-ai-search-cancel

> Cancel a flight AI search task

Cancels a task that has not ended. A task that already ended answers `409` `CONFLICT`.


## OpenAPI

````yaml api-reference/public-api.yaml POST /v1/flight_ai_search/tasks/{task_id}:cancel
openapi: 3.0.0
info:
  title: Jinko Public API
  version: 0.111.0
  description: >-
    Curated public REST surface for Jinko. Authenticated with jnk_ API keys. See
    https://docs.gojinko.com for guides.


    ### Per-end-user attribution


    On booking calls you may send an optional `X-End-User-Id` request header to
    attribute the booking to one of your own end users (for per-end-user
    attribution and rate-limiting). The value is an **opaque, tenant-scoped**
    identifier that you choose — not a Jinko account id. Omit it to book as the
    tenant. Values prefixed `user_` or `org_` are rejected.
servers:
  - url: https://api.gojinko.com
    description: Production
  - url: https://api.sandbox.gojinko.com
    description: Sandbox
security: []
paths:
  /v1/flight_ai_search/tasks/{task_id}:cancel:
    post:
      tags:
        - Discovery
      summary: Cancel a flight AI search task
      description: >-
        Cancels a task that has not ended. A task that already ended answers
        `409` `CONFLICT`.
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 100
            example: tsk_example
          required: true
          name: task_id
          in: path
      responses:
        '200':
          description: The task, now `canceled`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlightAiSearchAnswer'
        '400':
          description: >-
            Bad request: an invalid header, such as a reserved `X-End-User-Id`
            (`user_…`, `org_…`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: BAD_REQUEST
                  message: >-
                    X-End-User-Id must be an opaque, tenant-scoped id; ids with
                    a reserved prefix, such as user_ or org_, are not allowed.
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: AUTH_REQUIRED
                  message: Invalid or expired API key.
                  doc_url: https://docs.gojinko.com/authentication/api-keys
        '403':
          description: >-
            The key is valid but is not a tenant API key (`jnk_t_…`), is not
            granted the `search_live` scope, or Travel AI search is not enabled
            for this account. **`FORBIDDEN`** — The credential is valid, and
            this request is refused anyway. Do not rotate the key — it is
            working. Check that it is entitled to this operation, and on this
            environment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: FORBIDDEN
                  message: >-
                    This API key is not granted the "search_live" scope required
                    by this endpoint
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: NOT_FOUND
                  message: Resource not found.
                  doc_url: https://docs.gojinko.com/concepts/errors
        '409':
          description: The operation conflicts with the current state of the resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: CONFLICT
                  message: >-
                    The operation conflicts with the current state of the
                    resource.
                  doc_url: https://docs.gojinko.com/concepts/errors
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: BAD_REQUEST
                  message: A required field is missing or invalid.
                  doc_url: https://docs.gojinko.com/concepts/errors
        '429':
          description: Rate limit or quota exceeded
          headers:
            Retry-After:
              description: >-
                Seconds to wait before retrying. Absent when no interval
                applies.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: RATE_LIMITED
                  message: Too many requests. Retry after the Retry-After delay.
                  doc_url: https://docs.gojinko.com/concepts/errors
        '502':
          description: The travel provider rejected the request, or an upstream call failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: UPSTREAM_REJECTED
                  message: The request was declined for this offer. Try another offer.
                  doc_url: https://docs.gojinko.com/concepts/errors
        '503':
          description: No travel provider can serve the request right now
          headers:
            Retry-After:
              description: >-
                Seconds to wait before retrying. Absent when no interval
                applies.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: UPSTREAM_UNAVAILABLE
                  message: >-
                    The service is temporarily unavailable. Retry after the
                    Retry-After delay.
                  doc_url: https://docs.gojinko.com/concepts/errors
        '504':
          description: The travel provider did not answer in time
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: UPSTREAM_TIMEOUT
                  message: >-
                    The request timed out before a result was available. Retry
                    the request.
                  doc_url: https://docs.gojinko.com/concepts/errors
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      servers:
        - url: https://api.gojinko.com
          description: Production
components:
  schemas:
    FlightAiSearchAnswer:
      type: object
      properties:
        context_id:
          type: string
          nullable: true
          description: The conversation; send it with the next message to continue.
          example: ctx_example
        task_id:
          type: string
          example: atk_example
        status:
          type: string
          enum:
            - working
            - input_required
            - completed
            - failed
            - canceled
          description: >-
            `working`: the search is still running, read the task again.
            `input_required`: the message asks a question; answer it in the same
            conversation. `completed`: the options are in the answer. `failed`:
            see `error`. `canceled`: a later message or a cancel replaced it.
        message:
          type: string
          description: The reply to show the traveller, in English.
          example: >-
            Three round-trip options Paris–Tokyo, 3–17 Oct 2027, for 4 adults
            with at most one stop.
        question:
          type: string
          enum:
            - origin
            - which_place
            - dates
            - passengers
            - group_too_large
            - contradiction
            - relax
            - out_of_scope
          description: >-
            What the reply asks for, when `status` is `input_required`. `relax`:
            no flight met every condition of the request; the reply names them
            and asks which one to drop or change.
        question_options:
          type: array
          items:
            type: object
            properties:
              value:
                type: string
                description: What to send back as `text`.
                example: SJO
              label:
                type: string
                example: San José, Costa Rica
              detail:
                type: string
                example: 1 airport
            required:
              - value
              - label
          description: Choices for the question, when it has some.
        criteria:
          type: object
          properties:
            trip_type:
              type: string
              enum:
                - oneway
                - roundtrip
                - multi_city
            origins:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                    nullable: true
                    description: >-
                      IATA city or airport code; null for a country, a region or
                      a kind of trip, whose airports searched are on each
                      option's `legs`.
                    example: PAR
                  type:
                    type: string
                    enum:
                      - city
                      - airport
                      - country
                      - region
                      - theme
                  name:
                    type: string
                    example: Paris
                  country_code:
                    type: string
                    nullable: true
                    example: FR
                required:
                  - code
                  - type
                  - name
                  - country_code
            destinations:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                    nullable: true
                    description: >-
                      IATA city or airport code; null for a country, a region or
                      a kind of trip, whose airports searched are on each
                      option's `legs`.
                    example: PAR
                  type:
                    type: string
                    enum:
                      - city
                      - airport
                      - country
                      - region
                      - theme
                  name:
                    type: string
                    example: Paris
                  country_code:
                    type: string
                    nullable: true
                    example: FR
                required:
                  - code
                  - type
                  - name
                  - country_code
            legs:
              type: array
              items:
                type: object
                properties:
                  origin:
                    type: string
                    description: IATA city or airport code.
                  destination:
                    type: string
                    description: IATA city or airport code.
                  departure:
                    type: string
                    nullable: true
                    pattern: ^\d{4}-\d{2}-\d{2}$
                    example: '2027-10-03'
                required:
                  - origin
                  - destination
                  - departure
              description: Each flight of a multi-city trip, in order.
            departure:
              type: object
              properties:
                date:
                  type: string
                  pattern: ^\d{4}-\d{2}-\d{2}$
                  description: One day.
                  example: '2027-10-03'
                window:
                  type: object
                  properties:
                    start:
                      type: string
                      pattern: ^\d{4}-\d{2}-\d{2}$
                      example: '2027-10-03'
                    end:
                      type: string
                      pattern: ^\d{4}-\d{2}-\d{2}$
                      example: '2027-10-03'
                  required:
                    - start
                    - end
                  description: >-
                    Any day from `start` to `end`, when the request gives no
                    day.
                flexibility_days:
                  type: integer
                  minimum: 0
                  description: >-
                    Days either side the request accepts ("flexible", "± 2
                    days").
                  example: 3
                weekdays:
                  type: array
                  items:
                    type: string
                    enum:
                      - monday
                      - tuesday
                      - wednesday
                      - thursday
                      - friday
                      - saturday
                      - sunday
                  description: >-
                    The days of the week the trips leave on, when the request
                    fixes them: `thursday` and `friday` for a long weekend,
                    `friday` for a weekend.
            return:
              type: object
              properties:
                date:
                  type: string
                  pattern: ^\d{4}-\d{2}-\d{2}$
                  description: One day.
                  example: '2027-10-03'
                window:
                  type: object
                  properties:
                    start:
                      type: string
                      pattern: ^\d{4}-\d{2}-\d{2}$
                      example: '2027-10-03'
                    end:
                      type: string
                      pattern: ^\d{4}-\d{2}-\d{2}$
                      example: '2027-10-03'
                  required:
                    - start
                    - end
                  description: >-
                    Any day from `start` to `end`, when the request gives no
                    day.
                flexibility_days:
                  type: integer
                  minimum: 0
                  description: >-
                    Days either side the request accepts ("flexible", "± 2
                    days").
                  example: 3
                weekdays:
                  type: array
                  items:
                    type: string
                    enum:
                      - monday
                      - tuesday
                      - wednesday
                      - thursday
                      - friday
                      - saturday
                      - sunday
                  description: >-
                    The days of the week the trips leave on, when the request
                    fixes them: `thursday` and `friday` for a long weekend,
                    `friday` for a weekend.
            stay_days:
              anyOf:
                - type: integer
                - type: object
                  properties:
                    min:
                      type: integer
                    max:
                      type: integer
                  required:
                    - min
                    - max
              description: How long the trip lasts, when the request gives no return day.
            passengers:
              type: object
              properties:
                adults:
                  type: integer
                  minimum: 0
                  example: 4
                children:
                  type: integer
                  minimum: 0
                  example: 0
                infants:
                  type: integer
                  minimum: 0
                  example: 0
              required:
                - adults
                - children
                - infants
            cabin_class:
              type: string
              enum:
                - economy
                - premium_economy
                - business
                - first
            max_stops:
              type: integer
              minimum: 0
            include_carriers:
              type: array
              items:
                type: string
              description: IATA airline codes.
            exclude_carriers:
              type: array
              items:
                type: string
              description: IATA airline codes.
            checked_bag_included:
              type: boolean
            refundable_only:
              type: boolean
            changeable_only:
              type: boolean
            departure_time_range:
              type: object
              properties:
                earliest:
                  type: string
                  nullable: true
                  description: HH:MM, local time.
                  example: '18:00'
                latest:
                  type: string
                  nullable: true
                  description: HH:MM, local time.
                  example: null
              required:
                - earliest
                - latest
            arrival_time_range:
              type: object
              properties:
                earliest:
                  type: string
                  nullable: true
                  description: HH:MM, local time.
                  example: '18:00'
                latest:
                  type: string
                  nullable: true
                  description: HH:MM, local time.
                  example: null
              required:
                - earliest
                - latest
            return_departure_time_range:
              type: object
              properties:
                earliest:
                  type: string
                  nullable: true
                  description: HH:MM, local time.
                  example: '18:00'
                latest:
                  type: string
                  nullable: true
                  description: HH:MM, local time.
                  example: null
              required:
                - earliest
                - latest
            return_arrival_time_range:
              type: object
              properties:
                earliest:
                  type: string
                  nullable: true
                  description: HH:MM, local time.
                  example: '18:00'
                latest:
                  type: string
                  nullable: true
                  description: HH:MM, local time.
                  example: null
              required:
                - earliest
                - latest
            connection_time_max_minutes:
              type: integer
            max_total_duration_minutes:
              type: integer
            via_airports:
              type: array
              items:
                type: string
            exclude_via_airports:
              type: array
              items:
                type: string
            budget:
              type: object
              properties:
                amount:
                  type: number
                currency:
                  type: string
                scope:
                  type: string
                  enum:
                    - total
                    - per_person
              required:
                - amount
                - currency
                - scope
            priority:
              type: string
              enum:
                - price
                - duration
                - connections
                - schedule
                - balanced
              description: Only when the request says how to rank the options.
            currency:
              type: string
              example: USD
            intent:
              type: object
              properties:
                user_intent:
                  type: string
              required:
                - user_intent
              description: The request as understood, in English.
          required:
            - trip_type
            - origins
            - passengers
            - currency
          description: >-
            The search the request was understood as: `trip_type`, `origins`,
            `destinations`, `departure`, `return`, `passengers`, `priority`
            (only when the request says how to rank the options), `currency`,
            and the filters, in the `flight_search` field names. Each place of
            `origins` and `destinations` has `code`, `type`, `name` and
            `country_code`; `code` is null for a country, a region or a kind of
            trip, whose airports searched are on each option's `legs`.
            `departure` has `weekdays` when the request fixes the days of the
            week the trips leave on: `thursday` and `friday` for a long weekend,
            `friday` for a weekend. A field is absent when the request did not
            state it, except `passengers` and `currency`, which carry the values
            searched with.
        notes:
          type: array
          items:
            type: object
            properties:
              kind:
                type: string
                example: passengers_assumed_adults
            required:
              - kind
          description: >-
            Assumptions and adjustments made while understanding the request and
            searching, each with a `kind` and the fields of that kind, and an
            optional `text`.
        options:
          type: array
          items:
            $ref: '#/components/schemas/FlightAiSearchOption'
          description: Every itinerary of the answer, each priced live.
        groups:
          type: array
          items:
            $ref: '#/components/schemas/FlightAiSearchGroup'
        has_more:
          type: boolean
          description: More options are available; ask for more in the same conversation.
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
          description: Why the task failed, when `status` is `failed`.
        superseded_by:
          type: string
          description: The task that replaced this one, when `status` is `canceled`.
        charge:
          $ref: '#/components/schemas/FlightAiSearchCharge'
      required:
        - context_id
        - task_id
        - status
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - INVALID_SEGMENTS_TO_EXCHANGE
                - PARTIAL_EXCHANGE_UNSUPPORTED
                - LEG_ALREADY_DEPARTED
                - DEPARTURE_DATE_IN_PAST
                - LEG_DATES_OUT_OF_ORDER
                - INVALID_EXCHANGE_REQUEST
                - NOT_EXCHANGEABLE
                - CREDENTIAL_FORMAT_INVALID
                - PAYMENT_TYPE_NOT_ENABLED
                - PAYMENT_CREDENTIAL_INVALID
                - TRIP_OWNED_BY_OTHER_PAYMENT
                - IDEMPOTENCY_KEY_REUSED
                - ATTEMPT_IN_PROGRESS
                - ATTEMPT_TERMINAL
                - TEMPORARILY_UNAVAILABLE
                - AUTH_REQUIRED
                - PAYMENT_REQUIRED
                - RATE_LIMITED
                - BAD_REQUEST
                - FORBIDDEN
                - NOT_FOUND
                - CONFLICT
                - GONE
                - QUOTE_PENDING
                - QUOTE_EXPIRED
                - TRIP_EXPIRED
                - TRIP_STATE_CONFLICT
                - OFFER_EXPIRED
                - OFFER_UNAVAILABLE
                - MISSING_CUSTOMER_DETAILS
                - INVALID_PHONE_NUMBER
                - INVALID_FLIGHT_NUMBER
                - CURRENCY_UNSUPPORTED
                - HOTEL_NAME_LOW_CONFIDENCE
                - DESTINATION_LOW_CONFIDENCE
                - UPSTREAM_REJECTED
                - UPSTREAM_UNAVAILABLE
                - UPSTREAM_TIMEOUT
                - UPSTREAM_ERROR
                - INTERNAL
              description: >-
                What went wrong, as a stable machine-readable code. This is a
                closed set — branch on it rather than on `message`, which is
                prose and may change. New codes arrive in a minor version, so
                treat an unknown one as its HTTP status. A code can also stop
                being emitted: it leaves this set in a minor version, named in
                the changelog, and a branch you wrote for it goes unreached
                rather than wrong.
              example: BAD_REQUEST
            message:
              type: string
              description: >-
                What went wrong, in prose. These codes always carry the same
                message, and it never includes text from a supplier:
                `RATE_LIMITED` — "Too many requests. Retry after the Retry-After
                delay."; `OFFER_EXPIRED` — "This offer has expired. Search
                again."; `OFFER_UNAVAILABLE` — "This offer is no longer
                available. Search again."; `UPSTREAM_REJECTED` — "The request
                was declined for this offer. Try another offer.";
                `UPSTREAM_UNAVAILABLE` — "The service is temporarily
                unavailable. Retry after the Retry-After delay.";
                `UPSTREAM_TIMEOUT` — "The request timed out before a result was
                available. Retry the request."; `UPSTREAM_ERROR` — "The request
                could not be completed.".
            doc_url:
              type: string
            field:
              type: string
              description: >-
                On a 400 `BAD_REQUEST` that names one refused input: the path of
                that field in your request, e.g. `selections[1].quantity` for
                the second selection of a `select_ancillaries` call. Absent when
                the refusal names no single field.
              example: selections[1].quantity
          required:
            - code
            - message
      required:
        - error
    FlightAiSearchOption:
      type: object
      properties:
        option_id:
          type: string
          description: >-
            Identifies the option within the answer; `groups` name options by
            it.
          example: s1_1
        trip_type:
          type: string
          enum:
            - oneway
            - roundtrip
            - multi_city
        legs:
          type: array
          items:
            $ref: '#/components/schemas/FlightAiSearchLeg'
          description: 1 for one way, 2 for a round trip, 2 to 4 for a multi-city trip.
        fares:
          type: array
          items:
            $ref: '#/components/schemas/FlightAiSearchFare'
          description: The bookable fares.
        score:
          type: integer
          minimum: 0
          maximum: 100
          description: >-
            How well the option fits the request, 0–100, relative to this
            answer.
          example: 100
        why:
          type: string
          description: One sentence on why the option is shown.
          example: Cheapest total for 4; one stop each way in Amsterdam.
      required:
        - option_id
        - trip_type
        - legs
      description: One itinerary of an answer and its prices.
    FlightAiSearchGroup:
      oneOf:
        - type: object
          properties:
            kind:
              type: string
              enum:
                - shortlist
            group_id:
              type: string
              example: g_1
            title:
              type: string
            route:
              type: object
              nullable: true
              properties:
                origin:
                  type: string
                  example: PAR
                destination:
                  type: string
                  example: TYO
              required:
                - origin
                - destination
              description: Null for a multi-city trip.
            dates:
              type: object
              nullable: true
              properties:
                departure:
                  type: string
                  pattern: ^\d{4}-\d{2}-\d{2}$
                  example: '2027-10-03'
                return:
                  type: string
                  pattern: ^\d{4}-\d{2}-\d{2}$
                  example: '2027-10-03'
              required:
                - departure
              description: Null when the options differ in dates.
            option_ids:
              type: array
              items:
                type: string
              description: The options, best first.
          required:
            - kind
            - group_id
            - title
            - route
            - dates
            - option_ids
        - type: object
          properties:
            kind:
              type: string
              enum:
                - per_destination
            group_id:
              type: string
              example: g_1
            title:
              type: string
            origin:
              $ref: '#/components/schemas/FlightAiSearchPlace'
            rows:
              type: array
              items:
                type: object
                properties:
                  destination:
                    $ref: '#/components/schemas/FlightAiSearchPlace'
                  dates:
                    type: object
                    nullable: true
                    properties:
                      departure:
                        type: string
                        pattern: ^\d{4}-\d{2}-\d{2}$
                        example: '2027-10-03'
                      return:
                        type: string
                        pattern: ^\d{4}-\d{2}-\d{2}$
                        example: '2027-10-03'
                    required:
                      - departure
                  option_id:
                    type: string
                    nullable: true
                    description: >-
                      The best live option for this destination; null when there
                      is none.
                  live_cheapest_total:
                    allOf:
                      - $ref: '#/components/schemas/FlightAiSearchMoney'
                      - nullable: true
                  empty_reason:
                    type: string
                    enum:
                      - no_fare_within_filters
                      - not_searched
                    description: Why `option_id` is null.
                  summary:
                    type: string
                required:
                  - destination
                  - dates
                  - option_id
                  - live_cheapest_total
                  - summary
          required:
            - kind
            - group_id
            - title
            - origin
            - rows
      description: >-
        How to present the options; groups name them by `option_id`.
        `shortlist`: the options for one route and dates. `per_destination`: one
        row per destination compared. Options always meet every filter of the
        request; a row without one says why in `empty_reason`.
    FlightAiSearchCharge:
      type: object
      properties:
        turn:
          type: integer
          description: >-
            The message of the conversation this charge is for, from 1: the
            first message is 1 and each next message adds 1, whether it answers
            a question or asks for something new.
          example: 1
        llm_usd:
          type: number
          description: The language-model part of the charge, in USD.
          example: 0.0195
        api_usd:
          type: number
          description: The flight search part of the charge, in USD.
          example: 0.01
        total_usd:
          type: number
          description: '`llm_usd` + `api_usd`.'
          example: 0.0295
        currency:
          type: string
          enum:
            - USD
      required:
        - turn
        - llm_usd
        - api_usd
        - total_usd
        - currency
      description: >-
        What a turn was charged to the organization's balance, once the turn has
        ended (`completed`, `input_required`, `failed` or `canceled`); every
        amount is 0 when the turn cost nothing. Absent while the task is
        `working`. Carried on JSON answers only: an event stream does not carry
        it, so read it with `GET /v1/flight_ai_search/tasks/{task_id}`.
    FlightAiSearchLeg:
      type: object
      properties:
        index:
          type: integer
          minimum: 1
          description: The leg number, from 1.
          example: 1
        origin:
          type: object
          properties:
            code:
              type: string
              description: IATA city or airport code.
              example: PAR
            name:
              type: string
              example: Paris
            airport:
              type: string
              description: IATA airport code.
              example: CDG
          required:
            - code
            - name
        destination:
          type: object
          properties:
            code:
              type: string
              description: IATA city or airport code.
              example: PAR
            name:
              type: string
              example: Paris
            airport:
              type: string
              description: IATA airport code.
              example: CDG
          required:
            - code
            - name
        departure:
          type: string
          pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$
          description: Local time at the origin.
          example: '2027-10-03T10:20:00'
        arrival:
          type: string
          pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$
          description: Local time at the destination.
          example: '2027-10-03T10:20:00'
        duration_minutes:
          type: integer
          example: 975
        stops:
          type: integer
          minimum: 0
          example: 1
        segments:
          type: array
          items:
            $ref: '#/components/schemas/FlightAiSearchSegment'
          description: The flights of the leg.
      required:
        - index
        - origin
        - destination
        - departure
      description: >-
        One direction of an itinerary: outbound, return, or one leg of a
        multi-city trip.
    FlightAiSearchFare:
      type: object
      properties:
        trip_item_token:
          type: string
          description: >-
            Add this fare to a trip with `POST /v1/trip` `add_item`, before
            `expires_at`. After that the token is refused; use the token of a
            newer answer. "Show me more" in the same conversation searches
            expired options again.
          example: offer_7f3a9c21_1b2c3d4e:trip_item_0
        brand_name:
          type: string
          example: Economy Light
        cabin_class:
          type: string
          example: economy
        total:
          allOf:
            - $ref: '#/components/schemas/FlightAiSearchMoney'
            - description: The price for every traveller.
        price_per_person:
          allOf:
            - $ref: '#/components/schemas/FlightAiSearchMoney'
            - description: The price for one traveller.
        priced_for:
          type: object
          properties:
            adults:
              type: integer
              minimum: 0
              example: 4
            children:
              type: integer
              minimum: 0
              example: 0
            infants:
              type: integer
              minimum: 0
              example: 0
          required:
            - adults
            - children
            - infants
          description: The travellers `total` is for.
        expires_at:
          type: string
          format: date-time
          description: >-
            Until when `trip_item_token` can be added to a trip (UTC): at most
            75 minutes after the search, earlier when the fare's own deadline
            is.
          example: '2026-10-27T10:58:12Z'
        refundable:
          type: boolean
        changeable:
          type: boolean
        checked_bag_included:
          type: boolean
        carry_on_baggage:
          type: string
          example: 1 × 12 kg
        included_baggage:
          type: string
          description: The checked baggage included.
          example: 1 × 23 kg
      required:
        - trip_item_token
        - brand_name
        - cabin_class
        - total
        - price_per_person
        - priced_for
        - expires_at
        - refundable
        - changeable
        - checked_bag_included
      description: >-
        A bookable fare of a live option, priced live for the travellers of the
        request.
    FlightAiSearchPlace:
      type: object
      properties:
        code:
          type: string
          description: >-
            IATA city, airport or country code. For a region or a kind of trip,
            the first airport searched for it.
          example: PAR
        type:
          type: string
          enum:
            - city
            - airport
            - country
            - region
            - theme
          description: >-
            region: an area of several countries or a part of one ("the
            Caribbean", "Puglia"). theme: a kind of trip named instead of a
            place ("skiing at Christmas"), searched at the destinations that fit
            it; `name` says which ("ski destinations").
        name:
          type: string
          example: Paris
        country_code:
          type: string
          nullable: true
          description: >-
            ISO 3166-1 alpha-2; null for a place in more than one country (a
            region such as the Caribbean, a kind of trip).
          example: FR
        alternates:
          type: array
          items:
            type: string
          description: Other airports searched for this place.
      required:
        - code
        - type
        - name
        - country_code
      description: A place the request was understood to name.
    FlightAiSearchMoney:
      type: object
      properties:
        amount:
          type: number
          description: >-
            The amount in major units of `currency` (e.g. 3412.5 for EUR
            3,412.50).
          example: 3412
        currency:
          type: string
          pattern: ^[A-Z]{3}$
          description: ISO 4217 currency code.
          example: EUR
      required:
        - amount
        - currency
      description: An amount of money and its currency.
    FlightAiSearchSegment:
      type: object
      properties:
        marketing_carrier:
          type: string
          description: IATA code of the marketing airline.
          example: AF
        operating_carrier:
          type: string
          description: IATA code of the operating airline, when it differs.
          example: KL
        flight_number:
          type: string
          example: AF1240
        origin:
          type: string
          description: IATA airport code.
          example: CDG
        destination:
          type: string
          description: IATA airport code.
          example: AMS
        departure:
          type: string
          pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$
          description: Local time at `origin`.
          example: '2027-10-03T10:20:00'
        arrival:
          type: string
          pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$
          description: Local time at `destination`.
          example: '2027-10-03T10:20:00'
        duration_minutes:
          type: integer
          example: 80
        layover_minutes:
          type: integer
          description: The connection time before the next segment; absent on the last one.
          example: 140
      required:
        - marketing_carrier
        - flight_number
        - origin
        - destination
        - departure
        - arrival
        - duration_minutes
      description: One flight of a leg.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
    BearerAuth:
      type: http
      scheme: bearer

````

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