Call it
curl https://api.peume.com/v1/call/build-trip \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"run_id": "your run id",
"add_item": "your add item"
}
}'const res = await fetch("https://api.peume.com/v1/call/build-trip", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"run_id": "your run id",
"add_item": "your add item"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/build-trip",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"run_id": "your run id",
"add_item": "your add item"
}
},
)
print(res.json()["output"])Answer: {"id": "run_…", "status": "completed", "cost_usd": …, "output": {…}}. Long jobs answer 202 with a run id to read later. From an AI agent, connect the MCP server and ask for this by name: build-trip.
Parameters
run_idstringOmit to create a new trip. To edit a trip, the runId of one of YOUR OWN completed /trips/save runs for it.
add_itemobjectremove_itemobjectupsert_travelersobjecthotel_room_guestsobjectOptional primary adult room-contact overrides keyed by the returned hotel item_id/product_id. Each product array is non-empty and occupancy_number values are unique positive room slots; omitted slots use persisted adult travelers in order with the trip contact email. The trip must already exist because the keys refer to its items.
