Skip to content

Not Working with Google Gemini API #390

Open
@devadattas

Description

@devadattas

I have the following config for mycoder.config.js:

export default {
    provider: 'openai',
    model: 'gemini-2.5-pro-exp-03-25',
    baseUrl: 'https://generativelanguage.googleapis.com/v1beta/openai',
    logLevel: 'verbose',
    githubMode: false,
    headless: true
};

I keep getting the following error:

Detected 2 browsers on the system
Available browsers:
- Chrome (chromium) at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
- Firefox (firefox) at /Applications/Firefox.app/Contents/MacOS/firefox
MyCoder v1.6.0 - AI-powered coding assistant
GitHub mode is enabled but there are issues with git/gh CLI tools:
- GitHub CLI is not available. Please install gh CLI.
GitHub mode requires git and gh CLI tools to be installed.
Please install the missing tools or disable GitHub mode with --githubMode false
Disabling GitHub mode due to missing CLI tools.
Looking API key in env: OPENAI_API_KEY
LLM: openai/gemini-2.5-pro-exp-03-25
Using API key: AIza...
Using base url: https://generativelanguage.googleapis.com/v1beta/openai

An error occurred:
Error: Error calling OpenAI API: 400 status code (no body)
Error: Error calling OpenAI API: 400 status code (no body)
    at OpenAIProvider.generateText (file:///Users/admin/.nvm/versions/node/v22.14.0/lib/node_modules/mycoder/node_modules/mycoder-agent/src/core/llm/providers/openai.ts:126:13)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at toolAgent (file:///Users/admin/.nvm/versions/node/v22.14.0/lib/node_modules/mycoder/node_modules/mycoder-agent/src/core/toolAgent/toolAgentCore.ts:142:45)
    at executePrompt (file:///Users/admin/.nvm/versions/node/v22.14.0/lib/node_modules/mycoder/src/commands/$default.ts:187:20)
    at Object.handler (file:///Users/admin/.nvm/versions/node/v22.14.0/lib/node_modules/mycoder/src/commands/$default.ts:280:5)
0
[Token Usage Total] Root: input: 0 cache-writes: 0 cache-reads: 0 output: 0 COST: $0.00
Forcing exit after 5000ms timeout

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions