Add support for OpenRouter API requests using OPENROUTER_TOKEN#14
Add support for OpenRouter API requests using OPENROUTER_TOKEN#14willchrisjr wants to merge 1 commit intonraiden:mainfrom
OPENROUTER_TOKEN#14Conversation
* **Environment Variables** - Add `OPENROUTER_TOKEN` to `.env` file * **Module Imports and Exports** - Import `openrouter` module in `index.js` - Add `openrouter` to exported modules in `index.js` * **Anthropic Inference Function** - Import `openrouter` module in `anthropic.js` - Add condition to check for `OPENROUTER_TOKEN` and use it if available in `anthropic.js`
| import fetch from "node-fetch"; | ||
|
|
||
| async function inference({ model, messages, stream = process.stdout }) { | ||
| const response = await fetch("https://api.openrouter.ai/v1/chat/completions", { |
There was a problem hiding this comment.
URL should be just https://openrouter.ai/v1/chat/completions
|
keep running into a API Payload Too Large issue with the OpenRouter API. Anyone else?
|
Environment Variables
OPENROUTER_TOKENto.envfileModule Imports and Exports
openroutermodule inindex.jsopenrouterto exported modules inindex.jsAnthropic Inference Function
openroutermodule inanthropic.jsOPENROUTER_TOKENand use it if available inanthropic.js