ADR-057: Speech and image services carry attribution in options
- Status
-
Accepted
- Date
-
2026-07-14
- Authors
-
Netresearch DTT GmbH
Context
ADR-052 made the caller-supplied be win
over the ambient backend. aspect for usage attribution, but
deferred the four specialized speech/image services: their option
shapes (Transcription, Speech,
Image, and Fal's plain array)
carried no budget fields, so every transcription, synthesis and image
generation landed in the ambient bucket — be_ for
frontend, CLI and worker callers — with no way for a consumer to
attribute the spend.
Unlike chat/completion/embedding/vision, these services do not run
through the middleware pipeline (they dispatch HTTP directly via
Abstract), so neither Budget nor
Usage can supply the uid; the services call
track themselves.
Decision
Extend the options-based attribution of ADR-052 to the specialized services — attribution only, no enforcement:
Transcription,Options SpeechandSynthesis Options ImageimplementGeneration Options BudgetviaAware Options Interface Budget: optional trailingFields Trait be/User Uid plannedconstructor parameters,Cost fromkeys of the same names, validation rejecting negative values. The fields stay out ofArray () to— the services build their wire payload fromArray () to, so a missed exclusion would leak the uid to the remote API.Array () Whisper,Transcription Service TextandTo Speech Service DallforwardEImage Service getto theirBe User Uid () trackcalls.Usage () Falkeeps its plain options array (no DTO exists) and reads a documentedImage Service bekey — the same array patternUser Uid Translationuses for translators. The payload builder is an explicit allowlist, so the key never reaches the FAL API.Service DallandEImage Service:: create Variations () edittake no options object; they gain an optional trailing() ?int $bescalar parameter instead of growing a new options type for two DALL-E-2-only endpoints.User Uid
Consequences
- Consumers can attribute speech and image spend per backend user from any context; without the uid the ambient fallback keeps the previous behaviour.
- Attribution and enforcement remain decoupled: the specialized
services still bypass the middleware pipeline, so per-user budget
ceilings are NOT enforced on speech/image calls.
plannedis carried but unused there. Routing these services through a budget pre-flight is a separate decision with its own trade-offs (no token-based cost model for FAL, multipart request flows) and gets its own ADR if a consumer needs it.Cost - The three option DTOs and the two DALL-E signatures are public
surface; the additions are optional trailing parameters
(semver-minor in the 0.x line, same policy as the ADR-052
trackchange).Usage () Budget's docblock now names the attribution-only consumers so the "reaches BudgetMiddleware" assumption is not silently wrong.Aware Options Interface