litellm - 💡(How to fix) Fix [Bug]: Bedrock passthrough deployment initialization fails with IAM/OIDC credentials because api_key is required

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

When use_in_pass_through: true is enabled for a Bedrock model deployment that uses IAM/OIDC credentials (via aws_role_name, aws_session_name, aws_web_identity_token) instead of an api_key, the deployment initialization fails with:

Error creating deployment: api_key is required for setting pass-through credentials, ignoring and continuing with other deployments.

Error Message

Error creating deployment: api_key is required for setting pass-through credentials, ignoring and continuing with other deployments. The passthrough deployment initialization code has a special branch for vertex_ai, but Bedrock falls through to the generic handling path that calls set_pass_through_credentials(api_key=api_key). This raises an error when api_key is None, which is the expected state for Bedrock deployments using AWS IAM/OIDC authentication. Error creating deployment: api_key is required for setting pass-through credentials, ignoring and continuing with other deployments.

  • #15643 — exact same error message, closed as stale with no fix applied.

Root Cause

The passthrough deployment initialization code has a special branch for vertex_ai, but Bedrock falls through to the generic handling path that calls set_pass_through_credentials(api_key=api_key). This raises an error when api_key is None, which is the expected state for Bedrock deployments using AWS IAM/OIDC authentication.

Because the invalid deployment is silently ignored ("ignoring and continuing with other deployments"), the Bedrock deployment is skipped entirely — breaking not only passthrough routing but also normal (non-passthrough) model routing for that deployment.

Code Example

Error creating deployment: api_key is required for setting pass-through credentials, ignoring and continuing with other deployments.

---

model_list:
  - model_name: bedrock-claude
    litellm_params:
      model: bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0
      aws_role_name: "arn:aws:iam::123456789012:role/MyRole"
      aws_session_name: "my-session"
      aws_web_identity_token: "oidc-token-value"
      use_in_pass_through: true
      # No api_key — Bedrock uses IAM/OIDC credentials

---

Error creating deployment: api_key is required for setting pass-through credentials, ignoring and continuing with other deployments.
RAW_BUFFERClick to expand / collapse

Bug Report

Summary

When use_in_pass_through: true is enabled for a Bedrock model deployment that uses IAM/OIDC credentials (via aws_role_name, aws_session_name, aws_web_identity_token) instead of an api_key, the deployment initialization fails with:

Error creating deployment: api_key is required for setting pass-through credentials, ignoring and continuing with other deployments.

Root Cause

The passthrough deployment initialization code has a special branch for vertex_ai, but Bedrock falls through to the generic handling path that calls set_pass_through_credentials(api_key=api_key). This raises an error when api_key is None, which is the expected state for Bedrock deployments using AWS IAM/OIDC authentication.

Because the invalid deployment is silently ignored ("ignoring and continuing with other deployments"), the Bedrock deployment is skipped entirely — breaking not only passthrough routing but also normal (non-passthrough) model routing for that deployment.

Impact

  • Production-impacting: enabling use_in_pass_through: true on any Bedrock deployment using IAM/OIDC causes the deployment to be dropped.
  • Normal Bedrock routing (non-passthrough) also breaks because the deployment is skipped during initialization.

Minimal Config to Reproduce

model_list:
  - model_name: bedrock-claude
    litellm_params:
      model: bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0
      aws_role_name: "arn:aws:iam::123456789012:role/MyRole"
      aws_session_name: "my-session"
      aws_web_identity_token: "oidc-token-value"
      use_in_pass_through: true
      # No api_key — Bedrock uses IAM/OIDC credentials

Actual Behavior

Error creating deployment: api_key is required for setting pass-through credentials, ignoring and continuing with other deployments.

The deployment is silently dropped from the router.

Expected Behavior

  • Bedrock passthrough initialization should support AWS IAM/OIDC credentials (aws_role_name, aws_session_name, aws_web_identity_token) without requiring api_key.
  • At minimum, a deployment marked with use_in_pass_through: true should not be dropped from normal (non-passthrough) routing if passthrough credential setup fails.

Related Issues

  • #15643 — exact same error message, closed as stale with no fix applied.
  • #16497 — related open feature request for AWS credentials from config.yaml for Bedrock passthrough, but does not cover OIDC/IAM role assumption.

Question

Is Bedrock passthrough with aws_role_name / aws_web_identity_token (OIDC/IAM) supported or planned? If not yet supported, could the initialization at least avoid dropping the deployment from normal routing?

Environment

  • LiteLLM version: latest (also reproduced on recent prior versions)
  • Provider: AWS Bedrock
  • Authentication: IAM/OIDC (STS AssumeRoleWithWebIdentity)

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING