# routecheck FastAPI service providing a Yandex Routing API proxy behind an image captcha. ## Purpose Yandex Routing API free tier requires a website that uses the API. This service is that website. It also exposes an internal endpoint (`/api/route`) used by `CommuteTool` in `fast_tools.py`. ## Two access paths - **Web UI** (`/`): solve PIL arithmetic captcha → get a token → query any two lat/lon points - **Internal API**: `GET /api/route?from=lat,lon&to=lat,lon&token=$ROUTECHECK_TOKEN` — no captcha ## Key env vars - `YANDEX_ROUTING_KEY` — from developer.tech.yandex.ru, Router API, free tier - `INTERNAL_TOKEN` — equals `ROUTECHECK_TOKEN` from root `.env`; shared with deepagents - `HTTPS_PROXY` — set to `http://host.docker.internal:56928`; container has no direct external internet ## Notes - Captchas expire after 5 min, route tokens after 1 hour, both stored in-memory (restart clears them) - Yandex API expects `lon,lat` order (not `lat,lon`) — `app.py` swaps automatically - Captcha image endpoint: `GET /captcha/image/{id}` — regenerates on each call with random noise