rea-tool-design
MOmorluto/rea485k近 7 天新增 9,215 个 star
How to make new billable work (a model, vendor, modality or phone feature) report usage and get priced correctly. Read before adding anything the router bills, or when work shows up unpriced.
Providers report quantities; the price list turns them into cost. Never compute cost in a provider.
internal/pricing/pricing.go. List prices: acceleration/prices/vendor.json (rates only, region required).vendor.json PR. See check_prices.unpriced, and configs naming it get a 400. free: true is a price; a missing entry is not.output_tokens rate does not fall back: it is free.VendorCostMicros so router prices drift can check the rate.vendor.json entry from the vendor's pricing page, dated in the router.yaml comment. Self-hosted models get local: true instead.go test ./internal/routing/ -run TestEveryRoutedModelIsPriced, router prices check, and the modality's integration suite.router prices show --unpriced is empty, the start log has no "billable work has no price", and one real request returns X-Stream-Cost-Micros equal to quantity × price.input_tokens, cached_input_tokens, cache_write_input_tokens, output_tokens. Write a long-prompt surcharge as tiers (above_input_tokens) and a service tier as when: {service_tier}. A customer-key (BYOK) twin is generated: never write one. See router-llm.input_audio_tokens, output_text_tokens, …), plus generic input_tokens/output_tokens at the audio rates as a fallback for vendors that report no split. See router-sts.audio_ms (per minute is per: 3600000). See router-stt.characters, or audio_ms if the vendor bills by duration. See router-tts.input_tokens, plus output_tokens if billed. A System One vendor reports usage for you; :free endpoints use free: true. See decision_model.requests, or tokens for LLM-backed search. See router-search.images, pages, or tokens, whichever the vendor bills. See router-detection.requests; knowledge also uses bytes_written, bytes_queried, bytes_returned, results and byte_hours. Add new billed work to internal/billable so --unpriced checks it.vcpu_seconds, memory_gb_seconds and disk_gb_seconds, with when: {class}, recorded by the usage jobs. Each new region or target needs entries.dial and call_minutes (call_seconds); SMS uses messages, message_segments and media_messages with when by country, direction or category. A cost the vendor quotes outright (a number's month) goes through Quoted, with no entry. WhatsApp and iMessage are billed by the app's own account: don't price them. A new vendor goes in billable.Items. See telnyx, phonecheck.stream text/voice/video by seconds, recorded in slices by routing.NewRecorder. These are the operator's own prices: set them by price change, not in vendor.json.MOmorluto/rea485k近 7 天新增 9,215 个 star
MAmattpocock/skills336k近 7 天新增 5,004 个 star
AFaffaan-m/ECC314k近 7 天新增 4,125 个 star
NEnextlevelbuilder/ui-ux-pro-max-skill156k近 7 天新增 3,077 个 star
NEnextlevelbuilder/ui-ux-pro-max-skill156k近 7 天新增 3,077 个 star
THthedotmack/claude-mem121k近 7 天新增 1,594 个 star