SShortSingh.
Back to feed

One pasted file can raise a chatbot API call from $0.006 to $2.03

0
·4 views

A developer priced a typical support-bot request on Claude Sonnet 5.5 at about $0.006, but the same endpoint will accept a request costing $2.03 when a user pastes a large file. Costs are billed per token, and the worst case is set by the context window size multiplied by input prices, plus the output cap. Common triggers include users pasting log files, bugs repeatedly appending documents to prompts, and search steps passing whole files. Token counts also vary by content, with logs producing far more tokens than the usual four-characters-per-token estimate. The analysis found that the cost multiplier tracks the context window rather than the per-token price, so upgrading to a larger-window model can raise the worst-case cost even while lowering the price per token.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Exposed CI build servers threaten credentials; Jenkins patches five Script Security sandbox escapes

Build servers such as JetBrains TeamCity and Jenkins hold deployment credentials, registry tokens, signing keys and repository write access, making them high-value targets. Internet scans on 23 October 2026 found 1,890 TeamCity instances on ZoomEye, with 792 served over TLS. On 16 September 2026, Jenkins disclosed five Script Security Plugin vulnerabilities, rated 8.8 or 7.5, that allow sandbox escapes by users permitted to run sandboxed scripts. Because such users can execute code on the controller if a sandbox gap exists, the article argues that limiting who holds pipeline-definition permissions and verifying plugin versions against advisories are key defenses. It also notes that incident reconstruction is hard by default, since build logs and agent output may not capture what the controller executed.

0
ProgrammingDEV Community ·

Team's Product Stalled at Two Daily Clicks, Prompting Shift to Post-Launch SEO Fixes

After their first product, Versely, received only about two Google clicks a day, the team focused on basic SEO repairs rather than launch-day promotion. They corrected canonical tags that were signaling search engines to ignore pages and rewrote titles to match real search queries. Over the following three months, Google impressions reportedly grew to 168,000. The team then packaged this approach into LaunchRanked, a tool offering a free weekly launch board, directory submission services, and AI visibility tracking. The post's author discloses they work on LaunchRanked.

0
ProgrammingDEV Community ·

Running many AI agents at once: the failure points that surface first

A dozen parallel agents sharing one codebase, database, and API budget create an operations problem more than a modeling one. The article expects collisions over shared files or rows, unchecked token spending from retry loops, and rate-limit errors that appear random when many agents hit them together. It also flags silent agent failures and drift when agents interpret a goal differently, and warns that reviewers can be overwhelmed as output outpaces human checking. The suggested remedies are isolated workspaces, per-agent budgets, queued and backed-off API calls, required status reports, and a single shared goal document. The author presents this as a checklist of anticipated problems rather than a measured study, and recommends scaling up only after a small setup runs reliably.

0
ProgrammingDEV Community ·

Five Email Scripts Freelancers Can Use to Decline Unpaid Scope Creep

Scope creep usually begins with small, informal requests from clients rather than one large change. The article argues that repeatedly agreeing to these add-ons can significantly reduce a freelancer's effective hourly rate. Instead of refusing outright, the author recommends offering a priced add-on or a later phase as an alternative. Five copy-ready email templates are provided for handling extra revisions, tying handoff to final payment, adjusting scope to fit a budget, and pausing projects with stalled assets. The piece also promotes the author's own calculator, a free cheat sheet, and paid resource packs.