Deliver airline-quality support with a ChatKit-powered workflow. This example pairs a scenario-specific FastAPI backend with a React UI so agents can chat with travelers while the right-hand panel surfaces live itinerary data, loyalty status, and recent service actions.
- FastAPI service that streams responses from an OpenAI Agent trained on airline tooling.
- ChatKit Web Component embedded in a React app with a context-rich side panel.
- Chat composer dictation (speech-to-text) so you can talk your prompts instead of typing.
- Tools for seat changes, trip cancellations, and itinerary updates that sync with the UI in real time.
- Python 3.11+
- Node.js 20+
- uv (recommended) or
pip - OpenAI API key exported as
OPENAI_API_KEY - ChatKit domain key exported as
VITE_SUPPORT_CHATKIT_API_DOMAIN_KEY(use any non-empty placeholder while developing locally; supply the real key in production)
- Install dependencies and start the customer support backend.
- Configure the domain key and launch the React frontend.
- Explore the support scenarios end to end.
Each step is detailed below.
The backend for this demo lives in examples/customer-support/backend and ships with its own pyproject.toml.
cd examples/customer-support/backend
uv sync
export OPENAI_API_KEY="sk-proj-..."
uv run uvicorn app.main:app --reload --port 8001The API exposes ChatKit at http://127.0.0.1:8001/support/chatkit and helper endpoints under /support/*.
cd examples/customer-support/frontend
npm install
npm run devThe dev server runs at http://127.0.0.1:5171 and proxies /support calls back to the API, which covers local iteration.
From the examples/customer-support directory you can also run npm start to launch the backend (uv sync + Uvicorn) and frontend together. Ensure uv is installed and required environment variables (for example OPENAI_API_KEY and VITE_SUPPORT_CHATKIT_API_DOMAIN_KEY) are exported before using this shortcut.
Regarding the domain public key, you can use any string during local development. However, for production deployments:
- Host the frontend on infrastructure you control behind a managed domain.
- Register that domain on the domain allowlist page and mirror it in
examples/customer-support/frontend/vite.config.tsunderserver.allowedHosts. - Set
VITE_SUPPORT_CHATKIT_API_DOMAIN_KEYto the key returned by the allowlist page and verify it surfaces inexamples/customer-support/frontend/src/lib/config.ts.
When you need to test remote-access scenarios ahead of launch, temporarily expose the app with a tunnel—e.g. ngrok http 5171 or cloudflared tunnel --url http://localhost:5171—and allowlist that hostname first.
Open the printed URL and experiment with prompts such as:
Can you move me to seat 14C on flight OA476?I need to cancel my trip and request a refund.Add one more checked bag to my reservation.
The agent invokes the appropriate tools and the timeline updates automatically in the side panel.
You can also use dictation: click the mic button in the message composer, grant microphone permission when prompted, and speak your request (the app transcribes it before sending).