Skip to content

Document the local codexbar serve HTTP endpoints #83

Description

@tsouth89

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationgood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions