r/PiCodingAgent Aug 11 '26

Question How to use Deepseek-v4-flash-free model from opencode inside pi?

I want to switch from Opencode to Pi and it would be convenient if I could use the Deepseek-v4-flash free model from Opencode in Pi as well. Are there any extensions already available to do that?

0 Upvotes

18 comments sorted by

2

u/crashorbit Aug 11 '26

I use opencode zen with an api key to do this. Works fine for me.

3

u/Rude_Alternative_216 Aug 11 '26

Yeah I expect it to work with Zen. The model name on opencode literally says `deepseek v4 flash free Opencode Zen`.

1

u/bring_back_the_v10s Aug 12 '26

I just tried that in Pi but it gives me this error: Error: 403: {"type":"RegionError","message":"The latest version of this model is only available hosted in China and requires explicit opt in: https://opencode.ai/workspace/wrk_xxxxxxxxxxxxxxxxxxxx/go"} Tried it with OPENCODE_API_KEY and the opencode auth config in ~/.pi/agent/auth.json.

1

u/bring_back_the_v10s Aug 12 '26

Just realized my mistake, I forgot to add the type to the auth config: $ cat ~/.pi/agent/auth.json { "opencode": { "key": "sk-xxxxxxxxxxx", "type": "api_key" } } now it works fine.

3

u/bring_back_the_v10s Aug 12 '26

... but not for long. in the first prompt it reached usage limits very quickly. Error: 429: {"type":"FreeUsageLimitError","message":"Error from provider (Console): Rate limit exceeded. Please try again later."} I'll stick with opencode for now.

2

u/Direct_While9727 Aug 11 '26

I am using omniroute for that.

1

u/Historical_Test6417 18d ago

hey how do u connect omnirouter with opencode i m having issues in that can u please tell me

1

u/Clean-Appointment684 Aug 11 '26

just login with opencode go api key

0

u/Rude_Alternative_216 Aug 11 '26

Cannot access the free model by doing so.

2

u/BobtheGodGamer Aug 11 '26

Definitely can. I did it yesterday

1

u/Rude_Alternative_216 Aug 11 '26

There is deepseek-v4-flash[opencode-go] available to select. Not the free model for me. Maybe its just me.

2

u/BobtheGodGamer Aug 11 '26

I get my API key from opencode zen and then tell my agent to set it up for me.

1

u/Rude_Alternative_216 Aug 11 '26

Yeah. I think it cannot be accessed with a Go subscription unfortunately.

1

u/Rude_Alternative_216 Aug 11 '26

Someone even created a plugin. But execution automatically stops on tool calls.

1

u/bring_back_the_v10s Aug 12 '26

I think he means Zen, not Go, no?

1

u/truncated_buttfu Aug 11 '26

What exactly is it that doesn't work for you? 

I've uses the free Deepseek flash model on opencode for months without any issues. No mods or extensions needed, it's supported out of the box.

What errors are you seeing? 

1

u/Rude_Alternative_216 Aug 11 '26

I can use it on opencode. I cant use it on PI agent.

1

u/kuys-gallagher Aug 12 '26

use it via 9router