Description
When attempting to use a Google Gemini API key through the "Custom provider" option using the OpenAI Chat wire protocol, the initial connection and model fetching succeed, but generating a design fails immediately with a 400 status code (no body) error.
Note for triage: Based on the logs, there are two likely culprits regarding Gemini's strict OpenAI wrapper:
- Model Name Prefix: The connection test successfully fetches models, but they are returned with the
models/ prefix (e.g., models/gemini-3.1-pro-preview). Passing this prefix back in the generation payload might be causing the API to reject the request.
- Unsupported Agent Parameters: Gemini's OpenAI compatibility wrapper is very strict. If Open CoDesign's agent runtime is passing specific OpenAI parameters in the payload (like
presence_penalty, frequency_penalty, or strict JSON schema enforcement) that Google hasn't mapped, it will reject the entire request with a 400 error regardless of prompt size.
Steps to reproduce
- Go to Settings -> Models ->
+ Add provider.
- Select Custom provider.
- Set Wire protocol to
OpenAI Chat.
- Set Base URL to
https://generativelanguage.googleapis.com/v1beta/openai/.
- Enter a valid Google Gemini API key.
- Click Test connection (this succeeds and populates the model dropdown).
- Select a model from the dropdown (e.g.,
models/gemini-3.1-pro-preview).
- Return to the chat and attempt to generate a design prompt.
Expected behavior
The app should successfully pass the prompt to the Gemini API via the OpenAI compatibility layer and return a generated design.
Actual behavior
The generation fails immediately. The UI displays an error dialog stating: Error invoking remote method 'codesign:v1:generate': CodesignError: 400 status code (no body).
open-codesign version
0.1.3
Platform
Windows
OS version
Windows 10
Model provider (if relevant)
Other
Error code
PROVIDER_ERROR
Diagnostics bundle
open-codesign-diagnostics-2026-04-22T21-30-40.zip
Logs
[2026-04-22 18:02:54.037] [info] (main:ipc) [generate] step=load_config.ok {
generationId: 'moajhfkr-0krhrt',
ms: 0,
hasApiKey: true,
baseUrl: 'https://generativelanguage.googleapis.com/v1beta/openai/'
}
...
[2026-04-22 18:02:54.419] [error] (main:ipc) [title] step=send_request.fail { ms: 424, errorClass: 'CodesignError' }
[2026-04-22 18:02:54.419] [error] (main:ipc) [title] generate-title.fail {
provider: 'custom-gemini-api-dnpm',
modelId: 'models/gemini-3.1-pro-preview',
baseUrl: 'https://generativelanguage.googleapis.com/v1beta/openai/',
message: '400 status code (no body)',
code: 'PROVIDER_ERROR'
}
Description
When attempting to use a Google Gemini API key through the "Custom provider" option using the OpenAI Chat wire protocol, the initial connection and model fetching succeed, but generating a design fails immediately with a
400 status code (no body)error.Note for triage: Based on the logs, there are two likely culprits regarding Gemini's strict OpenAI wrapper:
models/prefix (e.g.,models/gemini-3.1-pro-preview). Passing this prefix back in the generation payload might be causing the API to reject the request.presence_penalty,frequency_penalty, or strict JSON schema enforcement) that Google hasn't mapped, it will reject the entire request with a 400 error regardless of prompt size.Steps to reproduce
+ Add provider.OpenAI Chat.https://generativelanguage.googleapis.com/v1beta/openai/.models/gemini-3.1-pro-preview).Expected behavior
The app should successfully pass the prompt to the Gemini API via the OpenAI compatibility layer and return a generated design.
Actual behavior
The generation fails immediately. The UI displays an error dialog stating:
Error invoking remote method 'codesign:v1:generate': CodesignError: 400 status code (no body).open-codesign version
0.1.3
Platform
Windows
OS version
Windows 10
Model provider (if relevant)
Other
Error code
PROVIDER_ERROR
Diagnostics bundle
open-codesign-diagnostics-2026-04-22T21-30-40.zip
Logs
[2026-04-22 18:02:54.037] [info] (main:ipc) [generate] step=load_config.ok { generationId: 'moajhfkr-0krhrt', ms: 0, hasApiKey: true, baseUrl: 'https://generativelanguage.googleapis.com/v1beta/openai/' } ... [2026-04-22 18:02:54.419] [error] (main:ipc) [title] step=send_request.fail { ms: 424, errorClass: 'CodesignError' } [2026-04-22 18:02:54.419] [error] (main:ipc) [title] generate-title.fail { provider: 'custom-gemini-api-dnpm', modelId: 'models/gemini-3.1-pro-preview', baseUrl: 'https://generativelanguage.googleapis.com/v1beta/openai/', message: '400 status code (no body)', code: 'PROVIDER_ERROR' }