Shroominic and Claude Opus 4.8
e972b62758
fix(payment): refund truly-empty responses with a non-zero USD cost
...
When an upstream reports a non-zero USD cost but the response carries no
tokens at all (input, output, cache-read and cache-creation all zero), the
USD path billed the full USD-derived amount for an empty response. Return an
all-zero cost (full refund) for that case only.
The gate is tightened relative to the superseded PR #489 : a cache-read- or
cache-creation-only turn legitimately reports zero prompt/completion tokens
with a real cost and must still be billed, so the refund only fires when every
token bucket is zero.
Adds unit tests covering both the refund and the still-billed cache-only path.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-20 13:10:24 +08:00
shroominic and GitHub
f9bfd4f0d2
routstr/v0.3.0
...
v0.3.0
2026-02-02 16:44:31 +08:00
shroominic and GitHub
42efa3c1ba
Merge pull request #337 from Routstr/no-default-next-public-api-url
...
No default next public api url
2026-01-31 07:42:14 +08:00
shroominic and GitHub
74b1d39d5c
Merge pull request #332 from Routstr/missing-delete-button
...
Missing delete button
2026-01-31 07:42:04 +08:00
shroominic and GitHub
4df4976f44
Merge pull request #331 from Routstr/batch-override-models
...
batch override models
2026-01-31 07:41:54 +08:00
shroominic and GitHub
1b3b206a20
Merge pull request #336 from Routstr/prevent-payout-race-contition
...
prevent payout race condition
2026-01-30 10:49:44 +08:00
shroominic and GitHub
b9b477e5eb
Merge pull request #335 from Routstr/fix-recurring-payout-error
...
Fix recurring payout error
2026-01-30 10:06:37 +08:00
shroominic and GitHub
855d60b4a5
Merge pull request #330 from Routstr/fix-provider-model-pricing
...
fix provider model pricing
2026-01-29 10:58:27 +08:00
shroominic and GitHub
27ace348b5
Merge pull request #329 from Routstr/fix-multiple-custom-models
...
fix: unable to add multiple custom models
2026-01-29 10:58:14 +08:00
shroominic and GitHub
bf91f401af
Merge pull request #322 from Routstr/tiny-docs-fixes
...
tiny docs fixes
2026-01-24 21:17:57 +08:00
shroominic and GitHub
8fff716bb2
Merge pull request #321 from Routstr/fix-readme
...
fix readme
2026-01-24 18:14:45 +08:00
shroominic and GitHub
f8fdcf3bf3
Merge pull request #320 from Routstr/improved-docs
...
Improved docs
2026-01-24 18:10:41 +08:00
shroominic and GitHub
9dfa58d69f
Merge pull request #319 from Routstr/opencode-integ
...
Opencode integ
2026-01-24 14:40:56 +08:00
shroominic and GitHub
7e299180fe
Merge pull request #296 from Routstr/provider-fallback
...
Multi-Provider Fallback on UpstreamError
2026-01-23 09:50:04 +08:00
shroominic and GitHub
4ac96ade5f
Merge branch 'v0.3.0' into provider-fallback
2026-01-23 09:45:14 +08:00
shroominic and GitHub
85aa8fbbc5
Merge pull request #315 from Routstr/314-fix-timeout-error
...
make sure to refund
2026-01-23 09:42:59 +08:00
shroominic and GitHub
180a469399
Merge pull request #304 from Routstr/introduce-child-key
...
Introduce child key
2026-01-23 09:35:53 +08:00
shroominic and 9qeklajc
87fbb48ca8
routstr v0.2.2 - fixfix
...
v0.2.2 - release summary
--------------------------
#292 - Fix not enough inputs to melt
#295 - Update UI dependencies
#291 - Fix reserved balance
#289 - Better filtering options (#282 )
#284 - Do not charge for empty content (#274 )
#298 - Fix Provider Balance display in dashboard
#299 - fix refunds not accounting reserved balance
#300 - reset reserved balance on startup (optional)
#303 - ignore disabled provider
#301 - optimize price fetching
2026-01-22 13:03:36 +01:00
shroominic and GitHub
3465a44d0e
routstr v0.2.2 - fixfix
...
v0.2.2 - release summary
--------------------------
#292 - Fix not enough inputs to melt
#295 - Update UI dependencies
#291 - Fix reserved balance
#289 - Better filtering options (#282 )
#284 - Do not charge for empty content (#274 )
#298 - Fix Provider Balance display in dashboard
#299 - fix refunds not accounting reserved balance
#300 - reset reserved balance on startup (optional)
#303 - ignore disabled provider
#301 - optimize price fetching
2026-01-15 11:21:22 +08:00
shroominic and GitHub
a4259af38f
Merge pull request #301 from Routstr/optimize-price-fetching
...
optimize price fetching
2026-01-15 11:13:14 +08:00
shroominic and GitHub
0d07dd0cdb
Merge pull request #303 from Routstr/ignore-disabled-provider
...
ignore disabled provider
2026-01-15 11:12:16 +08:00
shroominic and GitHub
367265b9fe
Merge pull request #300 from Routstr/reset-reserved-balance-on-startup
...
Reset reserved balance on startup
2026-01-10 08:50:32 +08:00
shroominic and GitHub
0b3ccb5fb0
Merge pull request #299 from Routstr/urgent-reserved-balance-fix
...
Reserved balance fix
2026-01-10 08:50:20 +08:00
shroominic and GitHub
dbd43f52fb
Merge pull request #298 from Routstr/fix-provider-balance
...
Fix provider balance
2026-01-10 08:49:23 +08:00
shroominic and GitHub
5e21f6ccbc
Merge pull request #292 from Routstr/fix-not-enough-inputs-to-melt
...
Fix not enough inputs to melt
2026-01-06 19:24:33 +01:00
shroominic and GitHub
1e2d130022
Merge pull request #285 from Routstr/admin-info
...
Add admin password warning
2026-01-06 19:14:53 +01:00
shroominic and GitHub
b7603dcf69
Merge pull request #295 from Routstr/update-ui-deps
...
update vuln deps
2026-01-06 17:38:13 +01:00
shroominic and GitHub
f1fa7d094f
routstr/v0.2.1
...
v0.2.1
2025-12-27 22:08:51 +01:00
shroominic and GitHub
eed5bc5b04
Merge pull request #278 from Routstr/openai-responses-api
...
OpenAI responses api
2025-12-27 22:02:51 +01:00
shroominic and GitHub
634a473f50
Merge pull request #276 from Routstr/force-sats-pricing
...
Force sats pricing
2025-12-26 12:36:02 +01:00
shroominic and GitHub
9594e9fb52
Merge pull request #251 from Routstr/embeddings-integration
...
Embeddings integration
2025-12-23 20:53:26 +01:00
shroominic and GitHub
d203370f01
Merge pull request #265 from Routstr/update-cost-calculation
...
use cost field if available
2025-12-22 10:20:35 +01:00
shroominic and GitHub
8edc3512c1
Merge pull request #258 from Routstr/remove-flaky-wallet-tests
...
Remove flaky wallet tests
2025-12-19 10:54:26 +01:00
shroominic and GitHub
c11cc107c8
Merge pull request #248 from Routstr/feature/dynamic-settings
...
feat(ui): make admin settings dynamic based on backend response
2025-12-11 14:04:49 +08:00
shroominic and GitHub
19b5f2889a
Merge pull request #249 from Routstr/refactor-remove-unused-functions
...
refactor: rm unused functions
2025-12-11 13:30:59 +08:00
shroominic and GitHub
72b281b815
Merge branch 'v0.2.1' into refactor-remove-unused-functions
2025-12-11 13:24:59 +08:00
shroominic and GitHub
87b1443c23
Merge pull request #253 from Routstr/lightning
...
create and topup token with lightning
2025-12-11 12:58:36 +08:00
shroominic and GitHub
e4eda59e6a
Merge pull request #256 from Routstr/improve-console-logging
...
Improve console logging
2025-12-11 10:54:05 +08:00
shroominic and GitHub
7f918eab6a
Merge pull request #252 from Routstr/model-fetch-issue
...
open router free model breaks openrouter model fetching
2025-12-11 10:52:28 +08:00
shroominic and GitHub
2aee75e7d5
Merge pull request #255 from Routstr/rm-shaky
...
Rm shaky test
2025-12-11 10:12:33 +08:00
shroominic and GitHub
2f841dfcbc
Merge pull request #254 from Routstr/format
...
make format required & fix ui formating
2025-12-11 10:01:38 +08:00
shroominic and GitHub
253f419ada
Merge pull request #234 from Routstr/ppq-integration
...
PPQ.ai provider integration
2025-12-02 12:04:03 +08:00
shroominic and GitHub
83818e1097
Merge pull request #246 from Routstr/fix-reserved–balance-race-condition
...
Fix reserved–balance race condition
2025-12-02 11:58:52 +08:00
shroominic and GitHub
e59335db4d
Merge pull request #233 from GitHappens2Me/fix/logging_redaction
...
Fixed false positives in SecurityFilter
2025-11-28 13:08:08 +09:00
shroominic and GitHub
0d698e9e75
Merge pull request #242 from Routstr/login-dark-mode
...
make login page dark mode
2025-11-23 14:37:39 -08:00
shroominic and GitHub
30fc8d91f6
Merge pull request #241 from Routstr/cursor/recreate-branch-with-original-commits-gemini-3-pro-preview-bbe5
...
unify stats and logs page with original commits
2025-11-23 14:29:58 -08:00
shroominic and GitHub
edd7bd40c5
Merge pull request #224 from GitHappens2Me/minor-fixes
...
Minor spelling / formatting fixes
2025-11-21 21:27:18 -08:00
shroominic and GitHub
6d6f66d6d0
Merge pull request #236 from Routstr/node-landingpage-clean
...
api cheat sheet
2025-11-21 17:57:09 -08:00
shroominic and GitHub
8a70e19430
Merge pull request #231 from GitHappens2Me/fix/stream-encoding
...
fixed streaming responses for unsupported content-encoding
2025-11-21 17:49:02 -08:00
shroominic and GitHub
19575eb1b9
Merge branch 'v0.2.1' into minor-fixes
2025-11-21 17:47:37 -08:00
shroominic and GitHub
e71baeb6d6
Merge pull request #232 from Routstr/rm-cdk-python-binaries
...
rm accidental push of cdk-python binaries
2025-11-21 17:46:39 -08:00
shroominic and GitHub
83a49a3c4a
Merge pull request #202 from Routstr/feature/configurable-model-exclusions
...
Feature/configurable model exclusions
2025-11-21 17:44:20 -08:00
shroominic and GitHub
071444f9d0
Merge pull request #200 from Routstr/fix/remove-models-from-base-url-output
...
Fix/remove models from base url output
2025-11-21 17:43:40 -08:00
shroominic and GitHub
14ae4ecce3
v0.2.0c
...
fix calculate_usd_max_costs
2025-11-14 20:27:25 +08:00
shroominic and GitHub
bb9b632ceb
Merge pull request #223 from Routstr/v0.2.0b
...
V0.2.0b
2025-11-14 16:08:46 +08:00
shroominic and GitHub
2da2f96118
Merge pull request #218 from Routstr/v0.2.0-final
...
add docs, fix anthropic upstream model alias problem
2025-11-11 13:48:05 +08:00
shroominic and GitHub
64bf8aec3f
Merge pull request #214 from Routstr/v0.2.0-dev
...
v0.2.0
2025-11-03 22:36:05 +08:00
shroominic and GitHub
3a69491ac0
Merge pull request #205 from routstr/v0.2.0-final
...
V0.2.0
2025-11-03 22:33:07 +08:00
shroominic and GitHub
af6ecbdd3e
Merge pull request #186 from Routstr/v0.1.4
...
V0.1.4
2025-10-20 10:11:09 +08:00
shroominic and GitHub
0c1fa27257
Merge pull request #189 from kwsantiago/kwsantiago/188-fee-not-applying-to-usd
...
fix: upstream provider fee not being applied to USD pricing
2025-10-18 13:30:17 +08:00
shroominic and GitHub
78d99a7462
Merge pull request #194 from Routstr/fix-x-cashu-msat-refund-bug
...
Fix x cashu msat refund bug
2025-10-16 16:03:12 +08:00
shroominic and GitHub
b2e5da4b46
Merge pull request #180 from Routstr/sh1ftred-patch-1
...
Fixed the bug where refund amount is below 1 sat for a sat mint
2025-09-23 12:40:43 +01:00
shroominic and GitHub
4bf02226dc
Merge pull request #172 from Routstr/fix-max-tokens-string-int
...
fix max-tokens coming in as string
2025-09-16 13:05:39 +01:00
shroominic and GitHub
3d4a8e0e14
Merge pull request #169 from Routstr/dev
...
## Routstr v0.1.3 — 2025-09-15
### Highlights
- **DB-backed settings with live updates**: Env vars seed on first run; DB is the source of truth (except `DATABASE_URL`). Manage via Admin UI or `PATCH /admin/api/settings`.
- **Models moved to database** with background sats-pricing computation and optional periodic refresh.
- **Smarter max-cost reservation**: Discount based on prompt tokens and `max_tokens` using `TOLERANCE_PERCENTAGE`, with a `MIN_REQUEST_MSAT` floor.
- **Faster startup and provider discovery**; `.onion` endpoints use Tor proxy by default.
### Breaking changes
- **Configuration is DB-first** after bootstrap. Env changes won’t auto-apply (besides `DATABASE_URL`).
- **Models endpoint**: Use `/v1/models` for canonical model info; `/v1/info` keeps an empty `models` field for back-compat.
- **Legacy pricing envs** are auto-mapped but deprecated:
- `MODEL_BASED_PRICING` → `!FIXED_PRICING`
- `COST_PER_REQUEST` → `FIXED_COST_PER_REQUEST`
- `COST_PER_1K_*` → `FIXED_PER_1K_*`
### Added
- **SettingsService** with env→computed→DB merge; runtime edits; app metadata (name/description) applied to OpenAPI.
- **Automatic migrations** on startup; new tables: `settings`, `models`.
- **Per-model sats pricing** and per-request maximums computed in the background.
- **Pricing controls**: `FIXED_PRICING`, `FIXED_COST_PER_REQUEST`, optional per-1k token overrides, `MIN_REQUEST_MSAT`.
- **Azure chat support**: Optional `CHAT_COMPLETIONS_API_VERSION` adds `api-version` to `/chat/completions`.
- **Derive `NPUB` from `NSEC`** during bootstrap if not provided.
### Changed / Improvements
- **Proxy header hardening**: Strip sensitive headers; replace Authorization with upstream key when configured.
- **Discovery**: Read `RELAYS` from settings; Tor proxy defaults for `.onion` via `TOR_PROXY_URL`; faster announcement fetching.
- **Admin**: Improved auth/log UX; fixed log search; show mint balances in dashboard.
- **Performance**: Optimized startup; lazy DB info loading.
### Fixed
- **Refunds**: Correct msat→sat conversion; configurable refund cache TTL via `REFUND_CACHE_TTL_SECONDS`; better error mapping for mint outages.
- **Balances**: Reserved balance reporting and negative-reserved edge cases.
- **Tests**: Updated to patch settings and use fixed-pricing flags.
### Upgrade notes (from v0.1.2)
1. Ensure `DATABASE_URL`, `UPSTREAM_BASE_URL`, and `ADMIN_PASSWORD` are set. Optionally set `UPSTREAM_API_KEY`, `RELAYS`, `CASHU_MINTS`, `TOR_PROXY_URL`.
2. Start the service; automatic Alembic migrations will run (`settings`, `models` tables).
3. Configure settings via Admin UI (`/admin`) or `PATCH /admin/api/settings`. Env changes after first run won’t apply automatically.
4. Prefer new pricing envs or a `models.json` at `MODELS_PATH`. Legacy envs are mapped but will be removed in a future release.
5. Optional tuning: `TOLERANCE_PERCENTAGE`, `MIN_REQUEST_MSAT`, `PRICING_REFRESH_INTERVAL_SECONDS`, `MODELS_REFRESH_INTERVAL_SECONDS`, `ENABLE_*_REFRESH`.
6. For Azure, set `CHAT_COMPLETIONS_API_VERSION`.
### References
- Configuration: `docs/getting-started/configuration.md`
- API: `docs/api/endpoints.md`
- Custom pricing: `docs/advanced/custom-pricing.md`
### Stats and credits
- 42 files changed, +1819/−832 lines.
- Merges: #170 token-discount-max-cost, #171 move-models-to-db.
- Contributors: Shroominic.
2025-09-16 12:43:54 +01:00
shroominic and GitHub
0478b1c360
Merge pull request #171 from Routstr/move-models-to-db
...
Move models to db
2025-09-11 13:40:04 +01:00
shroominic and GitHub
6993e6b156
Merge pull request #170 from Routstr/token-discount-max-cost
...
max cost discount
2025-09-09 18:30:14 +01:00
shroominic and GitHub
54fe4e27c0
⬆️ v0.1.2
2025-09-04 21:50:05 +01:00
shroominic and GitHub
f499be5c15
Merge pull request #160 from Routstr/azure-openai-compatibility
...
Azure OpenAI compatibility
2025-09-04 21:41:05 +01:00
shroominic and GitHub
12b88de226
Merge pull request #162 from Routstr/fix/reserved-balance-finalization
...
fix: always finalize reserved_balance; robust streaming finalization …
2025-09-04 21:40:44 +01:00
shroominic and GitHub
a2ea4e60b0
Merge pull request #118 from Routstr/cursor/discover-and-announce-routstr-providers-3b9a
...
Discover and announce routstr providers
2025-09-04 21:40:24 +01:00
shroominic and GitHub
ad068877ac
Merge pull request #155 from Routstr/cached-/refund
...
cached /refund
2025-09-04 14:19:53 +01:00
shroominic and GitHub
65084b1783
Merge pull request #154 from Routstr/cursor/document-entire-repository-for-users-and-contributors-43ef
...
mkdocs build fix
2025-08-25 02:15:32 -03:00
shroominic and GitHub
56485bffc3
Merge pull request #153 from Routstr/cursor/document-entire-repository-for-users-and-contributors-43ef
...
Document entire repository for users and contributors
2025-08-25 01:58:24 -03:00
shroominic and GitHub
73e701895d
Merge pull request #151 from Routstr/v0.1.1b
...
⬆️ v0.1.1b
2025-08-23 17:21:20 -03:00
shroominic and GitHub
f66e83d58a
Merge pull request #142 from Routstr/no-need-for-async
...
no need for async on get_proofs_per_mint_and_unit
2025-08-23 17:18:41 -03:00
shroominic and GitHub
14e0f821df
Merge pull request #150 from Routstr/final-fixes-cleanup
...
Final fixes cleanup
2025-08-23 17:18:04 -03:00
shroominic and GitHub
0ad60853d4
Merge pull request #149 from Routstr/v0.1.1
...
⬆️ v0.1.1
2025-08-23 13:32:13 -03:00
shroominic and GitHub
763813507a
Merge pull request #146 from Routstr/reserved-balance-and-fixes
...
Reserved balance and fixes
2025-08-23 13:25:32 -03:00
shroominic and GitHub
88d6e22918
Update pyproject.toml
2025-08-23 13:15:55 -03:00
shroominic and GitHub
14b73c2dcc
Delete coverage.xml
2025-08-23 13:15:10 -03:00
shroominic and GitHub
cb35168587
Delete pytest.xml
2025-08-23 13:14:49 -03:00
shroominic and GitHub
cb91136192
Merge pull request #147 from Routstr/fix-balance-refund-on-error
...
Apply proxy.py changes from reserved-balance-and-fixes branch
2025-08-22 15:53:42 -03:00
shroominic and GitHub
3fd6eee9af
Merge pull request #148 from Routstr/small-fixes
...
Apply .env.example and Dockerfile changes from reserved-balance-and-f…
2025-08-22 15:53:01 -03:00
shroominic and GitHub
44d8b8f738
Merge pull request #145 from Routstr/fix-swap_to_primary_mint
...
fix swap_to_primary_mint float bug + fee calc bug
2025-08-22 11:53:14 -03:00
shroominic and GitHub
be4616e608
Merge pull request #144 from Routstr/improve-balance-api
...
improve balance api
2025-08-22 11:50:16 -03:00
shroominic and GitHub
cc52857a9e
undo changes test.yml
2025-08-22 11:33:17 -03:00
shroominic and GitHub
45a81eabf2
Delete pytest.xml
2025-08-22 11:31:46 -03:00
shroominic and GitHub
558b6339d9
Delete coverage.xml
2025-08-22 11:31:32 -03:00
shroominic and GitHub
e9302bdfcb
Merge pull request #141 from Routstr/improve-latency-by-3s
...
improve latency by 3s
2025-08-21 15:38:29 -03:00
shroominic and GitHub
47d65b57f7
Merge pull request #140 from Routstr/fix-wallet-problems
...
batch checkstates + lru cache for wallet objects
2025-08-21 14:12:19 -03:00
shroominic and GitHub
f784a2a36d
Merge pull request #139 from Routstr/x-routstr-request-id-header
...
x-routstr-request-id header
2025-08-18 12:14:49 -03:00
shroominic and GitHub
cea6ddcd03
Merge pull request #138 from Routstr/132-fix-v1balancerefund-bugs
...
132 fix v1balancerefund bugs
2025-08-17 17:11:47 -03:00
shroominic and GitHub
8e8c32151d
Merge pull request #135 from Routstr/133-admin-dashboard-multi-currency
...
multi mint admin dashboard
2025-08-17 15:50:01 -03:00
shroominic and GitHub
f8665400cd
Merge pull request #131 from Routstr/129-implement-periodic_payout-to-lnurl
...
Implement periodic payout to owners lnurl
2025-08-16 16:34:45 -03:00
shroominic and GitHub
d5800335a6
Merge pull request #128 from Routstr/124-msat---sat-non-trusted-swap-not-working
...
fixxxx msat -> sat non trusted swap not working #124
2025-08-14 14:09:09 -03:00
shroominic and GitHub
c300082fd7
Merge pull request #127 from Routstr/fix-msat-refund
...
Fix msat refund
2025-08-13 17:56:22 -03:00
shroominic and GitHub
5d3d80c386
Merge pull request #126 from Routstr/fix-and-improve-logging
...
Fix and improve logging
2025-08-12 20:26:32 -03:00
shroominic and GitHub
9bab7aee7d
rm prints
2025-08-12 15:41:05 -03:00
shroominic and GitHub
4c15114fc0
Merge pull request #125 from Routstr/migrate-docker-smoothly
...
Migrate docker smoothly
2025-08-11 14:43:00 -03:00
shroominic and GitHub
432fa25ff8
Merge pull request #122 from Routstr/fix-msat-bearer-payments
...
fix msat Bearer payments
2025-08-11 00:02:21 -03:00