Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions providers/openai.provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ products:
models: null
- endpoint: responses_compact
capability: llm.responses.compact
models: [openai/gpt-6-astra, openai/gpt-6.1-sol, openai/gpt-6.1-terra]
models: [openai/gpt-6-astra, openai/gpt-6.1-sol, openai/gpt-6.1-terra, openai/gpt-6.2-astra, openai/gpt-6.2-sol]
- endpoint: decisions
capability: llm.decisions
models: [openai/gpt-6-luna]
- endpoint: responses_input_tokens
capability: llm.count_tokens
models: [openai/gpt-5.6, openai/gpt-6-astra, openai/gpt-6.1-sol, openai/gpt-6.1-terra, openai/gpt-6-sol, openai/gpt-6-luna, openai/gpt-5.6-sol, openai/gpt-5.6-terra, openai/gpt-5.6-luna, openai/gpt-5.5, openai/gpt-4.1-mini, openai/gpt-5.4]
models: [openai/gpt-5.6, openai/gpt-6-astra, openai/gpt-6.1-sol, openai/gpt-6.1-terra, openai/gpt-6-sol, openai/gpt-6-luna, openai/gpt-5.6-sol, openai/gpt-5.6-terra, openai/gpt-5.6-luna, openai/gpt-5.5, openai/gpt-4.1-mini, openai/gpt-5.4, openai/gpt-6.2-astra, openai/gpt-6.2-sol]
- endpoint: responses
capability: llm.responses
models: &openaiResponseProductModels [openai/gpt-5.6, openai/gpt-6-astra, openai/gpt-6.1-sol, openai/gpt-6.1-terra, openai/gpt-6-sol, openai/gpt-6-luna, openai/gpt-5.6-sol, openai/gpt-5.6-terra, openai/gpt-5.6-luna, openai/gpt-5.5, openai/gpt-4.1-mini, openai/gpt-5.4, openai/gpt-6.2-astra, openai/gpt-6.2-sol]
Expand Down Expand Up @@ -379,10 +379,10 @@ models:
outputMicrosPerMillion: 15000000
# GPT-6.2 uses the published 12-hour cache-write ceiling; generic usage has no TTL bucket.
# Ultrafast uses its announced 6x ceiling, including the post-2027-03-01 tariff.
- {"id":"openai/gpt-6.2-astra","upstream":"gpt-6.2-astra","capabilities":["llm.responses","llm.chat","search.web"],"nativeCapabilities":{"version":"clawrouter.native-capabilities.v1","endpoints":{"chat_completions":{"sources":["https://developers.openai.com/api/docs/models/gpt-6.2-astra","https://developers.openai.com/api/docs/guides/latest-model"],"checkedAt":"2026-11-17","input":["text","image"],"contextWindow":1050000,"contextTokens":272000,"maxOutputTokens":128000,"supportedServiceTiers":["default","priority","ultrafast"],"inference":{"chat":true}},"responses":{"sources":["https://developers.openai.com/api/docs/models/gpt-6.2-astra","https://developers.openai.com/api/docs/guides/latest-model"],"checkedAt":"2026-11-17","input":["text","image"],"contextWindow":1050000,"contextTokens":272000,"maxOutputTokens":128000,"supportedServiceTiers":["default","priority","ultrafast"],"inference":{"chat":true},"hostedTools":["web_search"]}}},"supportedReasoningEfforts":["low","medium","high","xhigh","max"],"requestParameters":{"responses":{"sources":["https://developers.openai.com/api/docs/models/gpt-6.2-astra","https://developers.openai.com/api/docs/guides/latest-model"],"checkedAt":"2026-11-17","defaultReasoningEffort":"medium","temperature":"unsupported","topP":"unsupported","logprobs":"unsupported","toolCalling":"supported"},"chat_completions":{"sources":["https://developers.openai.com/api/docs/models/gpt-6.2-astra","https://developers.openai.com/api/docs/guides/latest-model"],"checkedAt":"2026-11-17","defaultReasoningEffort":"medium","temperature":"unsupported","topP":"unsupported","logprobs":"unsupported","toolCalling":"unsupported"}},"pricingRef":"openai-gpt-6.2-astra-ceilings-2026-11-17","pricing":{"effectiveAt":"2026-11-17","source":"https://developers.openai.com/api/docs/models/gpt-6.2-astra","inputMicrosPerMillion":8000000,"cachedInputMicrosPerMillion":400000,"cacheWriteInputMicrosPerMillion":20000000,"outputMicrosPerMillion":40000000,"longContext":{"thresholdInputTokens":272000,"inputMicrosPerMillion":16000000,"cachedInputMicrosPerMillion":800000,"cacheWriteInputMicrosPerMillion":40000000,"outputMicrosPerMillion":60000000},"maxInputTokens":922000,"maxRequestInputTokens":922000,"defaultMaxOutputTokens":128000,"settlementBasis":"published_upper_bound","serviceTiers":[{"id":"default","inputMicrosPerMillion":8000000,"cachedInputMicrosPerMillion":400000,"cacheWriteInputMicrosPerMillion":20000000,"outputMicrosPerMillion":40000000,"longContext":{"thresholdInputTokens":272000,"inputMicrosPerMillion":16000000,"cachedInputMicrosPerMillion":800000,"cacheWriteInputMicrosPerMillion":40000000,"outputMicrosPerMillion":60000000}},{"id":"priority","aliases":["fast"],"inputMicrosPerMillion":16000000,"cachedInputMicrosPerMillion":800000,"cacheWriteInputMicrosPerMillion":40000000,"outputMicrosPerMillion":80000000,"longContext":{"thresholdInputTokens":272000,"inputMicrosPerMillion":32000000,"cachedInputMicrosPerMillion":1600000,"cacheWriteInputMicrosPerMillion":80000000,"outputMicrosPerMillion":120000000}},{"id":"ultrafast","inputMicrosPerMillion":48000000,"cachedInputMicrosPerMillion":2400000,"cacheWriteInputMicrosPerMillion":120000000,"outputMicrosPerMillion":240000000,"longContext":{"thresholdInputTokens":272000,"inputMicrosPerMillion":96000000,"cachedInputMicrosPerMillion":4800000,"cacheWriteInputMicrosPerMillion":240000000,"outputMicrosPerMillion":360000000}}]}}
- {"id":"openai/gpt-6.2-astra","upstream":"gpt-6.2-astra","capabilities":["llm.responses","llm.chat","llm.responses.compact","llm.count_tokens","search.web"],"nativeCapabilities":{"version":"clawrouter.native-capabilities.v1","endpoints":{"chat_completions":{"sources":["https://developers.openai.com/api/docs/models/gpt-6.2-astra","https://developers.openai.com/api/docs/guides/latest-model"],"checkedAt":"2026-11-17","input":["text","image"],"contextWindow":1050000,"contextTokens":272000,"maxOutputTokens":128000,"supportedServiceTiers":["default","priority","ultrafast"],"inference":{"chat":true}},"responses":{"sources":["https://developers.openai.com/api/docs/models/gpt-6.2-astra","https://developers.openai.com/api/docs/guides/latest-model"],"checkedAt":"2026-11-17","input":["text","image"],"contextWindow":1050000,"contextTokens":272000,"maxOutputTokens":128000,"supportedServiceTiers":["default","priority","ultrafast"],"inference":{"chat":true},"hostedTools":["web_search"]}}},"supportedReasoningEfforts":["low","medium","high","xhigh","max"],"requestParameters":{"responses":{"sources":["https://developers.openai.com/api/docs/models/gpt-6.2-astra","https://developers.openai.com/api/docs/guides/latest-model"],"checkedAt":"2026-11-17","defaultReasoningEffort":"medium","temperature":"unsupported","topP":"unsupported","logprobs":"unsupported","toolCalling":"supported"},"chat_completions":{"sources":["https://developers.openai.com/api/docs/models/gpt-6.2-astra","https://developers.openai.com/api/docs/guides/latest-model"],"checkedAt":"2026-11-17","defaultReasoningEffort":"medium","temperature":"unsupported","topP":"unsupported","logprobs":"unsupported","toolCalling":"unsupported"}},"pricingRef":"openai-gpt-6.2-astra-ceilings-2026-11-17","pricing":{"effectiveAt":"2026-11-17","source":"https://developers.openai.com/api/docs/models/gpt-6.2-astra","inputMicrosPerMillion":8000000,"cachedInputMicrosPerMillion":400000,"cacheWriteInputMicrosPerMillion":20000000,"outputMicrosPerMillion":40000000,"longContext":{"thresholdInputTokens":272000,"inputMicrosPerMillion":16000000,"cachedInputMicrosPerMillion":800000,"cacheWriteInputMicrosPerMillion":40000000,"outputMicrosPerMillion":60000000},"maxInputTokens":922000,"maxRequestInputTokens":922000,"defaultMaxOutputTokens":128000,"settlementBasis":"published_upper_bound","serviceTiers":[{"id":"default","inputMicrosPerMillion":8000000,"cachedInputMicrosPerMillion":400000,"cacheWriteInputMicrosPerMillion":20000000,"outputMicrosPerMillion":40000000,"longContext":{"thresholdInputTokens":272000,"inputMicrosPerMillion":16000000,"cachedInputMicrosPerMillion":800000,"cacheWriteInputMicrosPerMillion":40000000,"outputMicrosPerMillion":60000000}},{"id":"priority","aliases":["fast"],"inputMicrosPerMillion":16000000,"cachedInputMicrosPerMillion":800000,"cacheWriteInputMicrosPerMillion":40000000,"outputMicrosPerMillion":80000000,"longContext":{"thresholdInputTokens":272000,"inputMicrosPerMillion":32000000,"cachedInputMicrosPerMillion":1600000,"cacheWriteInputMicrosPerMillion":80000000,"outputMicrosPerMillion":120000000}},{"id":"ultrafast","inputMicrosPerMillion":48000000,"cachedInputMicrosPerMillion":2400000,"cacheWriteInputMicrosPerMillion":120000000,"outputMicrosPerMillion":240000000,"longContext":{"thresholdInputTokens":272000,"inputMicrosPerMillion":96000000,"cachedInputMicrosPerMillion":4800000,"cacheWriteInputMicrosPerMillion":240000000,"outputMicrosPerMillion":360000000}}]}}
# GPT-6.2 uses the published 12-hour cache-write ceiling; generic usage has no TTL bucket.
# Ultrafast uses its announced 6x ceiling, including the post-2027-03-01 tariff.
- {"id":"openai/gpt-6.2-sol","upstream":"gpt-6.2-sol","capabilities":["llm.responses","llm.chat","search.web"],"nativeCapabilities":{"version":"clawrouter.native-capabilities.v1","endpoints":{"chat_completions":{"sources":["https://developers.openai.com/api/docs/models/gpt-6.2-sol","https://developers.openai.com/api/docs/guides/latest-model"],"checkedAt":"2026-11-17","input":["text","image"],"contextWindow":1050000,"contextTokens":272000,"maxOutputTokens":128000,"supportedServiceTiers":["default","priority","ultrafast"],"inference":{"chat":true}},"responses":{"sources":["https://developers.openai.com/api/docs/models/gpt-6.2-sol","https://developers.openai.com/api/docs/guides/latest-model"],"checkedAt":"2026-11-17","input":["text","image"],"contextWindow":1050000,"contextTokens":272000,"maxOutputTokens":128000,"supportedServiceTiers":["default","priority","ultrafast"],"inference":{"chat":true},"hostedTools":["web_search"]}}},"supportedReasoningEfforts":["low","medium","high","xhigh","max"],"requestParameters":{"responses":{"sources":["https://developers.openai.com/api/docs/models/gpt-6.2-sol","https://developers.openai.com/api/docs/guides/latest-model"],"checkedAt":"2026-11-17","defaultReasoningEffort":"medium","temperature":"unsupported","topP":"unsupported","logprobs":"unsupported","toolCalling":"supported"},"chat_completions":{"sources":["https://developers.openai.com/api/docs/models/gpt-6.2-sol","https://developers.openai.com/api/docs/guides/latest-model"],"checkedAt":"2026-11-17","defaultReasoningEffort":"medium","temperature":"unsupported","topP":"unsupported","logprobs":"unsupported","toolCalling":"unsupported"}},"pricingRef":"openai-gpt-6.2-sol-ceilings-2026-11-17","pricing":{"effectiveAt":"2026-11-17","source":"https://developers.openai.com/api/docs/models/gpt-6.2-sol","inputMicrosPerMillion":2000000,"cachedInputMicrosPerMillion":100000,"cacheWriteInputMicrosPerMillion":5000000,"outputMicrosPerMillion":10000000,"longContext":{"thresholdInputTokens":272000,"inputMicrosPerMillion":4000000,"cachedInputMicrosPerMillion":200000,"cacheWriteInputMicrosPerMillion":10000000,"outputMicrosPerMillion":15000000},"maxInputTokens":922000,"maxRequestInputTokens":922000,"defaultMaxOutputTokens":128000,"settlementBasis":"published_upper_bound","serviceTiers":[{"id":"default","inputMicrosPerMillion":2000000,"cachedInputMicrosPerMillion":100000,"cacheWriteInputMicrosPerMillion":5000000,"outputMicrosPerMillion":10000000,"longContext":{"thresholdInputTokens":272000,"inputMicrosPerMillion":4000000,"cachedInputMicrosPerMillion":200000,"cacheWriteInputMicrosPerMillion":10000000,"outputMicrosPerMillion":15000000}},{"id":"priority","aliases":["fast"],"inputMicrosPerMillion":4000000,"cachedInputMicrosPerMillion":200000,"cacheWriteInputMicrosPerMillion":10000000,"outputMicrosPerMillion":20000000,"longContext":{"thresholdInputTokens":272000,"inputMicrosPerMillion":8000000,"cachedInputMicrosPerMillion":400000,"cacheWriteInputMicrosPerMillion":20000000,"outputMicrosPerMillion":30000000}},{"id":"ultrafast","inputMicrosPerMillion":12000000,"cachedInputMicrosPerMillion":600000,"cacheWriteInputMicrosPerMillion":30000000,"outputMicrosPerMillion":60000000,"longContext":{"thresholdInputTokens":272000,"inputMicrosPerMillion":24000000,"cachedInputMicrosPerMillion":1200000,"cacheWriteInputMicrosPerMillion":60000000,"outputMicrosPerMillion":90000000}}]}}
- {"id":"openai/gpt-6.2-sol","upstream":"gpt-6.2-sol","capabilities":["llm.responses","llm.chat","llm.responses.compact","llm.count_tokens","search.web"],"nativeCapabilities":{"version":"clawrouter.native-capabilities.v1","endpoints":{"chat_completions":{"sources":["https://developers.openai.com/api/docs/models/gpt-6.2-sol","https://developers.openai.com/api/docs/guides/latest-model"],"checkedAt":"2026-11-17","input":["text","image"],"contextWindow":1050000,"contextTokens":272000,"maxOutputTokens":128000,"supportedServiceTiers":["default","priority","ultrafast"],"inference":{"chat":true}},"responses":{"sources":["https://developers.openai.com/api/docs/models/gpt-6.2-sol","https://developers.openai.com/api/docs/guides/latest-model"],"checkedAt":"2026-11-17","input":["text","image"],"contextWindow":1050000,"contextTokens":272000,"maxOutputTokens":128000,"supportedServiceTiers":["default","priority","ultrafast"],"inference":{"chat":true},"hostedTools":["web_search"]}}},"supportedReasoningEfforts":["low","medium","high","xhigh","max"],"requestParameters":{"responses":{"sources":["https://developers.openai.com/api/docs/models/gpt-6.2-sol","https://developers.openai.com/api/docs/guides/latest-model"],"checkedAt":"2026-11-17","defaultReasoningEffort":"medium","temperature":"unsupported","topP":"unsupported","logprobs":"unsupported","toolCalling":"supported"},"chat_completions":{"sources":["https://developers.openai.com/api/docs/models/gpt-6.2-sol","https://developers.openai.com/api/docs/guides/latest-model"],"checkedAt":"2026-11-17","defaultReasoningEffort":"medium","temperature":"unsupported","topP":"unsupported","logprobs":"unsupported","toolCalling":"unsupported"}},"pricingRef":"openai-gpt-6.2-sol-ceilings-2026-11-17","pricing":{"effectiveAt":"2026-11-17","source":"https://developers.openai.com/api/docs/models/gpt-6.2-sol","inputMicrosPerMillion":2000000,"cachedInputMicrosPerMillion":100000,"cacheWriteInputMicrosPerMillion":5000000,"outputMicrosPerMillion":10000000,"longContext":{"thresholdInputTokens":272000,"inputMicrosPerMillion":4000000,"cachedInputMicrosPerMillion":200000,"cacheWriteInputMicrosPerMillion":10000000,"outputMicrosPerMillion":15000000},"maxInputTokens":922000,"maxRequestInputTokens":922000,"defaultMaxOutputTokens":128000,"settlementBasis":"published_upper_bound","serviceTiers":[{"id":"default","inputMicrosPerMillion":2000000,"cachedInputMicrosPerMillion":100000,"cacheWriteInputMicrosPerMillion":5000000,"outputMicrosPerMillion":10000000,"longContext":{"thresholdInputTokens":272000,"inputMicrosPerMillion":4000000,"cachedInputMicrosPerMillion":200000,"cacheWriteInputMicrosPerMillion":10000000,"outputMicrosPerMillion":15000000}},{"id":"priority","aliases":["fast"],"inputMicrosPerMillion":4000000,"cachedInputMicrosPerMillion":200000,"cacheWriteInputMicrosPerMillion":10000000,"outputMicrosPerMillion":20000000,"longContext":{"thresholdInputTokens":272000,"inputMicrosPerMillion":8000000,"cachedInputMicrosPerMillion":400000,"cacheWriteInputMicrosPerMillion":20000000,"outputMicrosPerMillion":30000000}},{"id":"ultrafast","inputMicrosPerMillion":12000000,"cachedInputMicrosPerMillion":600000,"cacheWriteInputMicrosPerMillion":30000000,"outputMicrosPerMillion":60000000,"longContext":{"thresholdInputTokens":272000,"inputMicrosPerMillion":24000000,"cachedInputMicrosPerMillion":1200000,"cacheWriteInputMicrosPerMillion":60000000,"outputMicrosPerMillion":90000000}}]}}
- id: openai/gpt-6-astra
displayName: "GPT-6 Astra"
upstream: gpt-6-astra
Expand Down
25 changes: 24 additions & 1 deletion test/responses-compact-manifest.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import assert from "node:assert/strict";
import test from "node:test";
import { readFileSync } from "node:fs";
import { parse } from "yaml";
import { modelSupportsEndpoint } from "../shared/route-catalog.ts";
import { compileProviderSnapshot } from "../scripts/compile-providers.mjs";

const source = parse(readFileSync(new URL("../providers/openai.provider.yaml", import.meta.url), "utf8"));
Expand All @@ -14,9 +15,31 @@ test("compiled compact is a distinct unary registered-model contract", () => {
assert.equal(compact.path, "/v1/responses/compact"); assert.deepEqual(compact.methods, ["POST"]);
assert.equal(compact.request_format, "openai.responses_compact"); assert.equal(compact.response_format, "openai.responses_compact");
assert.ok(!compact.streaming); assert.ok(!compact.websocket); assert.ok(!compact.modelPassthrough); assert.ok(!compact.outputTokenLimit); assert.ok(!compact.responsesLifecycle);
assert.deepEqual(provider.models.filter(model => model.capabilities.includes("llm.responses.compact")).map(model => model.id), ["openai/gpt-6-astra", "openai/gpt-6.1-sol", "openai/gpt-6.1-terra"]);
assert.deepEqual(snapshot.capability_index["llm.responses.compact"], [{ provider: "openai", endpoint: "responses_compact", methods: ["POST"] }]);
});
test("Responses support alone does not enable compact routing", () => {
const compactId = "openai/fixture-compact", ordinaryId = "openai/fixture-responses";
const { providers: [provider] } = compile(manifest => {
const pricing = { effectiveAt: "2026-01-01", source: "https://example.com/pricing", inputMicrosPerMillion: 1, outputMicrosPerMillion: 1, maxInputTokens: 4096, defaultMaxOutputTokens: 512 };
manifest.models.entries.push(
{ id: compactId, upstream: "fixture-compact", capabilities: ["llm.responses", "llm.responses.compact"], pricing },
{ id: ordinaryId, upstream: "fixture-responses", capabilities: ["llm.responses"], pricing },
);
const offers = manifest.products.find(product => product.id === "platform-api").offers;
for (const [endpoint, added] of [["responses", [compactId, ordinaryId]], ["responses_compact", [compactId]]]) {
const offer = offers.find(row => row.endpoint === endpoint);
offer.models = [...offer.models, ...added];
}
});
const compact = provider.endpoints.find(row => row.id === "responses_compact");
const responses = provider.endpoints.find(row => row.id === "responses");
for (const [id, allowed] of [[compactId, true], [ordinaryId, false]]) {
const model = provider.models.find(row => row.id === id);
assert.ok(modelSupportsEndpoint(provider, model, responses), id);
assert.equal(modelSupportsEndpoint(provider, model, compact), allowed, id);
assert.equal(provider.offer_definitions.some(offer => offer.endpoint === compact.id && offer.model?.id === id), allowed, id);
}
});
function removePricing(manifest) {
const model = manifest.models.entries.find(model => model.id === "openai/gpt-6-astra");
delete model.pricing;
Expand Down
2 changes: 1 addition & 1 deletion worker/generated/provider-snapshot.json

Large diffs are not rendered by default.

Loading