Releases: eofreternal/openrouter-client
Releases · eofreternal/openrouter-client
Release list
v1.9.0
You can also customize the URL that it makes requests to. It defaults to https://openrouter.ai/api/v1 but you can customize it like this:
import { OpenRouter } from "openrouter-client";
// Add `undefined` because JavaScript doesn't have kwargs
// Class constructor() signature is: constructor(apiKey: string, globalConfig?: Types.Config, apiBase?: string)
const OpenRouterClient = new OpenRouter("API key here", undefined, "insert API URL here. Don't leave a trailing slash");
// valid: `https://openrouter.ai/api/v1`
// invalid: `https://openrouter.ai/api/v1/`
// ^ notice the trailing slash. that's what makes it invalid
let nl = await OpenRouterClient.chat([{
role: "user",
content: [
{ type: "text", text: "Hello World" },
],
}], {
model: "deepseek/deepseek-r1-0528-qwen3-8b",
});
console.dir(nl);This works for streaming too. It's literally the same Class constructor signature
v1.8.0
Added "usage": { "include": true } support to the config
v1.7.0
I caught the wrapper up to speed with the current state of OpenRouter's APIs for the most part
Added functionality
- Audio uploads
- Image gen
- Proper plugin support
- Fetch usage data for current API key
- add getGenerationStats and getKeyUsage to OpenRouterStream
Bug fixes
- I forgot to let people upload PDFs when I added PDF support lol
- I forgot to make getGenerationStats send the auth token when I made that function
- OpenRouter changed their API so
finish_reasonhad proper typings in the docs now + addednative_finish_reason
Misc
- Types are easier to use now because they're more individually exportable
TODO
- Let users use
"usage": { "include": true }
Full Changelog: v1.6.0...v1.7.0
v1.6.0
feat: added logit bias
feat: added top_a
feat: added predicted output (openai only)
v1.2.0
feat: added json_schema support for response formats
1.1.0
Added streaming support
Refactored code by moving types into a separate file