run.py shows how to use jsontap with an OpenRouter streaming response.
It demonstrates progressive JSON consumption:
- route as soon as
categoryresolves - set urgency as soon as
urgencyresolves - stream
action_stepsas each item arrives - wait for
full_responseonly at the end
- Python 3.12+
OPENROUTER_API_KEYset in your shell
Install dependencies from the project root:
git clone https://github.com/fhalde/jsontap.git
cd jsontap
uv sync --group exampleFrom the project root:
export OPENROUTER_API_KEY="<token>"
uv run python examples/run.py- The model is configured directly in
examples/run.py. response_formatis set tojson_schema, so use a model/provider route that supports it.- Output quality is only as good as the model you choose.