Skip to content

Openrouter AI SDK provider overrides/silently rewrites user-specified headers #300

@mcowger

Description

@mcowger

When I create a OpenRouter client, I specify my desired headers as:

			createOpenRouter({
				apiKey: apiKey,
				headers: config.headers
			} as OpenRouterProviderSettings)

Assuming config.headers is {"User-Agent", "my-header-here}, the headers that the implementation actually sends becomes: my-header-here, ai-sdk/openrouter/1.4.0.

Modifying user specified headers without warning or notice is not expected behavior.

This happened with #193

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions