Skip to content

Document /v1/call pricing, headers and billing timing #1336

Description

@greatest0fallt1me

Summary

README mentions the proxy briefly, but nothing documents how /v1/call resolves API slugs, how endpoint prices are matched, which headers are stripped (authorization, cookie, x-forwarded-for), that only 2xx responses are billed, and that billing occurs after the response finishes.

Why this matters

API consumers are surprised by stripped Authorization headers and cannot predict charges; developers cannot configure pricing correctly.

Scope

Create docs/gateway-proxy.md covering request flow from createProxyRouter's comment, stripping rules, pricing resolution, billing trigger conditions, rate-limit layers and error responses (401/402/404/429/502/504).

Relevant code in CalloraOrg/Callora-Backend:

  • README.md
  • src/routes/proxyRoutes.ts
  • src/data/apiRegistry.ts
  • docs/gateway-api-key-auth.md

Priority

Medium

Acceptance criteria

  • The strip header list matches DEFAULT_STRIP_HEADERS
  • Pricing examples match resolveEndpointPrice behaviour
  • Billed vs unbilled responses are listed
  • The doc is linked from README

Validation

Check examples against npm test -- src/__tests__/proxy.integration.test.ts.

Non-goals

  • Typo-only, formatting-only, or cosmetic changes.
  • Unrelated refactors, dependency upgrades, or broad rewrites.
  • Removing safeguards or weakening validation to make tests pass.

Contributor application

Before coding, describe the affected modules, proposed state/invariant changes, test strategy, compatibility considerations, and an estimate. Wait for assignment before starting implementation.

PR requirements

Use a feature branch and include Closes #<issue-number>. Address every criterion, map criteria to code and tests, explain security and failure-mode handling, and ensure CI passes.

Quality review

A maintainer will assess correctness, completeness, test depth, compatibility, observability, and adverse-case handling. A substantive implementation is required; merge or CI status alone does not guarantee reward eligibility.


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveStellar Wave Program issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions