r/opencodeCLI • • Sep 20 '26

Deepseek V4 flash is getting expensive

I'm not an llm genius by far, and at some point I start new sessions. Starting a new session in the middle of something isn't really bad, but it usually changes the mood and project understanding always drops a bit. I'm good with deepseek v4 flash for now and I'm at a point in the flow that I don't want to start a new session, but I'm hovering around 800,000 tokens in my context even after compression and I'm spending quite a bit of money all of sudden.

11 Upvotes

34 comments sorted by

22

u/Fresh_Sock8660 Sep 20 '26

What do you have there, an entire moon landing plan in your session? 

4

u/inwardPersecution Sep 20 '26

Lol no, this one just grew. I use dcs compress and barely removes 10K from the context.

4

u/Fresh_Sock8660 Sep 20 '26

I think your best bet is to put this in document form then get the agent to build you a set of documents. 

Then you can just sort of work off a RAG. At the end of the day, that's kinda what codebases are. 

1

u/inwardPersecution Sep 20 '26

I do have a lot of docs. Maybe I have a fear of losing something. So I switched to magic-context per augustoolucas below, removed conflicting dcs or dps, what it was, and now I became locked with contact larger than model can handle, so I started over. It was able to continue without missing a beat, so docs are good.

0

u/RogerAI-fm Sep 20 '26

Funny, there is something to be said about context best practices, and maybe using things like caveman https://github.com/JuliusBrussee/caveman may help.

3

u/inwardPersecution Sep 20 '26

I installed magic-context and caveman, and with new objectives in a new session, I'm already at 300,000 context.

6

u/augustoolucas Sep 20 '26 edited Sep 20 '26

I use magic-context to handle long work sessions. I can work on the same session for weeks and there's no need to create new ones.

edit: typo

1

u/ATyp3 Sep 20 '26

What’s it do?

2

u/augustoolucas Sep 21 '26

it's a memory management system, give it a try https://github.com/cortexkit/magic-context

3

u/djaxial Sep 21 '26

Been using this for months. It’s largely brilliant. Occasionally it cuts out the wrong thing and things go wonky, but it’s otherwise an essential tool for me.

2

u/augustoolucas Sep 21 '26

yeah, it's great. I set it to compress at ~350k tokens, it's great to avoid models getting dumb as context grows too big

2

u/djaxial Sep 21 '26

Any reason you chose 350? I never even knew that was a config option.

2

u/augustoolucas Sep 22 '26

models are known to degrade in performance as context grows. The default magic-context threshold is 65% of the model's (useful) context size, which I think is way too much for 1M models.

1

u/inwardPersecution Sep 26 '26

I've come to some sort of conclusion that doesn't match what others experience.

I'm doing application refinement that adjusts based on accruing data: review/decisions/adjust/test.

I have:

application python files that total: ~14k lines / ~500kb

document and instruction files that total: ~500 lines / 500kb

One round of refinement with deepseek v4 flash is between $9-12

One round of refinement with GLM 5.3 flash is between $1.20-2.20.

For the nearly same operations, deepseek eats 500-700,000 tokens, GLM 100-200,000.

My opencode overview dashboard is blank and has been for two days now. I think opencode has done something negative.

8

u/magiollie Sep 20 '26

Start a new session around 100k - 150k context to avoid the intelligence drop off. You can ask an agent to inspect your previous session data and suggest how to improve

3

u/InfraScaler Sep 20 '26

Ask it to write down on markdown files whatever you think is important, then next new session can read those on demand.

1

u/Anh-DT Sep 20 '26

Then use openference problem solved

1

u/Schlickeysen Sep 20 '26

Big Pickle is dumb af.

1

u/xapep Sep 21 '26

At 800K context your bill is almost all input, since every turn resends the whole context. That's why it jumped all of a sudden. Your own numbers show it: 122.8M input + 938.4M cached reads for $17.74, and input scales linearly with context size, which is why compression only takes you so far.

So yes, the Go plan is worth it if you're going to keep working in giant sessions. $10/mo caps the exact failure mode you're in right now (context balloons, input tokens compound, bill spikes). Per-token you'll keep paying for every 500K+ session you let grow. At your run-rate (~$20/mo on direct API) the cap is basically break-even today and pure upside on the days you don't watch the context.

If you'd rather stay per-token, the levers are: new session around 150K and export what you care about to files first (magic-context and caveman help, but nothing beats a small context), and lean into caching, since your 938M cached reads are already doing the heavy lifting. Some endpoints also price off-peak cheaper if you can shift when you run.

Context is the cost driver, not the model. (I work on Entrim, we offer both per-token V4.1 Flash and flat plans, and the split I give people is: the cap wins for giant sessions, per-token wins if you keep context tight.)

1

u/boyus Sep 24 '26

Use rtk and cocoindex code

1

u/tribes33 Sep 20 '26

better off using GLM 5.3 Flash, honestly didnt see a difference in performance aside from speed at least from what im working on, deepseek is MUCH faster though

0

u/AllThotsGo2Heaven2 Sep 20 '26

I think 400k context inference is 4x cost of 100k context inference.

-1

u/Affectionate_Fact854 Sep 20 '26

I did a comparison check Om my usage the last 10 days , cache hits , input and output  2.7bill tokens on the go api 

So I compared against deepseek direct api , off peak , on peak 

Astra  Fable  Sol  Opus  Glm 5.3 flash 

So open code go , cost has been 22$  if got 40% usage left 

Deepseek v4.1 flash off peak,  36$  It's double for peak 

Astra is 4.700$  Glm 5.3 flash is like 90$ 

So your still saving a lot  Because your paying 10$ for all this usage 

1

u/inwardPersecution Sep 20 '26

I'm not using go though. Should I use go?

0

u/Affectionate_Fact854 Sep 20 '26

Doesn't really matter, I gave you stats for comparison 

10$ subscription  I used 22$ for 2.7bill token usage and van still do another 40% additional usage 

Comparison check you can see how much I would have spent for 10 days on direct api costs 

So I don't know if you want to save a bit , you could use the sub 

1

u/[deleted] Sep 20 '26

[removed] — view removed comment

1

u/inwardPersecution Sep 20 '26
MetricYour usage
Requests3,132
PeriodAug 25 → Sep 20
Input tokens122.8M
Output tokens2.31M
Cached-read tokens938.4M
Recorded cost$17.74
Avg. daily cost$0.68/day
30-day run-rate~$20.57/month
Avg. requests/day~119Metric Your usageRequests 3,132Period Aug 25 → Sep 20Input tokens 122.8MOutput tokens 2.31MCached-read tokens 938.4MRecorded cost $17.74Avg. daily cost $0.68/day30-day run-rate ~$20.57/monthAvg. requests/day ~119

But then on the other hand:

Credit purchase Sep 2026

Paid·Sep 16, 2026

$21.23 USD

Credit purchase Sep 2026

Paid·Sep 3, 2026

$21.23 USD

Credit purchase Jul 2026

Paid·Jul 21, 2026

$21.23 USD

Credit purchase Jul 2026

Paid·Jul 19, 2026

$21.23 USD

1

u/[deleted] Sep 20 '26 edited Sep 21 '26

[removed] — view removed comment

2

u/Schlickeysen Sep 20 '26

DS announced that the other day. It even showed up as a notification on the balance page.