#2479·airi

feat(gateway): support hosted Responses API with Flux billing

Author: luoling8192Created Sep 7, 2026Updated Sep 7, 2026

Goal

Add Responses API to AIRI's authenticated gateway and settle hosted generation through the existing Flux policy.

Scope

  • Add stateless POST /api/v1/openai/responses with native JSON and SSE forwarding.
  • Select only upstreams that explicitly declare Responses support.
  • Reuse authentication, rate limits, aliases, tracing, and Flux debit transactions.
  • Charge completed requests from their input/output usage. Do not charge failed, incomplete, cancelled, or truncated streams.
  • Enable Responses for the official provider after the client adapter is available.

Acceptance criteria

  • Gateway and router regressions cover success, error, cancellation, usage, and protocol selection.
  • Unsupported upstreams do not receive Responses requests.
  • The stateless endpoint rejects provider-side conversation references and hosted tools with separate charges.
  • The official provider retains authenticated credentials.
  • Live gateway and Flux behavior are checked before release.

The BYOK client work in #2477 does not depend on this issue. No live configuration or deployment is included. Realtime sessions and a separate search service are outside this issue.