Skip to content

[Bedrock] File attachments are broken - AI SDK v6 #11518

@willdady

Description

@willdady

Description

I consistently get the following error when using the bedrock provider when a message contains a "file" part. Note I have confirmed the file name contains valid characters despite the error. I'm using model id global.anthropic.claude-sonnet-4-5-20250929-v1:0 if it helps.

APICallError [AI_APICallError]: undefined: The document file name can only contain alphanumeric characters, whitespace characters, hyphens, parentheses, and square brackets. The
 name can't contain more than one consecutive whitespace character. Check that the file name conforms to these restrictions and retry your request.

When using an LLM to debug this it gives me the following root cause?:

The error occurs because of a property name mismatch in file attachments:

  • File parts have: filename and mediaType properties
  • Bedrock expects: name and mimeType properties
  • Result: Bedrock can't find the name property, resulting in "undefined:" error

AI SDK Version

ai 6.0.6
@ai-sdk/amazon-bedrock 4.0.4

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai/providerrelated to a provider package. Must be assigned together with at least one `provider/*` labelprovider/amazon-bedrockIssues related to the @ai-sdk/amazon-bedrock providerprovider/anthropicIssues related to the @ai-sdk/anthropic providersupport

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions