Bug: 500 Invalid resource field value in the request on OpenAI completion for gemini-cli
Bug: 500 Invalid resource field value in the request on OpenAI completion for gemini-cli
Bug Description
When an OpenAI-formatted chat completion request is sent to the proxy for the gemini-cli model, the server responds with a 500 error and the message Invalid resource field value in the request. This issue occurs due to an incorrect translation of the request from the OpenAI format to the format required by gemini-cli.
CLI Type
gemini-cli
Model Name
Any model accessible via gemini-cli (e.g., gemini-pro).
LLM Client
Any OpenAI-compatible client.
Request Information
A standard v1/chat/completions request in OpenAI format.
Expected Behavior
The proxy should correctly translate the OpenAI request into the gemini-cli format, successfully send it to the Gemini API, and return the response.
OS Type
- OS: Ubuntu
- Version 24.04
I think this issue is caused by the redundant configurations in your config.yaml. Please refer to the config.example.yaml on the main branch and comment out the unnecessary settings.
If the problem persists, please try deleting the auth file and then login again using the -project_id parameter. You can find your project id at https://console.cloud.google.com/welcome.
Let me know if you're still running into trouble.
I've added a new feature to the latest version that allows you to list and activate existing projects using the GCP API, so there is no longer a need for the -project_id flag. Please try out the latest version.