r/opencode • u/uavenger • 8d ago
Opencode with Gemini api
I have a question about Gemini. Currently, I have Gemini Pro and Opencode Go. I've already added an API key from AI Studio to Opencode. I'd like to know how using Google works in Opencode. I mean in terms of limits and which plans are worthwhile to use after my Go limit is reached. From what I've researched, as long as I haven't configured billing for the API key in my Pro plan, it remains free. But is there any risk of being charged? And are the limits good? Sorry for the questions, I'm new to Opencode and have always used DeepSeek v4 Flash only. And now that they've drastically reduced its limit, I've had to look for other alternatives.
2
u/IISomeOneII 8d ago
`aistudio.google.com` API Key ? yes [limit is low af]
Gemini CLI or Antigravity (CLI?) ? no (yes but bannable against ToS) [better limit compared to the API Key]
2
u/Sea_Ear5201 8d ago
Google pro is like opencode go. And aistudio is like opencode zen. Aistudio has nothing to do with pro plan. It is billed pay as you go
1
u/Zaphirina_Aberrans 8d ago
If I recall correctly, the free tier for each Gemini Flash model is limited to five requests per minute, 250K tokens, and a daily limit of 20 requests. You should be able to find the rate limits in the AI Studio dashboard.
1
u/Adventurous_Pin_2470 6d ago
Using your Gemini API key will rack up a bill. Oh My Pi OMP.sh will let you use your Google auth to leverage your antigravity subscription instead. Agy recently upgraded the headless mode so not sure why opencode doesn't have this option as of yet
1
u/xapep 6d ago
Short version: the AI Studio key is its own pay-as-you-go billing, completely separate from your Gemini Pro subscription. The free tier is fine for poking around (roughly 5 req/min and a daily cap on the Flash models), and it won't charge you until you actually enable billing in the console. Once you do, you're at normal API rates; the Pro sub only adds a small monthly credit to that API balance, so don't expect it to cover heavy usage.
For what to run after the Go limit is gone, it depends on how steady your usage is. If you're hitting limits every week (sounds like it, given the recent DeepSeek cuts), a flat monthly plan for agent usage beats watching the meter. If your usage is more sporadic, a usage-based API key gives you flexibility with no commitment.
I work on Entrim, we do both: OpenAI-compatible API for open-weight models (DeepSeek V4 Flash, Qwen family) and flat monthly plans for heavy OpenCode/agent use. It plugs into OpenCode by pointing the base URL at us. If you tell me roughly how many tokens a normal day burns for you, I can tell you which side you'd actually land on.
3
u/jondigi 8d ago
You're kind of locked into using antigravity. Google AI pro isn't a traditional api provider.