Closed RostyslavManko closed 1 month ago
Hi @RostyslavManko,
Thanks for the request. We've created an extraBody
argument.
You can use it like this:
import { createOpenRouter } from "@ai-sdk/openrouter";
const provider = createOpenRouter({
apiKey: "your-api-key",
// Extra body to pass to OpenRouter
extraBody: {
custom_field: "custom_value",
providers: {
anthropic: {
custom_field: "custom_value",
},
},
},
});
const model = provider.chat("anthropic/claude-3.5-sonnet");
const response = await model.doStream({
inputFormat: "prompt",
mode: { type: "regular" },
prompt: [{ role: "user", content: "Hello" }],
});
Could you please update @openrouter/ai-sdk-provider's package so we can start using it? The last update was a month ago.
The Vanilla Vercel AI SDK doesn't support sending extra body arguments like provider, route, and others, which OpenRouter provides. These arguments are essential for fully using the OpenRouter. Please add support for these arguments to the streamText function.