Agent integration guide
Use Gemini CLI with WaveSpeed LLM API
This guide shows how to connect Gemini CLI to WaveSpeed AI with ~/.gemini/.env, Gemini generateContent API, /v1beta/models/{model}:generateContent, base URL https://llm.wavespeed.ai/v1, and default model deepseek/deepseek-v4.1-flash-1017. Copy the configuration above, export your API key, run the agent, then verify requests in Logs.
Create a WaveSpeed access key
Export the required key locally
Paste config into
~/.gemini/.envRun gemini and check Logs
What this Gemini CLI setup configures
Protocol
Gemini generateContent API
Endpoint
/v1beta/models/{model}:generateContent
Model
deepseek/deepseek-v4.1-flash-1017
The copy-ready configuration above is the only Gemini CLI file you need to edit for the recommended setup: ~/.gemini/.env. Keep the API key in your shell environment so it is not committed to a repository.
Troubleshooting
The API key is not being picked up
Export WAVESPEED_API_KEY in the same shell where you run Gemini CLI. If you use a shell profile, reload the terminal before starting the agent.
Requests fail with a protocol or endpoint error
Check that Gemini CLI is using Gemini generateContent API and endpoint /v1beta/models/{model}:generateContent. Protocol mismatches are the most common cause of 404 or payload errors.
The selected model does not work
Confirm the model id exists in WaveSpeed Models, then paste the exact id into ~/.gemini/.env. You can start with the default model shown on this page.
No requests appear in Logs
Make sure Gemini CLI is using the WaveSpeed base URL and your current API key. Then send a new prompt from the local agent and refresh Logs.
Can this Gemini CLI guide show up in search?
Yes. This page is built as an indexable setup guide for users searching for Gemini CLI custom provider, OpenAI-compatible endpoint, base URL, and local agent configuration workflows.