Search flights from one sentence, with follow-ups
Send the traveller's request in one sentence. The answer comes within about 20 seconds with 200: the options, or a question to answer in the same conversation. When the search takes longer, the answer is 202 with the early reply and a Location to read until the task ends. Continue the conversation with its context_id.
Every option is priced live and carries fares: book one by adding its trip_item_token with POST /v1/trip add_item before its expires_at. The JSON answer of an ended turn carries its charge; the event stream does not.
Request
- Base URLhttps://api.gojinko.com
- URLhttps://api.gojinko.com/v1/flight_ai_search
- Auth
- API key in header X-API-Key
- or HTTP bearer
Headers
Makes a retried message safe: a retry with the same key answers the first message again instead of sending a second one. Keys are scoped to the caller, not to the conversation, and the retried body is not compared: a different message needs a new key. 1–200 characters.
wait=N (RFC 7240): answer after at most N seconds, never more than 20, with 202 and the early reply if the task has not ended by then. wait=0 answers at once. Without it the wait is 20 seconds. The wait applied is returned in Preference-Applied.
Request body
Example request
{
"text": "Paris to Tokyo 3–17 October 2027 for 4, at most one stop",
"context_id": "ctx_example",
"task_id": "atk_example",
"currency": "EUR",
"timezone": "Europe/Paris"
}Response
The task ended this turn; or, with Accept: text/event-stream, the turn as it happens.
Example response
{
"context_id": "ctx_example",
"task_id": "atk_example",
"message": "Three round-trip options Paris–Tokyo, 3–17 Oct 2027, for 4 adults with at most one stop.",
"question_options": [
{
"value": "SJO",
"label": "San José, Costa Rica",
"detail": "1 airport"
}
],
"notes": [
{
"kind": "passengers_assumed_adults"
}
],
"options": [
{
"option_id": "s1_1",
"legs": [
{
"index": 1,
"origin": {
"code": "PAR",
"name": "Paris",
"airport": "CDG"
},
"destination": {
"code": "PAR",
"name": "Paris",
"airport": "CDG"
},
"departure": "2027-10-03T10:20:00",
"arrival": "2027-10-03T10:20:00",
"duration_minutes": 975,
"stops": 1,
"segments": [
{
"marketing_carrier": "AF",
"operating_carrier": "KL",
"flight_number": "AF1240",
"origin": "CDG",
"destination": "AMS",
"departure": "2027-10-03T10:20:00",
"arrival": "2027-10-03T10:20:00",
"duration_minutes": 80,
"layover_minutes": 140
}
]
}
],
"fares": [
{
"trip_item_token": "offer_7f3a9c21_1b2c3d4e:trip_item_0",
"brand_name": "Economy Light",
"cabin_class": "economy",
"total": {
"amount": 3412,
"currency": "EUR"
},
"price_per_person": {
"amount": 3412,
"currency": "EUR"
},
"priced_for": {
"adults": 4
},
"expires_at": "2026-10-27T10:58:12Z",
"carry_on_baggage": "1 × 12 kg",
"included_baggage": "1 × 23 kg"
}
],
"score": 100,
"why": "Cheapest total for 4; one stop each way in Amsterdam."
}
],
"groups": [
{
"group_id": "g_1",
"route": {
"origin": "PAR",
"destination": "TYO"
},
"dates": {
"departure": "2027-10-03",
"return": "2027-10-03"
}
}
],
"charge": {
"turn": 1,
"llm_usd": 0.0195,
"api_usd": 0.01,
"total_usd": 0.0295
}
}Changes
No recorded changes to this operation across all 1 revision of this API.