Skip to content

Commit 3daf799

Browse files
Add verified GPT-5.6 Bedrock cache-write pricing (1.25x input rate)
OpenAI's own docs confirm the gap flagged in the DUX-11214 follow-up was real, not just unverified: "Cache writes have no additional fee on models before the GPT-5.6 family. For GPT-5.6 models and later model families, cache writes cost 1.25x the uncached input token rate." (https://developers.openai.com/api/docs/guides/prompt-caching) GPT-5.6 is the first OpenAI family billed for cache writes at all, which is why every other OpenAI entry in models.json has no cache_write_input_per_million field - that absence really is $0, not an omission. Add the field to the three hand-added openai.gpt-5.6-luna/-terra/-sol entries (7791056), computed as 1.25x each model's own input_per_million: Luna: 1.0 x 1.25 = 1.25 Terra: 2.5 x 1.25 = 3.125 Sol: 5.0 x 1.25 = 6.25 Update models_gpt_5_6_bedrock_spec.rb to assert the new rates and replace the "intentionally omitted, unverified" comment with the citation above. Also document a second, separate, still-open concern (not resolved here): OpenAI's developer community reported two GPT-5.6-specific usage-accounting bugs in July 2026 - a cached/cache-write double-counting bug OpenAI staff confirmed and refunded, and a seemingly still-open report of ~9x inflated output_tokens billing. We consume these models via Bedrock's mantle passthrough, not OpenAI's own API, so whether Bedrock reproduces either bug is unknown and unverified - flagged as an open risk to revisit. Co-authored-by: Sam Boland <sam.boland@appfolio.com>
1 parent af95b4b commit 3daf799

2 files changed

Lines changed: 35 additions & 18 deletions

File tree

lib/ruby_llm/models.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16814,7 +16814,8 @@
1681416814
"standard": {
1681516815
"input_per_million": 1.0,
1681616816
"output_per_million": 6.0,
16817-
"cache_read_input_per_million": 0.1
16817+
"cache_read_input_per_million": 0.1,
16818+
"cache_write_input_per_million": 1.25
1681816819
}
1681916820
}
1682016821
},
@@ -16841,7 +16842,8 @@
1684116842
"cost": {
1684216843
"input": 1.0,
1684316844
"output": 6.0,
16844-
"cache_read": 0.1
16845+
"cache_read": 0.1,
16846+
"cache_write": 1.25
1684516847
},
1684616848
"limit": {
1684716849
"context": 272000,
@@ -16880,7 +16882,8 @@
1688016882
"standard": {
1688116883
"input_per_million": 5.0,
1688216884
"output_per_million": 30.0,
16883-
"cache_read_input_per_million": 0.5
16885+
"cache_read_input_per_million": 0.5,
16886+
"cache_write_input_per_million": 6.25
1688416887
}
1688516888
}
1688616889
},
@@ -16907,7 +16910,8 @@
1690716910
"cost": {
1690816911
"input": 5.0,
1690916912
"output": 30.0,
16910-
"cache_read": 0.5
16913+
"cache_read": 0.5,
16914+
"cache_write": 6.25
1691116915
},
1691216916
"limit": {
1691316917
"context": 272000,
@@ -16946,7 +16950,8 @@
1694616950
"standard": {
1694716951
"input_per_million": 2.5,
1694816952
"output_per_million": 15.0,
16949-
"cache_read_input_per_million": 0.25
16953+
"cache_read_input_per_million": 0.25,
16954+
"cache_write_input_per_million": 3.125
1695016955
}
1695116956
}
1695216957
},
@@ -16973,7 +16978,8 @@
1697316978
"cost": {
1697416979
"input": 2.5,
1697516980
"output": 15.0,
16976-
"cache_read": 0.25
16981+
"cache_read": 0.25,
16982+
"cache_write": 3.125
1697716983
},
1697816984
"limit": {
1697916985
"context": 272000,

spec/ruby_llm/models_gpt_5_6_bedrock_spec.rb

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,30 @@
55
RSpec.describe RubyLLM::Models do
66
include_context 'with configured RubyLLM'
77

8-
# None of these three hand-added entries (see 7791056d) carry a
9-
# cache_write_input_per_million rate, matching every other OpenAI-family
10-
# model in models.json — no OpenAI model in this registry has that field
11-
# modeled. This is consistent with, but NOT independently verified
12-
# against, OpenAI/Bedrock pricing docs for GPT-5.6 specifically: whether
13-
# Bedrock charges a distinct (non-zero) cache-write rate for these models,
14-
# the way it does for Anthropic's cache_creation_input_per_million, is
15-
# unknown. Revisit if models.dev adds real entries for these ids, or if
16-
# OpenAI/AWS publish a documented cache-write rate for GPT-5.6.
8+
# cache_write is verified, not a placeholder: per OpenAI's own docs
9+
# (https://developers.openai.com/api/docs/guides/prompt-caching), "Cache
10+
# writes have no additional fee on models before the GPT-5.6 family. For
11+
# GPT-5.6 models and later model families, cache writes cost 1.25x the
12+
# uncached input token rate." GPT-5.6 is the first OpenAI family to charge
13+
# for cache writes at all, which is why it's the only OpenAI family in this
14+
# registry carrying a cache_write_input_per_million value — every other
15+
# OpenAI entry has none because the rate really is $0 for those models.
16+
#
17+
# Separately open (do NOT resolve here): OpenAI's developer community has
18+
# reported two GPT-5.6-specific usage-accounting bugs since launch (July
19+
# 2026) — one where cached_tokens + cache_write_tokens could nearly
20+
# double-count against prompt_tokens (OpenAI staff andyw1 confirmed this
21+
# and issued retroactive refunds), and a second, seemingly still-open one
22+
# alleging usage.output_tokens can be inflated ~9x by a reasoning-token
23+
# resummation bug, with the inflated figure being what's billed. We consume
24+
# these models via AWS Bedrock's mantle passthrough, not OpenAI's own API,
25+
# so it is unknown and unverified whether Bedrock's usage accounting
26+
# reproduces either bug or computes usage independently. Treat billed
27+
# Luna/Terra/Sol costs as an open risk until this is checked.
1728
{
18-
'openai.gpt-5.6-sol' => { input: 5.0, output: 30.0, cache_read: 0.5 },
19-
'openai.gpt-5.6-terra' => { input: 2.5, output: 15.0, cache_read: 0.25 },
20-
'openai.gpt-5.6-luna' => { input: 1.0, output: 6.0, cache_read: 0.1 }
29+
'openai.gpt-5.6-sol' => { input: 5.0, output: 30.0, cache_read: 0.5, cache_write: 6.25 },
30+
'openai.gpt-5.6-terra' => { input: 2.5, output: 15.0, cache_read: 0.25, cache_write: 3.125 },
31+
'openai.gpt-5.6-luna' => { input: 1.0, output: 6.0, cache_read: 0.1, cache_write: 1.25 }
2132
}.each do |id, cost|
2233
it "resolves #{id} from the bedrock provider with the documented effort values" do
2334
model = RubyLLM.models.find(id, :bedrock)

0 commit comments

Comments
 (0)