Files
magpie/internal/provider/testdata/copilot-models-2026-08-01.json
T
yetone 7670295019 copilot: list each model's long-context tier, as Copilot Chat asks /models (gtliuu on X)
gtliuu on X: Copilot's Claude Opus 5.5 has a 200K and a long tier, and magpie
offered only 200K. magpie asked /models at X-GitHub-Api-Version 2026-01-09,
and at that version Copilot lists only the default tier's
max_prompt_tokens. Copilot Chat 0.68 never sends 2026-01-09:
@vscode/copilot-api 0.5.2's _mixinHeaders sets 2026-08-01 on every Copilot
API request, Models included, over networking.ts's 2026-01-09. At
2026-06-01 and later, /models gives each model its whole window (Opus 5.5
1M) and billing.token_prices with a default tier and a long_context tier.

- The editors' sign-in asks GET /models at 2026-08-01
  (copilotModelsVersion). The Copilot CLI's sign-in keeps its own
  2026-07-01, which already lists the tiers. Chat requests are unchanged:
  Copilot served prompts past the default tier at 2026-01-09. The other
  requests still on 2026-01-09 are #6571.
- The window follows Copilot Chat (languageModelAccess.ts and
  agentIntent.ts). A long tier at the default's prices gives the whole
  window: Claude Opus 5.5 1M, and the Sonnet, Fable and Gemini models
  936K or 983K. A long tier with a surcharge keeps the default tier's
  prompt as the window agents are told. The whole window becomes
  MaxContext, which the user can raise the window to. GPT-6 Luna gets
  272K and 872K, and Claude Haiku 5.5 100K and 936K. The whole window is
  the limits' max_prompt_tokens, not the long tier's prompt: Grok 4.7's
  long tier says 500000, but Copilot takes 372000.
- Price: Copilot's own list (AIU per batch_size tokens / 100 = USD per M)
  is the list price, ahead of models.dev. A long tier with a surcharge
  becomes a Tier above the default's prompt. Both 2026-06-01's field
  names (cache_price, context_max) and 2026-08-01's are read. GPT-4.1's
  all-zero list is no price. A flat, older list changes nothing.

Run (base origin/main 7b50e1f2c):
- go test -tags nogui -count=1 -timeout 45m ./internal/provider/...
  ./internal/catalog/... ./internal/gateway/... ./internal/usage/... on
  mote, in a sandbox HOME: all ok (provider 139s, catalog 3s, gateway
  918s, usage 42s). Not the whole ./...: mote's suite lock had six suites
  queued, and mica's disk is full.
- GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./..., and the
  linux and windows builds: ok.
- gofmt -l: clean.
- Fixtures are the owner's account's real /models replies at 2026-01-09,
  2026-06-01 and 2026-08-01, trimmed to four models.
- Real use: a -tags dev build in a sandbox HOME with only
  github-copilot/apps.json copied, on 127.0.0.1:3476. Its /v1/models
  lists copilot/claude-opus-5.5 at 1000000 (200000 before) and
  gpt-6-luna at 272000, both priced from Copilot's list. A
  584,849-token prompt to copilot/claude-opus-5.5 on /v1/messages got
  200 end_turn, billed by Copilot at 233.9 AIU (400 an M, the default
  tier's price).

Broken by hand, each red:
- /models asked without copilotModelsVersion: TestCopilotListsTheLongContextTier.
- tiers not applied: that test and TestCopilotTiersAtTheFirstTieredVersion.
- the long tier's prompt over the limits': red on Grok 4.7's 500000.
- context_max not read: TestCopilotTiersAtTheFirstTieredVersion.
- copilotListPrice off: TestCopilotListPriceIsCopilots.

Not tried: a request on a surcharged model raised past its default
tier (GPT-6 Luna over 272K), or a Business or Enterprise account's list.
2026-11-14 03:37:38 +08:00

318 lines
7.3 KiB
JSON

{
"data": [
{
"billing": {
"auto_discount": 0.1,
"restricted_to": [
"pro_plus",
"business",
"enterprise",
"max"
],
"token_prices": {
"batch_size": 1000000,
"default": {
"cache_read_price": 20,
"cache_write_1h_price": 800,
"cache_write_price": 500,
"input_price": 400,
"max_prompt_tokens": 200000,
"output_price": 2000
},
"long_context": {
"cache_read_price": 20,
"cache_write_1h_price": 800,
"cache_write_price": 500,
"input_price": 400,
"max_prompt_tokens": 1000000,
"output_price": 2000
}
}
},
"capabilities": {
"family": "claude-opus-5.5",
"limits": {
"max_context_window_tokens": 1000000,
"max_non_streaming_output_tokens": 16000,
"max_output_tokens": 128000,
"max_prompt_tokens": 1000000,
"vision": {
"max_prompt_image_size": 3145728,
"max_prompt_images": 1,
"supported_media_types": [
"image/jpeg",
"image/png",
"image/webp",
"image/gif",
"application/pdf"
]
}
},
"object": "model_capabilities",
"supports": {
"adaptive_thinking": true,
"parallel_tool_calls": true,
"reasoning_effort": [
"low",
"medium",
"high",
"xhigh",
"max"
],
"streaming": true,
"structured_outputs": true,
"tool_calls": true,
"vision": true
},
"tokenizer": "o200k_base",
"type": "chat"
},
"id": "claude-opus-5.5",
"is_chat_default": false,
"is_chat_fallback": false,
"model_picker_category": "powerful",
"model_picker_enabled": true,
"model_picker_price_category": "high",
"name": "Claude Opus 5.5",
"object": "model",
"policy": {
"state": "enabled",
"terms": "Enable access to the latest Claude Opus 5.5 model from Anthropic. [Learn more about how GitHub Copilot serves Claude Opus 5.5](https://gh.io/copilot-claude-opus)."
},
"preview": false,
"supported_endpoints": [
"/v1/messages",
"/chat/completions"
],
"vendor": "Anthropic",
"version": "claude-opus-5.5"
},
{
"billing": {
"auto_discount": 0.1,
"restricted_to": [
"free",
"edu",
"pro",
"pro_plus",
"business",
"enterprise",
"max"
],
"token_prices": {
"batch_size": 1000000,
"default": {
"cache_read_price": 1,
"cache_write_price": 12.5,
"input_price": 10,
"max_prompt_tokens": 272000,
"output_price": 50
},
"long_context": {
"cache_read_price": 2,
"cache_write_price": 25,
"input_price": 20,
"max_prompt_tokens": 872000,
"output_price": 75
}
}
},
"capabilities": {
"family": "gpt-6-luna",
"limits": {
"max_context_window_tokens": 1000000,
"max_output_tokens": 128000,
"max_prompt_tokens": 872000,
"vision": {
"max_prompt_image_size": 3145728,
"max_prompt_images": 1,
"supported_media_types": [
"image/jpeg",
"image/png",
"image/webp",
"image/gif",
"application/pdf"
]
}
},
"object": "model_capabilities",
"supports": {
"parallel_tool_calls": true,
"reasoning_effort": [
"none",
"low",
"medium",
"high",
"xhigh",
"max"
],
"streaming": true,
"structured_outputs": true,
"tool_calls": true,
"vision": true
},
"tokenizer": "o200k_base",
"type": "chat"
},
"id": "gpt-6-luna",
"is_chat_default": false,
"is_chat_fallback": false,
"model_picker_category": "lightweight",
"model_picker_enabled": true,
"model_picker_price_category": "low",
"name": "GPT-6 Luna",
"object": "model",
"policy": {
"state": "enabled",
"terms": "Enable access to the latest GPT-6 Luna model from OpenAI. [Learn more about how GitHub Copilot serves GPT-6 Luna](https://gh.io/copilot-openai)."
},
"preview": false,
"supported_endpoints": [
"/responses",
"ws:/responses"
],
"vendor": "OpenAI",
"version": "gpt-6-luna"
},
{
"billing": {
"restricted_to": [
"pro",
"pro_plus",
"business",
"enterprise",
"max"
],
"token_prices": {
"batch_size": 1000000,
"default": {
"cache_read_price": 50,
"cache_write_price": 0,
"input_price": 200,
"max_prompt_tokens": 200000,
"output_price": 600
},
"long_context": {
"cache_read_price": 100,
"cache_write_price": 0,
"input_price": 400,
"max_prompt_tokens": 500000,
"output_price": 1200
}
}
},
"capabilities": {
"family": "grok-4.7",
"limits": {
"max_context_window_tokens": 500000,
"max_output_tokens": 128000,
"max_prompt_tokens": 372000,
"vision": {
"max_prompt_image_size": 3145728,
"max_prompt_images": 1,
"supported_media_types": [
"image/jpeg",
"image/png"
]
}
},
"object": "model_capabilities",
"supports": {
"parallel_tool_calls": true,
"reasoning_effort": [
"low",
"medium",
"high",
"xhigh"
],
"streaming": true,
"structured_outputs": true,
"tool_calls": true,
"vision": true
},
"tokenizer": "o200k_base",
"type": "chat"
},
"id": "grok-4.7",
"is_chat_default": false,
"is_chat_fallback": false,
"model_picker_category": "versatile",
"model_picker_enabled": true,
"model_picker_price_category": "medium",
"name": "Grok 4.7",
"object": "model",
"preview": false,
"supported_endpoints": [
"/responses"
],
"vendor": "xAI",
"version": "grok-4.7"
},
{
"billing": {
"auto_discount": 0.1,
"token_prices": {
"batch_size": 0,
"default": {
"cache_read_price": 0,
"cache_write_price": 0,
"input_price": 0,
"output_price": 0
}
}
},
"capabilities": {
"family": "gpt-4.1",
"limits": {
"max_context_window_tokens": 128000,
"max_output_tokens": 16384,
"max_prompt_tokens": 128000,
"vision": {
"max_prompt_image_size": 3145728,
"max_prompt_images": 1,
"supported_media_types": [
"image/jpeg",
"image/png",
"image/webp",
"image/gif",
"application/pdf"
]
}
},
"object": "model_capabilities",
"supports": {
"parallel_tool_calls": true,
"streaming": true,
"structured_outputs": true,
"tool_calls": true,
"vision": true
},
"tokenizer": "o200k_base",
"type": "chat"
},
"id": "gpt-4.1",
"info_messages": [
{
"code": "model_pending_deprecation",
"message": "GPT-4.1 has a planned deprecation date of 2026-06-01."
}
],
"is_chat_default": false,
"is_chat_fallback": false,
"model_picker_category": "versatile",
"model_picker_enabled": false,
"model_picker_price_category": "medium",
"name": "GPT-4.1",
"object": "model",
"policy": {
"state": "enabled",
"terms": "Enable access to the latest GPT-4.1 model from OpenAI. [Learn more about how GitHub Copilot serves GPT-4.1](https://docs.github.com/en/copilot/using-github-copilot/ai-models/choosing-the-right-ai-model-for-your-task#gpt-41)."
},
"preview": false,
"vendor": "Azure OpenAI",
"version": "gpt-4.1-2025-04-14"
}
],
"object": "list"
}