350
return;
351
}
353
>
// CAPI's `/v1/messages` expects the endpoint format (dotted,
354
>
// `claude-haiku-4.5`). Rewrite on the way out.
355
>
const endpointModelId = parsedModel.toEndpointModelId();
356
>
body.model = endpointModelId;
357
>
358
>
const stream = body.stream === true;
359
>
const headers = buildOutboundHeaders(req.headers);
360
>
361
>
const entry: IProxyInFlight = {
362
>
ac: new AbortController(),
363
>
res,
364
>
clientGone: false,
365
>
};
366
>
runtime.inFlight.add(entry);
367
>
const onClose = () => {
368
entry.clientGone = true;
369
entry.ac.abort();
370
};
372
>
373
>
try {
374
>
if (stream) {
375
await this._streamMessages(
376
body as unknown as Anthropic.MessageCreateParamsStreaming,