Skip to content

Twilio pricing constants (0.79¢, 1.3¢) have no source-of-truth comment #21

@AndresL230

Description

@AndresL230

Twilio pricing constants (0.79¢, 1.3¢) have no source-of-truth comment

Severity: Low
Affected repos: middleware-node, middleware-python
Component boundary: middleware provider registry

Symptom

Both SDKs hard-code Twilio pricing in provider-registry.ts / _provider_registry.py:

  • SMS: 0.79¢ per request
  • Voice: 1.3¢ per request

No comment explains the source or date. Twilio pricing has changed over the years; nobody knows when these numbers were last reviewed. If they're outdated, the SDK reports stale cost estimates for every Twilio user.

Evidence

  • middleware-node/src/core/provider-registry.ts — Twilio rules with magic numbers.
  • middleware-python/recost/_provider_registry.py — same numbers.

Impact

  • Cost estimates drift from Twilio's actual pricing over time.
  • Same concern applies to other hard-coded fingerprint values for OpenAI, Anthropic, Stripe, etc.

Fix recommendation

Two-part:

  1. Document the source and date at each price constant: // Twilio SMS $0.0079/msg as of https://www.twilio.com/sms/pricing, last reviewed 2026-05-01.
  2. Replace with a sync to GET /pricing — same feed the extension uses (high/05). The SDKs can sync provider pricing once at init and cache it. Then there's one place to update prices, not five.

Until (2) is in place, at least do (1).

Verification

  • Grep for cost-per-request numbers in both registries returns zero hits without a corresponding // source: ... as of YYYY-MM-DD comment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions