How to estimate AI token cost for a 500-page pSEO project: A Field Guide for SaaS Founders

Difficulty: intermediate Time: 45-60 minutes

You're planning a programmatic SEO project to generate 500 landing pages for your SaaS product. You've heard the success stories and the horror stories, but right now you need a number: how much will the AI token costs actually be? Not the agency's bundled price with mystery markup, but the raw API expense you'll pay OpenAI, Anthropic, or whoever owns the model.

This guide walks you through the token math step by step. You'll learn how to count input tokens from your prompt template and data, estimate output tokens for each page type, account for retries and validation loops, and calculate a realistic budget range. By the end, you'll have a spreadsheet formula and enough context to avoid the two most common mistakes: underestimating output tokens by 3x, and forgetting that failed generations still cost money.

Before you start

  1. Step 1: Count your base prompt tokens

    Your prompt template is the instruction you'll send with every API request. It includes your system message, the task description, formatting rules, and any examples you provide. Open your prompt in a text editor and paste it into a token counter. If you're using OpenAI models, use the tiktoken library or an online tool that supports the specific model's tokenizer. Claude models use a different tokenizer, so check Anthropic's documentation.

    For a typical pSEO prompt that includes instructions, a JSON schema for output, and one example page, expect between 800 and 2,000 tokens. If your prompt includes multiple examples or a long style guide, you might hit 3,000-4,000 tokens. Write down this number as your base prompt cost.

    Now add the variable data tokens. For each page, you'll inject data from your dataset: a city name, a product feature, a comparison pair, or whatever makes each page unique. Count the tokens in a representative data row. A simple template variable like 'city: Austin, state: Texas, population: 961,855' might be 15-30 tokens. A richer dataset with descriptions, lists, or JSON objects could be 100-200 tokens per page. Add this to your base prompt to get your total input tokens per page.

    Multiply your per-page input tokens by 500 to get your total input token count. This is the smaller half of your cost, but it's the easier half to predict. Input tokens are typically priced lower than output tokens, often by a factor of three to ten depending on the model.

  2. Step 2: Estimate output tokens per page

    Output tokens are where most founders underestimate. You need to predict how many tokens the model will generate for each page. Start by writing one page manually or generating a single example with your prompt. Paste the full output into your token counter. Include everything: the HTML, the meta tags, the body content, any JSON or structured data.

    For a minimal landing page with 300-500 words of body content, basic meta tags, and simple HTML structure, expect 800-1,200 output tokens. A richer page with 800-1,000 words, multiple sections, a FAQ block, and schema markup will run 1,500-2,500 tokens. If you're generating long-form content with 1,500+ words, code examples, or tables, you could hit 3,000-5,000 tokens per page.

    Now account for variability. The model won't generate exactly the same token count for every page. Some topics will trigger longer explanations, some data rows will produce more list items, and some pages will hit edge cases that make the model verbose. Add a 20-30% buffer to your average output token count. If your test page was 1,200 tokens, budget for 1,500 tokens per page in your estimate.

    Multiply your buffered output token count by 500 pages. This is your total output token budget. Check your model provider's pricing page for the current output token rate. Remember that output tokens cost significantly more than input tokens. For GPT-4 class models, output tokens can be ten times the price of input tokens. For smaller models like GPT-3.5 or Claude Haiku, the ratio is smaller but still present.

  3. Step 3: Account for retries and validation failures

    Your first API call won't always produce a usable page. The model might generate invalid JSON, skip required fields, hallucinate links, or produce content that fails your quality checks. Each failed generation still costs tokens. You need to budget for retries.

    Start by estimating your expected failure rate. If you have a well-tested prompt with strict output formatting and you're using a reliable model like GPT-4 or Claude Opus, you might see a 5-10% failure rate on the first attempt. If your prompt is loose, your validation is strict, or you're using a smaller model, expect 15-25% failures. If you're doing multi-step generation with validation between steps, your cumulative failure rate could be higher.

    For each failed generation, you'll typically retry with the same input tokens but fresh output tokens. Some retry strategies include the previous failed output in the new prompt to guide the model, which adds more input tokens. Calculate your retry cost by multiplying your per-page token cost by your failure rate. If a single page costs 2,000 input tokens and 1,500 output tokens, and you have a 10% failure rate, add 200 input tokens and 150 output tokens per page to your budget.

    Now consider validation loops. If you're checking schema validity, link integrity, or content quality with automated tools, some pages might fail multiple times before passing. Budget for an average of 1.1 to 1.3 generations per page depending on your validation strictness. This means your 500-page project might actually require 550-650 API calls. Multiply your per-page token cost by this multiplier to get your true token budget.

  4. Step 4: Calculate total cost with provider-specific pricing

    Now you have three numbers: total input tokens, total output tokens, and a retry multiplier. Visit your model provider's pricing page. Do not rely on cached pricing from blog posts or documentation that's more than a few months old. Prices change, models get deprecated, and new tiers get introduced.

    For OpenAI models, pricing is typically listed per million tokens. GPT-4 Turbo and GPT-4o have different rates, and the latest models often cost less than older versions. For Anthropic's Claude models, pricing is also per million tokens, with Opus, Sonnet, and Haiku at different price points. Note whether the pricing page lists separate rates for input and output tokens or a blended rate.

    Calculate your input cost by dividing your total input tokens by one million, then multiplying by the input token rate. Do the same for output tokens with the output token rate. Add the two together to get your base generation cost. Then multiply by your retry multiplier to get your total estimated cost.

    As an example calculation: if you have 500 pages, each with 1,500 input tokens and 2,000 output tokens, with a 1.2x retry multiplier, you have 900,000 input tokens and 1,200,000 output tokens after retries. If input tokens cost a certain amount per million and output tokens cost more, you can calculate the total by checking the current rates on your provider's page. Add a 10-15% contingency buffer for unexpected edge cases, prompt iterations during the first batch, or data quality issues that require regeneration.

  5. Step 5: Compare model tiers and run a cost-benefit analysis

    You now have a cost estimate for one model. Before you commit, compare at least two model tiers. Generate the same test page with a frontier model like GPT-4 or Claude Opus, then with a smaller model like GPT-3.5 Turbo or Claude Haiku. Count the output tokens for both and check the quality.

    Smaller models often generate shorter, less detailed content. If your GPT-4 page is 2,000 tokens and your GPT-3.5 page is 1,200 tokens, the smaller model might cost a fraction of the price per page, but the content might lack depth, miss nuance, or require more retries due to formatting errors. Calculate the cost per page for both models, then evaluate whether the quality difference justifies the price difference.

    For a 500-page project, the cost difference between model tiers can be substantial. A project that costs several hundred dollars with a frontier model might cost under a hundred with a smaller model. But if the smaller model produces content that doesn't rank, doesn't convert, or requires manual editing for 30% of pages, the labor cost will exceed the token savings.

    Run a hybrid strategy if your pages have variable complexity. Use a frontier model for your high-value, high-traffic pages and a smaller model for long-tail pages with lower expected traffic. Or use a smaller model for first-draft generation, then use a frontier model for a refinement pass on pages that fail quality checks. Calculate the blended cost for your hybrid approach and compare it to the single-model cost.

    Document your cost estimate in a spreadsheet with columns for model name, input tokens, output tokens, retry multiplier, per-page cost, and total project cost. This becomes your budget baseline. When you run the actual generation, track your real costs against this estimate. If you're off by more than 20%, investigate whether your prompt changed, your data was messier than expected, or your retry rate was higher than planned.

  6. Step 6: Build a cost monitoring system for ongoing projects

    Your initial estimate is a snapshot, but a 500-page project will take days or weeks to complete. You need a way to track actual costs as you generate pages. Most model providers offer usage dashboards that show daily or hourly token consumption. Check your dashboard after the first 50 pages and compare the actual cost to your estimate.

    If your actual cost is higher than expected, identify the cause. Are your output tokens longer than predicted? Is your retry rate higher than 10%? Are you running extra validation passes that regenerate content? Adjust your process or your budget before continuing. If your actual cost is lower, you have room to improve quality by using a better model, adding more examples to your prompt, or running additional quality checks.

    For projects that will generate pages over time, not in a single batch, set up cost alerts. OpenAI and Anthropic both offer spending limits and email alerts when you hit certain thresholds. Set an alert at 50% and 80% of your estimated budget so you can pause and review before you overspend.

    Log each generation with metadata: page ID, input tokens, output tokens, retry count, and whether the page passed validation. Export this log to a spreadsheet or database. Calculate running averages for tokens per page and cost per page. If you see drift over time, it might indicate data quality issues in later batches, prompt changes, or model behavior changes.

    Finally, calculate your cost per visitor or cost per conversion. If your 500-page project costs a certain amount in tokens and generates a certain amount of traffic over six months, you can calculate the cost per visitor. If those visitors convert to trials or sales, you can calculate the cost per conversion. This metric tells you whether your token spend was a good investment and informs your budget for future pSEO projects.

Conclusion

You now have a method to estimate AI token costs for any pSEO project, not just a 500-page one. The core principles apply to 50 pages or 5,000 pages: count your input tokens, estimate your output tokens with a buffer, account for retries, and compare model tiers. The difference between a realistic estimate and a blown budget is usually in the details you measured: actual output token counts from test generations, realistic retry rates from validation logs, and current pricing from provider dashboards.

Your next step is to generate a 10-page test batch with your chosen model and prompt. Measure the real token usage and compare it to your estimate. If the numbers match within 20%, you're ready to scale. If they don't, adjust your prompt, your data, or your model choice before committing to the full 500 pages. Token costs are predictable if you measure, but they're expensive if you guess.

Troubleshooting

My actual output tokens are 2x higher than my test page predicted

Check if your test page used minimal data or a simpler topic than your production dataset. Generate five random pages from your dataset and average their token counts. Also check if your prompt includes conditional logic that triggers longer output for certain data types.

My retry rate is over 30% and blowing my budget

Your prompt is either too loose or your validation is too strict. Add explicit formatting instructions and examples to your prompt. If you're validating JSON schema, make sure your schema matches what the model naturally produces. Consider relaxing non-critical validation rules or using a two-pass approach: generate with loose validation, then refine failures with a second model call.

I can't find token pricing for my model on the provider's website

Check the API documentation or pricing page for your specific model name. Some providers list pricing under different sections for different model families. If you're using a fine-tuned model, pricing might be custom. Contact the provider's support or check your account dashboard for usage-based pricing details.

My cost per page varies wildly between batches

You likely have data quality issues or outliers in your dataset. Some rows might have much longer text fields, nested data structures, or special characters that increase token counts. Filter your dataset for outliers and either normalize them or generate them separately with a different prompt optimized for complex data.

I want to use prompt caching but don't know how it affects cost

Prompt caching reduces the cost of repeated input tokens by storing the static parts of your prompt. Check your provider's documentation for caching-enabled models and pricing. Typically, cached tokens cost a fraction of regular input tokens. Restructure your prompt so the static instructions come first and the variable data comes last to maximize cache hits.