# Chatbot with fallback A terminal chatbot in one Python file. It streams answers, lets Sparrow Auto pick a model for each message, falls back to another model if a provider fails, and shows what every reply cost. ```bash pip install openai export SPARROW_API_KEY="sk-sc-v1-..." # from sparrowcodes.com/dashboard/keys python chat.py ``` ``` you > what's a good name for a sourdough starter? bot > Clint Yeastwood. [deepseek/deepseek-v4.1-flash · $0.000021 · $0.0000 so far] ``` Change the model with `MODEL=anthropic/claude-sonnet-5.5 python chat.py`, and the backups in `FALLBACKS`. **List your app.** Set `APP_URL` to your site. The `X-Title` and `HTTP-Referer` headers let you submit it to [Built with SparrowCodes](https://sparrowcodes.com/apps).