diff --git a/litellm/litellm_core_utils/get_litellm_params.py b/litellm/litellm_core_utils/get_litellm_params.py index 04755f9e1e9..1b2cb4b0fa8 100644 --- a/litellm/litellm_core_utils/get_litellm_params.py +++ b/litellm/litellm_core_utils/get_litellm_params.py @@ -76,6 +76,7 @@ OPTIONAL_KWARGS_KEYS: Final = ( "otpm", "use_xai_oauth", "github_copilot_auth_type", + "litellm_credential_name", "github_copilot_user_session", "fireworks_forward_user_id", PROVIDER_AFFINITY_HEADER_KWARG_KEY, diff --git a/litellm/main.py b/litellm/main.py index 474d82e8ef1..021901a551e 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -5707,6 +5707,7 @@ def completion( *OPENAI_WIF_KWARGS_KEYS, *OAUTH_TOKEN_EXCHANGE_KWARGS_KEYS, "github_copilot_auth_type", + "litellm_credential_name", "github_copilot_user_session", PROVIDER_AFFINITY_HEADER_KWARG_KEY, "fireworks_forward_user_id", diff --git a/tests/unit/llms/github_copilot/test_per_user_auth.py b/tests/unit/llms/github_copilot/test_per_user_auth.py index 9b16d3c0aa7..b138177e443 100644 --- a/tests/unit/llms/github_copilot/test_per_user_auth.py +++ b/tests/unit/llms/github_copilot/test_per_user_auth.py @@ -688,6 +688,24 @@ def test_e2e_responses_per_user_credential(per_user_credential): assert response.usage.total_tokens == 6 +@pytest.mark.asyncio +async def test_e2e_acompletion_bridged_to_responses_per_user_credential(per_user_credential): + with ( + github_http(_copilot_surface_responder(_responses_payload())) as requests, + _no_authenticator(), + ): + response = await litellm.acompletion( + model="github_copilot/gpt-5.3-codex", + messages=[{"role": "user", "content": "hi"}], + litellm_credential_name="copilot-cred", + github_copilot_auth_type="per_user_oauth", + secret_fields=_secret_fields("user-a", "gho_a"), + ) + _assert_exchange_then_model_call(requests, "gho_a") + assert requests[-1].url.path == "/responses" + assert response.usage.total_tokens == 6 + + @pytest.mark.asyncio async def test_e2e_anthropic_messages_per_user_credential(per_user_credential): with (