Commit 59be368
authored
feat(messages): retrieve provider API key for Messages API passthrough requests (#5981)
Replace hardcoded "no-key-required" header value in _passthrough_request
and _passthrough_count_tokens with dynamically retrieved API keys from
the provider configuration. This allows authenticated providers like
vLLM to successfully authenticate passthrough requests to their native
/v1/messages endpoints.
The implementation preferentially calls
_get_api_key_from_config_or_provider_data() to support both static
configuration and per-request credential overrides via request headers,
falling back to get_api_key() if unavailable.
Note: This introduces a temporary abstraction violation that will be
refactored in a future change to use a proper provider interface for
Messages API support.
Fixes providers requiring authentication (e.g., vLLM) when using native
passthrough mode.1 parent 7b2d07c commit 59be368
1 file changed
Lines changed: 22 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
472 | 472 | | |
473 | 473 | | |
474 | 474 | | |
| 475 | + | |
475 | 476 | | |
476 | 477 | | |
477 | 478 | | |
478 | 479 | | |
479 | 480 | | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
480 | 490 | | |
481 | 491 | | |
482 | 492 | | |
| |||
485 | 495 | | |
486 | 496 | | |
487 | 497 | | |
488 | | - | |
| 498 | + | |
489 | 499 | | |
490 | 500 | | |
491 | 501 | | |
| |||
571 | 581 | | |
572 | 582 | | |
573 | 583 | | |
| 584 | + | |
574 | 585 | | |
575 | 586 | | |
576 | 587 | | |
577 | 588 | | |
578 | 589 | | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
579 | 599 | | |
580 | 600 | | |
581 | 601 | | |
| |||
584 | 604 | | |
585 | 605 | | |
586 | 606 | | |
587 | | - | |
| 607 | + | |
588 | 608 | | |
589 | 609 | | |
590 | 610 | | |
| |||
0 commit comments