Route path this adapter serves, e.g. "/v1/messages".
Create an incremental usage extractor for a streaming response body.
onResponse receives each provider response object the stream carries,
with the type of the event that carried it, on protocols that have one,
before the chunk holding it is forwarded.
OptionalonResponse: (response: Record<string, unknown>, eventType: unknown) => voidWhether the client requested a streaming response.
Parse actual usage from a complete (non-streaming) JSON response body.
Build the complete token-bearing admission projection.
Validates the parsed JSON body against this provider's required shape.
Must be called — and must return ok: true — before toAdmissionRequest /
isStreamRequested are trusted with the body; those functions assume
a validated shape and use defensive fallbacks only as a last resort.
Headers forwarded verbatim to the upstream (auth passthrough — the gateway holds no provider keys).