Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions containers/api-proxy/ai-credits-pricing.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module.exports = Object.freeze({
'gpt-5.6-luna': { input: 1.00, cachedInput: 0.10, cacheWrite: null, output: 6.00 },
'gpt-5.6-sol': { input: 5.00, cachedInput: 0.50, cacheWrite: null, output: 30.00 },
'gpt-5.6-terra': { input: 2.50, cachedInput: 0.25, cacheWrite: null, output: 15.00 },
'gpt-6-astra': { input: 10.00, cachedInput: 1.00, cacheWrite: null, output: 50.00 },
'claude-haiku-4-5': { input: 1.00, cachedInput: 0.10, cacheWrite: 1.25, output: 5.00 },
'claude-sonnet-4': { input: 3.00, cachedInput: 0.30, cacheWrite: 3.75, output: 15.00 },
'claude-sonnet-4-5': { input: 3.00, cachedInput: 0.30, cacheWrite: 3.75, output: 15.00 },
Expand Down
14 changes: 14 additions & 0 deletions containers/api-proxy/guards/ai-credits-guard.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@ describe('ai-credits-guard', () => {
expect(checkUnknownModelRejection('claude-sonnet-5')).toBeNull();
});

it('resolves gpt-6-astra from curated pricing without unknown-model rejection', () => {
process.env.AWF_MAX_AI_CREDITS = '10';
resetAiCreditsGuardForTests();

const usage = applyAiCreditsUsage({
input_tokens: 2000,
cache_read_tokens: 1000,
output_tokens: 100,
}, 'gpt-6-astra');

expect(usage.aiCreditsThisResponse).toBeCloseTo(0.7, 10);
expect(checkUnknownModelRejection('gpt-6-astra')).toBeNull();
});

it('does not double-count cached tokens when input_tokens is total-inclusive (OpenAI-style)', () => {
// OpenAI (Chat Completions and Responses API) reports prompt_tokens/input_tokens
// as the TOTAL input, with cached tokens being a subset. When no provider is
Expand Down
1 change: 1 addition & 0 deletions src/copilot-model.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ describe('validateCopilotModel', () => {
'claude-fable-5',
'claude-mythos-5',
'claude-sonnet-5',
'gpt-6-astra',
'mai-code-1-flash',
])('accepts newly supported Copilot allowlist models (%s)', model => {
const result = validateCopilotModel(model);
Expand Down
1 change: 1 addition & 0 deletions src/copilot-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const SUPPORTED_COPILOT_MODELS = new Set([
'gpt-5.6-luna',
'gpt-5.6-sol',
'gpt-5.6-terra',
'gpt-6-astra',
'gpt-5-mini',
'o3',
'o3-mini',
Expand Down
Loading