Skip to content

feat(models): add GPT-5.6 (sol/terra/luna) pricing and metadata - #32659

Merged
shin-berri merged 3 commits into
litellm_internal_stagingfrom
litellm_gpt_5_6_rollout
Jul 9, 2026
Merged

feat(models): add GPT-5.6 (sol/terra/luna) pricing and metadata#32659
shin-berri merged 3 commits into
litellm_internal_stagingfrom
litellm_gpt_5_6_rollout

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Relevant issues

Linear ticket

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review (Greptile reviews automatically once the PR is opened; only comment @greptileai to re-request a review after pushing changes)

Screenshots / Proof of Fix

Captured at commit 1f6e8640ce

A live completion against the real OpenAI API wasn't possible at capture time: GPT-5.6 is rolling out globally over roughly 24 hours, so GET https://api.openai.com/v1/models/gpt-5.6 (and -sol) still return 404 for this account even with a valid key, and a chat request 404s upstream. The end-user-visible behavior this PR actually changes is the pricing and capability metadata the gateway resolves and serves, so the proof is a real litellm proxy on localhost:4000 booted with the updated cost map, queried over HTTP with no mocks. A live completion was re-run once the account gained 5.6 access; see the update at the end of this section

Boot:

OPENAI_API_KEY=... LITELLM_LOCAL_MODEL_COST_MAP=True \
  uv run python litellm/proxy/proxy_cli.py --config gpt56_proof_config.yaml --port 4000

curl -s http://localhost:4000/model/info (summarized) returns the new entries with the pricing and metadata from this PR:

gpt-5.6 -> openai/gpt-5.6
  input/out per tok: 5e-06 / 3e-05
  cache read/write : 5e-07 / 6.25e-06
  >272k in/out     : 1e-05 / 4.5e-05
  max_in/max_out   : 1050000 / 128000
  reasoning/vision/web: True True True
gpt-5.6-sol -> openai/gpt-5.6-sol
  input/out per tok: 5e-06 / 3e-05
  cache read/write : 5e-07 / 6.25e-06
  >272k in/out     : 1e-05 / 4.5e-05
  max_in/max_out   : 1050000 / 128000
  reasoning/vision/web: True True True
gpt-5.6-terra -> openai/gpt-5.6-terra
  input/out per tok: 2.5e-06 / 1.5e-05
  cache read/write : 2.5e-07 / 3.125e-06
  >272k in/out     : 5e-06 / 2.25e-05
  max_in/max_out   : 1050000 / 128000
  reasoning/vision/web: True True True
gpt-5.6-luna -> openai/gpt-5.6-luna
  input/out per tok: 1e-06 / 6e-06
  cache read/write : 1e-07 / 1.25e-06
  >272k in/out     : 2e-06 / 9e-06
  max_in/max_out   : 1050000 / 128000
  reasoning/vision/web: True True True

The cache-write rate is 1.25x the uncached input rate for every tier, the long-context (>272K) rate is 2x input and 1.5x output, and the alias gpt-5.6 matches gpt-5.6-sol, all as intended

Update, captured at commit 594c61bc86: the account now has GPT-5.6 access, so here is the fully live end-to-end proof, hitting the real OpenAI API through the proxy with no mocks and costing real $. Same boot command as above; one completion per model, printing the message content, token usage, and the proxy's x-litellm-response-cost header:

for m in gpt-5.6 gpt-5.6-sol gpt-5.6-terra gpt-5.6-luna; do
  curl -sD headers.txt http://localhost:4000/v1/chat/completions \
    -H 'Authorization: Bearer sk-1234' -H 'Content-Type: application/json' \
    -d "{\"model\": \"$m\", \"messages\": [{\"role\": \"user\", \"content\": \"Reply with exactly: hello from $m\"}]}" \
    | jq -c '{model, content: .choices[0].message.content, prompt_tokens: .usage.prompt_tokens, completion_tokens: .usage.completion_tokens}'
  grep -i '^x-litellm-response-cost:' headers.txt
done

Output:

{"model":"gpt-5.6","content":"hello from gpt-5.6","prompt_tokens":18,"completion_tokens":11}
x-litellm-response-cost: 0.00042
{"model":"gpt-5.6-sol","content":"hello from gpt-5.6-sol","prompt_tokens":19,"completion_tokens":12}
x-litellm-response-cost: 0.000455
{"model":"gpt-5.6-terra","content":"hello from gpt-5.6-terra","prompt_tokens":20,"completion_tokens":13}
x-litellm-response-cost: 0.000245
{"model":"gpt-5.6-luna","content":"hello from gpt-5.6-luna","prompt_tokens":20,"completion_tokens":13}
x-litellm-response-cost: 9.8e-05

Every cost matches this PR's rates exactly: luna is 20 x 1e-06 + 13 x 6e-06 = 9.8e-05, terra is 20 x 2.5e-06 + 13 x 1.5e-05 = 0.000245, sol is 19 x 5e-06 + 12 x 3e-05 = 0.000455, and the bare gpt-5.6 alias prices at the sol rates as intended (18 x 5e-06 + 11 x 3e-05 = 0.00042)

Type

🆕 New Feature

Changes

Day 0 support for OpenAI's GPT-5.6 family in the model cost map. Adds gpt-5.6, gpt-5.6-sol, gpt-5.6-terra, and gpt-5.6-luna to both model_prices_and_context_window.json and the bundled litellm/model_prices_and_context_window_backup.json, so cost tracking, context-window enforcement, and capability flags work with no code changes. The bare gpt-5.6 alias mirrors the flagship gpt-5.6-sol tier

No transformation code was needed. OpenAIGPT5Config.is_model_gpt_5_model already routes anything matching gpt-5.* through the GPT-5 reasoning path, and is_model_gpt_5_4_plus_model parses the version numerically so 5.6 lands on the 5.4-or-newer side that auto-switches to the /v1/responses bridge when tools are combined with reasoning_effort

Pricing follows OpenAI's published rates (per 1M tokens, standard tier):

  • sol: $5 input, $30 output, $0.50 cached input, $6.25 cache write
  • terra: $2.50 input, $15 output, $0.25 cached input, $3.125 cache write
  • luna: $1 input, $6 output, $0.10 cached input, $1.25 cache write

Each entry carries the full tier matrix the cost calculator understands: the standard, Flex, Batch, and Priority service tiers, plus the above-272K-token long-context variants for input, output, and cache read. Cache writes are new for this family and are billed at 1.25x the uncached input rate, encoded as cache_creation_input_token_cost (with _above_272k_tokens, _flex, and _priority variants). The family shares a 1,050,000-token input window, 128,000-token max output, reasoning support, web search, vision, structured outputs, and the 10% regional-processing uplift that applies to models released on or after March 5, 2026

Reasoning-effort flags mirror GPT-5.5 (OpenAI's guide states GPT-5.5 prompting guidance carries over to GPT-5.6): none and xhigh supported, minimal not supported. The newer max reasoning effort and pro reasoning mode surfaced in the GPT-5.6 guide are follow-ups; they need transformation work and are out of scope here

Commit 594c61bc86 cleans three floating point representation artifacts in the luna cache-read rates flagged by Greptile, so the raw JSON now carries the intended 2e-07 and 5e-08 instead of values like 2.0000000000000002e-07

Scope is OpenAI only. azure_ai/gpt-5.6 variants can follow once Azure exposes the models

Tests

  • tests/test_litellm/test_gpt_5_6_model_metadata.py pins pricing, capability flags, endpoints, modalities, and provider routing for all four names, and asserts the main and backup maps stay in sync
  • test_generic_cost_per_token_gpt56 in test_llm_cost_calc_utils.py checks standard, long-context, and cache-write pricing flow through generic_cost_per_token
  • the is_model_gpt_5_model regression list and a new is_model_gpt_5_4_plus_model class both cover the gpt-5.6 family

Link to Devin session: https://app.devin.ai/sessions/93a883e6bc334fd4892564f4a2b14797
Requested by: @mateo-berri

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@mateo-berri mateo-berri self-assigned this Jul 9, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@greptile-apps

greptile-apps Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds day-0 pricing and capability metadata for the GPT-5.6 model family (gpt-5.6, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna) to both model_prices_and_context_window.json and its bundled backup, enabling cost tracking and context-window enforcement with no production code changes.

  • Pricing entries include the full tier matrix (standard, flex, batch, priority, above-272K long-context) and the new cache-write cost field (cache_creation_input_token_cost), with values that are mathematically consistent across all tiers and models.
  • Tests in test_gpt_5_6_model_metadata.py, test_llm_cost_calc_utils.py, and test_is_model_gpt_5_model.py cover pricing, capability flags, provider routing, and the is_model_gpt_5_4_plus_model classification; all tests use local files or mocked data with no network calls.
  • test_utils.py's schema validator is extended to accept the three new cache_creation keys (_above_272k_tokens, _flex, _priority) introduced by this family.

Confidence Score: 5/5

Safe to merge — changes are purely additive JSON data and matching tests with no production logic modifications.

The change is entirely confined to JSON cost-map entries and new/extended tests. All pricing multipliers are mathematically consistent, both cost-map files stay in sync, and no production code paths are modified.

No files require special attention.

Important Files Changed

Filename Overview
model_prices_and_context_window.json Adds four new GPT-5.6 model entries with complete pricing tiers; values are numerically consistent with the stated pricing rules (cache-write = 1.25x input, long-context input = 2x, long-context output = 1.5x)
litellm/model_prices_and_context_window_backup.json Mirror of main cost map; sync verified by the new test_gpt_5_6_backup_matches_main test
tests/test_litellm/test_gpt_5_6_model_metadata.py New test file verifying pricing, capability flags, endpoints, modalities, and provider routing for all four GPT-5.6 names; no network calls, reads local JSON files
tests/test_litellm/litellm_core_utils/llm_cost_calc/test_llm_cost_calc_utils.py Adds parametrized cost-calculation tests for gpt-5.6 family; uses LITELLM_LOCAL_MODEL_COST_MAP so no network calls are made
tests/test_litellm/llms/openai/test_is_model_gpt_5_model.py Extends GPT5_MODELS list with gpt-5.6 variants and adds a new TestOpenAIGPT5ConfigIsModelGpt54PlusModel class to exercise the version-gating logic; all pure unit tests
tests/test_litellm/test_utils.py Schema validator extended to accept the three new cache_creation cost keys; additive change that does not weaken existing validation

Reviews (2): Last reviewed commit: "fix: floating point entry errors" | Re-trigger Greptile

Comment thread model_prices_and_context_window.json Outdated
@emerzon

emerzon commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Can you please also add the Azure entries?

@mateo-berri
mateo-berri changed the base branch from litellm_internal_staging to main July 9, 2026 18:32
@mateo-berri
mateo-berri changed the base branch from main to litellm_internal_staging July 9, 2026 18:32
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

@mateo-berri

Copy link
Copy Markdown
Contributor

@emerzon thanks for the reminder. We're adding this in a follow-up

@shin-berri
shin-berri merged commit a874de6 into litellm_internal_staging Jul 9, 2026
55 checks passed
@shin-berri
shin-berri deleted the litellm_gpt_5_6_rollout branch July 9, 2026 18:51
@codspeed-hq

codspeed-hq Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing litellm_gpt_5_6_rollout (594c61b) with litellm_internal_staging (131aa05)1

Open in CodSpeed

Footnotes

  1. No successful run was found on litellm_internal_staging (0099c6b) during the generation of this report, so 131aa05 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

edelauna pushed a commit to edelauna/litellm that referenced this pull request Jul 22, 2026
…iAI#32659)

* feat(models): add GPT-5.6 (sol/terra/luna) pricing and metadata

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test: allow gpt-5.6 service-tier cache-write keys in model prices schema

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix: floating point entry errors

---------

Co-authored-by: mateo <mateo@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants