Context
codexbar serve runs a small local HTTP server (127.0.0.1) that returns usage/cost JSON — handy for scripting — but the routes are not documented for users. From rust/src/cli/serve.rs the routes are:
GET /health
GET /usage (optional ?provider=<id>)
GET /cost (optional ?provider=<id>)
Task
Document these endpoints — in a ## serve section of docs/CLI.md (if that doc exists by then) or a short docs/SERVE.md. Include the default host/port, each route, the provider query param, and a curl example with a sample JSON shape.
Acceptance criteria
- All three routes documented, plus the
404 / bad request behavior.
- At least one runnable
curl example.
- Notes that the server is local-only (127.0.0.1) and read-only.
How to test
Docs only. To confirm routes, start the server and curl it:
cargo run --manifest-path rust/Cargo.toml -- serve
# then, in another shell:
curl http://127.0.0.1:8080/health
Pointers
Context
codexbar serveruns a small local HTTP server (127.0.0.1) that returns usage/cost JSON — handy for scripting — but the routes are not documented for users. Fromrust/src/cli/serve.rsthe routes are:GET /healthGET /usage(optional?provider=<id>)GET /cost(optional?provider=<id>)Task
Document these endpoints — in a
## servesection ofdocs/CLI.md(if that doc exists by then) or a shortdocs/SERVE.md. Include the default host/port, each route, theproviderquery param, and acurlexample with a sample JSON shape.Acceptance criteria
404/bad requestbehavior.curlexample.How to test
Docs only. To confirm routes, start the server and curl it:
Pointers
rust/src/cli/serve.rs:57(route_request).