30 October 2026 EN ES
The AI Side Project

Weekend projects that quietly became businesses

Costs

Check your agent's context tier and fetch count before the next run

Run a quick pre-run audit of prompt size and fetch counts before scheduling a weekend agent.

Illustration: Check your agent's context tier and fetch count before the next run

A scheduled agent can cross a pricing threshold while the request still succeeds. Before you schedule it, count the prompt tokens and the expected fetches, because the bill is set by the billing tier the prompt lands in and the number of posts or profiles the tool pulls.

Run a short pre-run audit before the schedule starts. It keeps the bill from becoming a surprise invoice. It is a few minutes of work before the weekend. Most side projects stay side projects, but a scheduled agent can run while you are not watching. You are not trying to model every token perfectly, only to catch the few things that change the bill.

The base rate is the easy part

Grok 4.7 launched on September 21, 2026, with standard xAI API pricing starting at $2 per million input tokens and $6 per million output tokens. Those numbers are useful, but they do not tell you what a scheduled agent will pay when the prompt grows or the tool fetches content.

The base rates are the part you can remember. The rest of the bill depends on what the agent puts into the request and what the tool brings back. A short chat may stay cheap, while a scheduled job can quietly accumulate prompt and fetches every time it runs.

The long-context threshold is the real multiplier

Grok 4.7 has a 500,000-token context window and a May 2026 knowledge cutoff. That window sounds generous, but the pricing structure changes before the full window is used. Long-context billing begins when a request prompt exceeds 200,000 tokens. Once the prompt reaches that threshold, xAI applies long-context rates to every token in the request.

If your calls go to the US regional endpoint, grok-4.7 is billed at a 10% premium, with above-200,000-token prompt rates of $4.40 input, $1.10 cached input, and $13.20 output per million tokens. The threshold is easy to miss because the request can still succeed. The model has room to accept more text, but the price changes before the window fills. For a weekend agent, check the prompt size before the schedule starts, not after the bill arrives.

Fetch counts hide in thread expansion

The tool adds its own line to the bill. xAI's X Search bills each fetched item separately, counting every returned post, including parent and quoted posts from a thread fetch, and every returned profile.

The call count is the wrong number to watch. A thread fetch can return more posts than you expect, and a profile lookup can add a separate line item. The useful estimate is the returned item count, not the number of tool calls you made.

The audit takes a few minutes

Run this before you schedule the job.

  • Count the prompt tokens before adding fetched content, and note whether it crosses the long-context threshold.
  • If it does, price the whole request at long-context rates.
  • Estimate returned posts, including parent and quoted posts from thread fetches.
  • Estimate returned profiles separately.
  • Apply the X Search per-item fees: $5 per 1,000 posts fetched and $10 per 1,000 profiles fetched, effective September 21, 2026 at noon Pacific.
  • Check whether your endpoint adds a premium.
  • Trim context or cap fetches before scheduling.

If the estimate is close to the threshold, treat it as over and move fetched content out of the prompt or reduce the number of items the agent is allowed to pull. If the fetch count is high, narrow the query, skip profile lookups, or batch less often. If the estimate is low, let it run, but do a manual run before you enable the schedule and trim the query if the returned item count is higher than you expected.

Advertisement