Official Codebase of 3DCodeVerse
Python
pricing: gpt-6-astra, with its >272k-token tier
gaoypeng82bcc59100e2
diff --git a/harness/codeverse3d/models/pricing.py b/harness/codeverse3d/models/pricing.pyindex fca03d4e..32c3e600 100644--- a/harness/codeverse3d/models/pricing.py+++ b/harness/codeverse3d/models/pricing.py@@ -6,7 +6,7 @@ report can say *which* price row produced a dollar and whether it was verified omerely inferred (``3dcode cost prices``).Only the standard (short-context) tier is modelled, **except** the documented->200k-prompt tiers of the Gemini pro models, which ``estimate_cost`` applies+long-prompt tiers of Gemini pro and GPT-6 Astra, which ``estimate_cost`` appliesautomatically (``Price.long_context``). Cache *storage* fees (Gemini explicitcaching, $/1M-tokens/hour), Anthropic 1h-cache writes, batch/flex discounts,data-residency and fast-mode multipliers are **not** modelled — see@@ -146,6 +146,12 @@ PRICES: dict[tuple[str, str], Price] = {("anthropic", "claude-haiku-3-5"): Price(0.80, 4.00, 0.08, cache_write=1.00,note="retired except on Bedrock / Google Cloud"),# ---------------------------------------------------------------- openai+ ("openai", "gpt-6-astra"): Price(10.00, 50.00, 1.00, cache_write=12.50,+ long_context=LongContext(272_000, 20.00, 75.00, 2.00),+ checked="2026-09-23",+ note="Standard rates: developers.openai.com/api/docs/models/gpt-6-astra; "+ ">272k input uses 2x input/cache and 1.5x output. "+ "CLI aggregate usage is a notional estimate, not per-request billing."),# gpt-5.6-sol is CHEAPER than gpt-5.6 (was priced as its equal until 2026-08-23).("openai", "gpt-5.6-sol"): Price(4.00, 20.00, 0.40,note="4.00/20.00/0.40; was 5.00/30.00/0.50 here until 2026-08-23"),diff --git a/harness/tests/models/test_pricing.py b/harness/tests/models/test_pricing.pyindex 8d465087..b7fc324e 100644--- a/harness/tests/models/test_pricing.py+++ b/harness/tests/models/test_pricing.py@@ -7,7 +7,7 @@ import loggingimport pytestfrom codeverse3d.contracts.common import Usage-from codeverse3d.models.pricing import PRICES, estimate_cost, lookup_price+from codeverse3d.models.pricing import PRICES, estimate_cost, lookup_price, unit_pricesdef test_gemini_cost_math():@@ -18,6 +18,14 @@ def test_gemini_cost_math():assert abs(estimate_cost("gemini", "gemini-3.7-flash", u) - (0.45 + 0.03 + 0.5625)) < 1e-9+def test_astra_prices_cached_input_reasoning_and_its_strict_long_prompt_tier():+ """A live codex pilot ran gpt-6-astra unpriced (2026-09-23)."""+ usage = Usage(input_tokens=100_000, cached_tokens=80_000, output_tokens=4_000, thoughts_tokens=6_000)+ assert estimate_cost("openai", "gpt-6-astra", usage) == pytest.approx(.78)+ assert unit_prices("openai", "gpt-6-astra", prompt_tokens=272_000) == (10, 1, 50)+ assert unit_prices("openai", "gpt-6-astra", prompt_tokens=272_001) == (20, 2, 75)++@pytest.mark.parametrize(("provider", "model", "row"),[@@ -32,6 +40,7 @@ def test_gemini_cost_math():# agy's effort-suffixed ids (every agy session was priced $0 until 2026-09-23)("gemini", "gemini-3.7-flash-medium", "gemini-3.7-flash"),("gemini", "gemini-3.7-flash-high", "gemini-3.7-flash"),+ ("openai", "gpt-6-astra-2026-09-01", "gpt-6-astra"),],)def test_a_dated_or_tagged_id_prices_on_its_family_row(provider, model, row):@@ -45,6 +54,7 @@ def test_a_dated_or_tagged_id_prices_on_its_family_row(provider, model, row):("openai", "gpt-5.7"), # ".7" is a different minor version, not a date tag("gemini", "gemini-3.7-flash-lite"),("anthropic", "claude-opus-5-turbo"),+ ("openai", "gpt-6-astra-mini"),],)def test_a_different_family_is_unpriced_and_warned(provider, model, caplog):