{"version":"v1","resource":"prompt-compressor","updated":"2026-11-26","formula":{"savedTokens":"originalTokens − compressedTokens","savedPct":"savedTokens ÷ originalTokens × 100","savedPerRequestUsd":"savedTokens ÷ 1,000,000 × inputUSDPerMTok","monthlyRuns":"requestsPerDay × daysPerMonth","monthlySavingsUsd":"savedPerRequestUsd × monthlyRuns","annualSavingsUsd":"monthlySavingsUsd × 12"},"tokenizer":{"library":"gpt-tokenizer","version":"o200k_base","license":"MIT","exactFor":"OpenAI o200k-family models","estimateFor":"Claude, Gemini, DeepSeek and other vocabularies (within a few percent)","countsOutputTokens":false,"note":"Token counts cover the text only; chat message wrapper and provider-side tools are excluded."},"constants":{"daysPerMonth":30,"maxChars":200000,"modes":["safe","balanced","aggressive"],"modeRule":"safe: whitespace, Markdown decoration, link syntax; balanced: + pleasantries, filler, whole-input JSON/XML whitespace, duplicate long lines; aggressive: + articles, pronouns, auxiliaries, sentence punctuation (negations, modals and logical operators are preserved)","protectedSegments":["fenced code blocks","inline code","HTML/XML tags","single and double quoted strings","URLs","email addresses","{{template}} and ${template} variables","numbers, decimals and dotted identifiers"]},"defaults":{"mode":"balanced","requestsPerDay":5000,"daysPerMonth":30},"limits":{"maxChars":200000,"requestsPerDay":{"min":1,"max":1000000,"step":1},"daysPerMonth":{"min":28,"max":31,"step":1}},"models":[{"id":"openai/gpt-6.2-astra","label":"GPT-6.2 Astra","provider":"OpenAI","inputPerMTok":8,"outputPerMTok":40,"contextWindow":1050000,"tokenizer":"o200k"},{"id":"openai/gpt-6.2-sol","label":"GPT-6.2 Sol","provider":"OpenAI","inputPerMTok":2,"outputPerMTok":10,"contextWindow":1050000,"tokenizer":"o200k"},{"id":"openai/gpt-6.1-terra","label":"GPT-6.1 Terra","provider":"OpenAI","inputPerMTok":1,"outputPerMTok":5,"contextWindow":1050000,"tokenizer":"o200k"},{"id":"openai/gpt-6-luna","label":"GPT-6 Luna","provider":"OpenAI","inputPerMTok":0.1,"outputPerMTok":0.5,"contextWindow":1050000,"tokenizer":"o200k"},{"id":"anthropic/claude-sonnet-5.5","label":"Claude Sonnet 5.5","provider":"Anthropic","inputPerMTok":2,"outputPerMTok":10,"contextWindow":1000000,"tokenizer":"proxy"},{"id":"anthropic/claude-opus-5.5","label":"Claude Opus 5.5","provider":"Anthropic","inputPerMTok":4,"outputPerMTok":20,"contextWindow":1000000,"tokenizer":"proxy"},{"id":"anthropic/claude-haiku-5.5","label":"Claude Haiku 5.5","provider":"Anthropic","inputPerMTok":0.1,"outputPerMTok":0.5,"contextWindow":1000000,"tokenizer":"proxy"},{"id":"google/gemini-4-neon","label":"Gemini 4 Neon","provider":"Google","inputPerMTok":3,"outputPerMTok":15,"contextWindow":1048576,"tokenizer":"proxy"},{"id":"google/gemini-4-carbon","label":"Gemini 4 Carbon","provider":"Google","inputPerMTok":2,"outputPerMTok":10,"contextWindow":1048576,"tokenizer":"proxy"},{"id":"google/gemini-4-hydrogen","label":"Gemini 4 Hydrogen","provider":"Google","inputPerMTok":1.5,"outputPerMTok":7.5,"contextWindow":1048576,"tokenizer":"proxy"},{"id":"deepseek/deepseek-v4-pro","label":"DeepSeek V4 Pro","provider":"DeepSeek","inputPerMTok":0.82317,"outputPerMTok":1.5393,"contextWindow":1048576,"tokenizer":"proxy"},{"id":"deepseek/deepseek-v4.1-flash","label":"DeepSeek V4.1 Flash","provider":"DeepSeek","inputPerMTok":0.051,"outputPerMTok":0.567,"contextWindow":1048576,"tokenizer":"proxy"},{"id":"deepseek/deepseek-v3.2","label":"DeepSeek V3.2","provider":"DeepSeek","inputPerMTok":0.26,"outputPerMTok":0.38,"contextWindow":163840,"tokenizer":"proxy"},{"id":"meta-llama/llama-3.3-70b-instruct","label":"Llama 3.3 70B Instruct","provider":"Meta","inputPerMTok":0.59,"outputPerMTok":0.79,"contextWindow":131072,"tokenizer":"proxy"}],"pricingRetrieved":"2026-11-30","pricingSource":"OpenRouter Models API","pricingSourceUrl":"https://openrouter.ai/api/v1/models","examples":{"en":{"originalTokens":329,"modes":{"safe":{"compressedTokens":329,"savedTokens":0,"savedPct":0,"compressedText":"Please act as a careful data-extraction assistant for our accounts-receivable team. I would like you to read the customer email below and return one JSON object with the following fields: order_id, invoice_total, currency, due_date and line_items.\n\nCould you kindly follow these rules very carefully, because a wrong number creates a credit note and a manual review:\n- Copy the order_id exactly as it appears in the email. Do not change the letter case, do not add spaces, and do not normalize the hyphen.\n- If the invoice total is missing, please return null instead of guessing. It is much better to return null than to invent a number.\n- Keep the currency as a three-letter ISO code, even if the email writes euros or dollars in words.\n- Format the due date as YYYY-MM-DD, and never use a local date format.\n- Return line_items as an array. If there are no line items, return an empty array.\n- Copy the order_id exactly as it appears in the email. Do not change the letter case, do not add spaces, and do not normalize the hyphen.\n\nHere is the email:\n---\nHi team, thanks for the quick delivery. Our order A-10482 arrived on 3 May, but the invoice shows 1,240.50 EUR while the quote was 1,180.00 EUR. We also ordered 4 replacement filters at 12.00 EUR each. Please send a corrected invoice by 2026-06-15.\n---\n\nReturn only the JSON object, with no commentary and no markdown fences. Thank you so much for your help.","cost":{"originalTokens":329,"compressedTokens":329,"savedTokens":0,"savedPct":0,"inputPerMTok":2,"requestsPerDay":5000,"daysPerMonth":30,"monthlyRuns":150000,"monthlyTokensSaved":0,"savedPerRequestUsd":0,"monthlySavingsUsd":0,"annualSavingsUsd":0}},"balanced":{"compressedTokens":279,"savedTokens":50,"savedPct":15.19756838905775,"compressedText":"act as a careful data-extraction assistant for our accounts-receivable team. read the customer email below and return one JSON object with the following fields: order_id, invoice_total, currency, due_date and line_items.\n\nfollow these rules carefully, because a wrong number creates a credit note and a manual review:\n- Copy the order_id exactly as it appears in the email. Do not change the letter case, do not add spaces, and do not normalize the hyphen.\n- If the invoice total is missing, return null instead of guessing. It is much better to return null than to invent a number.\n- Keep the currency as a three-letter ISO code, even if the email writes euros or dollars in words.\n- Format the due date as YYYY-MM-DD, and never use a local date format.\n- Return line_items as an array. If there are no line items, return an empty array.\n\nHere is the email:\n---\nHi team, for the quick delivery. Our order A-10482 arrived on 3 May, but the invoice shows 1,240.50 EUR while the quote was 1,180.00 EUR. We also ordered 4 replacement filters at 12.00 EUR each. send a corrected invoice by 2026-06-15.\n---\n\nReturn only the JSON object, with no commentary and no markdown fences. for your help.","cost":{"originalTokens":329,"compressedTokens":279,"savedTokens":50,"savedPct":15.19756838905775,"inputPerMTok":2,"requestsPerDay":5000,"daysPerMonth":30,"monthlyRuns":150000,"monthlyTokensSaved":7500000,"savedPerRequestUsd":0.0001,"monthlySavingsUsd":15,"annualSavingsUsd":180}},"aggressive":{"compressedTokens":227,"savedTokens":102,"savedPct":31.00303951367781,"compressedText":"act as careful data-extraction assistant for our accounts-receivable team\nread customer email below and return one JSON object with following fields: order_id invoice_total currency due_date and line_items\nfollow rules carefully because wrong number creates credit note and manual review:\n- Copy order_id exactly as appears in email\nnot change letter case not add spaces and not normalize hyphen\n- If invoice total missing return null instead of guessing\nmuch better to return null than to invent number\n- Keep currency as three-letter ISO code even if email writes euros or dollars in words\n- Format due date as YYYY-MM-DD and never use local date format\n- Return line_items as array\nIf no line items return empty array\nemail:\n---\nHi team for quick delivery\nOur order A-10482 arrived on 3 May but invoice shows 1,240 50 EUR while quote 1,180 00 EUR\nWe also ordered 4 replacement filters at 12.00 EUR each\nsend corrected invoice by 2026-06-15\n---\n\nReturn only JSON object with no commentary and no markdown fences\nfor your help","cost":{"originalTokens":329,"compressedTokens":227,"savedTokens":102,"savedPct":31.00303951367781,"inputPerMTok":2,"requestsPerDay":5000,"daysPerMonth":30,"monthlyRuns":150000,"monthlyTokensSaved":15300000,"savedPerRequestUsd":0.000204,"monthlySavingsUsd":30.6,"annualSavingsUsd":367.20000000000005}}}},"zh":{"originalTokens":330,"modes":{"safe":{"compressedTokens":330,"savedTokens":0,"savedPct":0,"compressedText":"请帮我充当一个严谨的数据提取助手，为我们的应收账款团队服务。我想让你阅读下面的客户邮件，并返回一个 JSON 对象，字段包括 order_id、invoice_total、currency、due_date 和 line_items。\n\n如果可以的话，请务必严格遵循下面的规则，因为金额一旦出错就要开红字发票并人工复核：\n- order_id 必须原样复制，不要改变大小写，不要添加空格，也不要统一其中的连字符。\n- 如果发票金额缺失，请返回 null，不要猜测。返回 null 比编一个数字要好得多。\n- 币种使用三位 ISO 代码，即使邮件里写的是「欧元」或「美元」。\n- 日期格式统一为 YYYY-MM-DD，不要使用本地日期格式。\n- line_items 用数组返回；如果没有明细，就返回空数组。\n- order_id 必须原样复制，不要改变大小写，不要添加空格，也不要统一其中的连字符。\n\n邮件如下：\n---\n你好，货已经收到了，谢谢。我们的订单 A-10482 在 5 月 3 日到货，但发票金额是 1,240.50 EUR，报价单写的是 1,180.00 EUR。另外还订了 4 个替换滤芯，每个 12.00 EUR。请在 2026-06-15 前寄一份更正后的发票。\n---\n\n请只返回 JSON 对象，不要解释，也不要加 Markdown 代码围栏。非常感谢你的帮助。","cost":{"originalTokens":330,"compressedTokens":330,"savedTokens":0,"savedPct":0,"inputPerMTok":2,"requestsPerDay":5000,"daysPerMonth":30,"monthlyRuns":150000,"monthlyTokensSaved":0,"savedPerRequestUsd":0,"monthlySavingsUsd":0,"annualSavingsUsd":0}},"balanced":{"compressedTokens":288,"savedTokens":42,"savedPct":12.727272727272727,"compressedText":"充当一个严谨的数据提取助手，为我们的应收账款团队服务。阅读下面的客户邮件，并返回一个 JSON 对象，字段包括 order_id、invoice_total、currency、due_date 和 line_items。务必严格遵循下面的规则，因为金额一旦出错就要开红字发票并人工复核：\n- order_id 必须原样复制，不要改变大小写，不要添加空格，也不要统一其中的连字符。\n- 如果发票金额缺失，返回 null，不要猜测。返回 null 比编一个数字要好得多。\n- 币种使用三位 ISO 代码，即使邮件里写的是「欧元」或「美元」。\n- 日期格式统一为 YYYY-MM-DD，不要使用本地日期格式。\n- line_items 用数组返回；如果没有明细，就返回空数组。\n\n邮件如下：\n---\n你好，货已经收到了，我们的订单 A-10482 在 5 月 3 日到货，但发票金额是 1,240.50 EUR，报价单写的是 1,180.00 EUR。另外还订了 4 个替换滤芯，每个 12.00 EUR。在 2026-06-15 前寄一份更正后的发票。\n---\n\n只返回 JSON 对象，不要解释，也不要加 Markdown 代码围栏。你的帮助。","cost":{"originalTokens":330,"compressedTokens":288,"savedTokens":42,"savedPct":12.727272727272727,"inputPerMTok":2,"requestsPerDay":5000,"daysPerMonth":30,"monthlyRuns":150000,"monthlyTokensSaved":6300000,"savedPerRequestUsd":0.000084,"monthlySavingsUsd":12.6,"annualSavingsUsd":151.2}},"aggressive":{"compressedTokens":288,"savedTokens":42,"savedPct":12.727272727272727,"compressedText":"充当一个严谨的数据提取助手 为我们的应收账款团队服务 阅读下面的客户邮件 并返回一个 JSON 对象 字段包括 order_id invoice_total currency due_date 和 line_items 务必严格遵循下面的规则 因为金额一旦出错就要开红字发票并人工复核：\n- order_id 必须原样复制 不要改变大小写 不要添加空格 也不要统一其中的连字符\n- 如果发票金额缺失 返回 null 不要猜测 返回 null 比编一个数字要好得多\n- 币种使用三位 ISO 代码 即使邮件里写的是「欧元」或「美元」\n- 日期格式统一为 YYYY-MM-DD 不要使用本地日期格式\n- line_items 用数组返回 如果没有明细 就返回空数组\n邮件如下：\n---\n你好 货已经收到了 我们的订单 A-10482 在 5 月 3 日到货 但发票金额是 1,240 50 EUR 报价单写的是 1,180 00 EUR 另外还订了 4 个替换滤芯 每个 12.00 EUR 在 2026-06-15 前寄一份更正后的发票\n---\n\n只返回 JSON 对象 不要解释 也不要加 Markdown 代码围栏 你的帮助","cost":{"originalTokens":330,"compressedTokens":288,"savedTokens":42,"savedPct":12.727272727272727,"inputPerMTok":2,"requestsPerDay":5000,"daysPerMonth":30,"monthlyRuns":150000,"monthlyTokensSaved":6300000,"savedPerRequestUsd":0.000084,"monthlySavingsUsd":12.6,"annualSavingsUsd":151.2}}}}},"sources":[{"label":"gpt-tokenizer — BPE tokenizer for o200k_base and cl100k_base (MIT)","url":"https://github.com/niieani/gpt-tokenizer"},{"label":"OpenAI — tokenizer tool and token guidance","url":"https://platform.openai.com/tokenizer"},{"label":"OpenRouter — Models API (price snapshot source)","url":"https://openrouter.ai/api/v1/models"},{"label":"LLMLingua — prompt compression research (arXiv 2310.05736)","url":"https://arxiv.org/abs/2310.05736"},{"label":"Anthropic — effective context engineering for AI agents","url":"https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents"},{"label":"OpenAI — API pricing","url":"https://platform.openai.com/docs/pricing"},{"label":"Anthropic — API pricing","url":"https://www.anthropic.com/pricing"},{"label":"Google — Gemini API pricing","url":"https://ai.google.dev/gemini-api/docs/pricing"}],"calculators":{"en":"https://www.sogoh.com/tools/prompt-compressor/","zh":"https://www.sogoh.com/zh/tools/prompt-compressor/"},"license":"Free to reuse with attribution and a link to the source page."}