dylibso / dylibso/mcpx-openai-node
Feature Request: Support Gemini via OpenAI compatible API on OpenAI MCP client
- Dominant language
- TypeScript
- Stars
- 15
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
- So recently Gemini made their API compatible with OpenAI library. More details: https://ai.google.dev/gemini-api/docs/openai#node.js
- Ideally it just requires changing the model and baseURL. I tried making the following changes in index.js from example code at https://docs.mcp.run/tutorials/mcpx-openai-node/
```
// change baseURL after exporting gemini key instead
// const openai = new OpenAI({ apiKey: OPENAI_API_KEY });
const openai = new OpenAI({
apiKey: OPENAI_API_KEY,
baseURL: "https://generativelanguage.googleapis.com/v1beta/openai/"
});
// change the model
let response = await mcpx.chatCompletionCreate({
model: "gemini-1.5-flash", // Select your preferred model
temperature: 0,
messages,
});
```
- but seem to be getting the following error.

Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.