@linxiraos/pi-catalog 1.4.6 → 1.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/CHANGELOG.md +6 -2
  2. package/README.md +3 -3
  3. package/dist/types/build.d.ts +12 -4
  4. package/dist/types/compat/auth-ids.d.ts +2 -2
  5. package/dist/types/compat/catalog-policy.d.ts +6 -4
  6. package/dist/types/compat/factory-droid.d.ts +7 -1
  7. package/dist/types/compat/provider-ids.d.ts +1 -1
  8. package/dist/types/compat/resolve.d.ts +1 -1
  9. package/dist/types/compat/revision.d.ts +2 -0
  10. package/dist/types/compat/server-side-fallback.d.ts +6 -4
  11. package/dist/types/compat/types.d.ts +6 -2
  12. package/dist/types/discovery/codex.d.ts +4 -5
  13. package/dist/types/discovery/cursor-proto.d.ts +8 -0
  14. package/dist/types/discovery/openai-compatible.d.ts +6 -0
  15. package/dist/types/model-cache.d.ts +8 -0
  16. package/dist/types/model-catalog-format.d.ts +37 -0
  17. package/dist/types/model-manager.d.ts +11 -1
  18. package/dist/types/model-thinking.d.ts +4 -0
  19. package/dist/types/models.d.ts +22 -3
  20. package/dist/types/pricing.d.ts +66 -6
  21. package/dist/types/provider-models/openai-compat.d.ts +18 -13
  22. package/dist/types/types.d.ts +14 -19
  23. package/dist/types/utils.d.ts +8 -0
  24. package/dist/types/wire/codex.d.ts +1 -1
  25. package/package.json +6 -10
  26. package/src/build.d.ts +12 -4
  27. package/src/build.ts +50 -3
  28. package/src/compat/auth-ids.ts +5 -0
  29. package/src/compat/axes.ts +27 -9
  30. package/src/compat/catalog-policy.d.ts +9 -0
  31. package/src/compat/catalog-policy.ts +14 -10
  32. package/src/compat/collapse.ts +1 -1
  33. package/src/compat/factory-droid.d.ts +7 -1
  34. package/src/compat/factory-droid.ts +9 -1
  35. package/src/compat/provider-ids.d.ts +1 -1
  36. package/src/compat/provider-ids.ts +2 -0
  37. package/src/compat/resolve.d.ts +1 -1
  38. package/src/compat/resolve.ts +4 -5
  39. package/src/compat/revision.d.ts +2 -0
  40. package/src/compat/revision.ts +10 -0
  41. package/src/compat/rules/README.md +14 -12
  42. package/src/compat/rules/auth/_order.kdl +1 -1
  43. package/src/compat/rules/auth/mistral.kdl +4 -0
  44. package/src/compat/rules/auth/modular.kdl +9 -0
  45. package/src/compat/rules/auth/scaleway.kdl +17 -0
  46. package/src/compat/rules/auth/typesafe.kdl +2 -1
  47. package/src/compat/rules/classes/anthropic.kdl +5 -0
  48. package/src/compat/rules/classes/deepseek.kdl +3 -2
  49. package/src/compat/rules/classes/gemini.kdl +1 -1
  50. package/src/compat/rules/classes/openai.kdl +2 -2
  51. package/src/compat/rules/classes/xai.kdl +1 -1
  52. package/src/compat/rules/providers/anthropic.kdl +8 -4
  53. package/src/compat/rules/providers/cursor.kdl +10 -0
  54. package/src/compat/rules/providers/deepseek.kdl +2 -2
  55. package/src/compat/rules/providers/factory-droid.kdl +243 -13
  56. package/src/compat/rules/providers/google-vertex.kdl +3 -0
  57. package/src/compat/rules/providers/kimi-code.kdl +6 -0
  58. package/src/compat/rules/providers/mistral.kdl +8 -0
  59. package/src/compat/rules/providers/modular.kdl +35 -0
  60. package/src/compat/rules/providers/openai-codex.kdl +1 -1
  61. package/src/compat/rules/providers/sambanova.kdl +2 -0
  62. package/src/compat/rules/providers/scaleway.kdl +179 -0
  63. package/src/compat/rules/runtime/behavior.kdl +22 -6
  64. package/src/compat/rules.json +1 -1
  65. package/src/compat/server-side-fallback.d.ts +9 -0
  66. package/src/compat/server-side-fallback.ts +7 -5
  67. package/src/compat/types.d.ts +6 -2
  68. package/src/compat/types.ts +6 -2
  69. package/src/discovery/codex.d.ts +4 -5
  70. package/src/discovery/codex.ts +7 -15
  71. package/src/discovery/cursor-proto.d.ts +8 -0
  72. package/src/discovery/cursor-proto.ts +12 -1
  73. package/src/discovery/factory-droid.ts +35 -11
  74. package/src/discovery/openai-compatible.d.ts +6 -0
  75. package/src/discovery/openai-compatible.ts +1 -1
  76. package/src/model-cache.d.ts +8 -0
  77. package/src/model-cache.ts +83 -61
  78. package/src/model-catalog-format.d.ts +37 -0
  79. package/src/model-catalog-format.ts +296 -0
  80. package/src/model-manager.d.ts +11 -1
  81. package/src/model-manager.ts +85 -143
  82. package/src/model-thinking.d.ts +4 -0
  83. package/src/model-thinking.ts +10 -0
  84. package/src/model-tokenizer.ts +13 -12
  85. package/src/models.d.ts +22 -3
  86. package/src/models.json +1 -1
  87. package/src/models.ts +48 -11
  88. package/src/pricing.d.ts +66 -6
  89. package/src/pricing.ts +59 -94
  90. package/src/provider-models/cache-provider-id.ts +23 -6
  91. package/src/provider-models/catalog-snapshot.json.zst +0 -0
  92. package/src/provider-models/catalog-snapshot.json.zst.d.ts +3 -0
  93. package/src/provider-models/descriptors.ts +2 -0
  94. package/src/provider-models/openai-compat.d.ts +18 -13
  95. package/src/provider-models/openai-compat.ts +203 -94
  96. package/src/provider-models/special.ts +5 -6
  97. package/src/types.d.ts +14 -19
  98. package/src/types.ts +11 -18
  99. package/src/utils.d.ts +8 -0
  100. package/src/utils.ts +18 -0
  101. package/src/wire/codex.d.ts +1 -1
  102. package/src/wire/codex.ts +1 -1
  103. package/src/wire/factory-droid.ts +4 -3
  104. package/src/models.json.d.ts +0 -9
@@ -76,6 +76,16 @@ export function compareRevision(a: Revision, b: Revision): number {
76
76
  return a[0] - b[0] || a[1] - b[1] || a[2] - b[2];
77
77
  }
78
78
 
79
+ /** Whether a revision string parses and is at or above `floor`; `undefined` or unparsable is never. */
80
+ export function revisionAtLeast(revision: string | undefined, floor: string): boolean {
81
+ if (revision === undefined) return false;
82
+ const parsedRevision = parseRevision(revision);
83
+ const parsedFloor = parseRevision(floor);
84
+ return (
85
+ parsedRevision !== undefined && parsedFloor !== undefined && compareRevision(parsedRevision, parsedFloor) >= 0
86
+ );
87
+ }
88
+
79
89
  /** Renders a revision as its canonical `major.minor.patch` string. */
80
90
  export function formatRevision(revision: Revision): string {
81
91
  return `${revision[0]}.${revision[1]}.${revision[2]}`;
@@ -179,16 +179,16 @@ provider "openrouter" {
179
179
 
180
180
  ### Selectors and nesting
181
181
 
182
- | Selector | Form | Matching semantics |
183
- | ---------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
184
- | `class` | `class "id" { ... }` | Exact class ID. At document root it may contain `on`, `on-api`, `family`, `revision`, and `models`. Under `provider` it may contain `family`, `revision`, and `models`. |
185
- | `provider` | `provider "id" { ... }` | Exact provider ID. It is root-only and may contain `class`, `on-api`, and `models`. |
186
- | `on` | `on "provider-a" "provider-b" { ... }` | One or more provider IDs, combined as OR. It is allowed under a root `class`, and may contain `on-api` to conjoin an API scope plus `family`, `revision`, and `models`. |
187
- | `on-api` | `on-api "adapter-a" "adapter-b" { ... }` | One or more request adapter IDs, combined as OR. At document root it may contain `class` and `models`; under a root `class` (directly or nested inside `on`) or `provider` it may contain `family`, `revision`, and `models`. |
188
- | `family` | `family "id" { ... }` | Exact classified family ID. It may contain `revision` and `models`. A target with no family does not match. |
189
- | `revision` | `revision ">=2.5 <4" { ... }` | A non-empty, whitespace-separated conjunction of comparisons. It may contain `models`. A target with no revision does not match. |
190
- | `models` | `models "id" "vendor/*" { ... }` | One or more alternatives, combined as OR. It may contain only `on-upstream`. `token="name"` matches an ASCII-case-insensitive token bounded by non-alphanumerics. |
191
- | `on-upstream` | `on-upstream "a" "b" { ... }` | Exact selected upstream IDs, combined as OR. Allowed inside any selector scope once; preserves the containing scope's other permitted children. Absent upstream never matches. |
182
+ | Selector | Form | Matching semantics |
183
+ | ------------- | ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
184
+ | `class` | `class "id" { ... }` | Exact class ID. At document root it may contain `on`, `on-api`, `family`, `revision`, and `models`. Under `provider` it may contain `family`, `revision`, and `models`. |
185
+ | `provider` | `provider "id" { ... }` | Exact provider ID. It is root-only and may contain `class`, `on-api`, and `models`. |
186
+ | `on` | `on "provider-a" "provider-b" { ... }` | One or more provider IDs, combined as OR. It is allowed under a root `class`, and may contain `on-api` to conjoin an API scope plus `family`, `revision`, and `models`. |
187
+ | `on-api` | `on-api "adapter-a" "adapter-b" { ... }` | One or more request adapter IDs, combined as OR. At document root it may contain `class` and `models`; under a root `class` (directly or nested inside `on`) or `provider` it may contain `family`, `revision`, and `models`. |
188
+ | `family` | `family "id" { ... }` | Exact classified family ID. It may contain `revision` and `models`. A target with no family does not match. |
189
+ | `revision` | `revision ">=2.5 <4" { ... }` | A non-empty, whitespace-separated conjunction of comparisons. It may contain `models`. A target with no revision does not match. |
190
+ | `models` | `models "id" "vendor/*" { ... }` | One or more alternatives, combined as OR. It may contain only `on-upstream`. `token="name"` matches an ASCII-case-insensitive token bounded by non-alphanumerics. |
191
+ | `on-upstream` | `on-upstream "a" "b" { ... }` | Exact selected upstream IDs, combined as OR. Allowed inside any selector scope once; preserves the containing scope's other permitted children. Absent upstream never matches. |
192
192
 
193
193
  Every selector scope may additionally contain `on-upstream`; it cannot replace an already constrained upstream. Class, provider/`on`, `on-api`, `on-upstream`, and family values are compared exactly and case-sensitively to the structured resolve target. Revision operators are `>=`, `>`, `<=`, `<`, and `=`; operands have one to three dot-separated unsigned 8-bit components, omitted components zero.
194
194
 
@@ -227,7 +227,7 @@ One object axis carries a computed form: `long-context-cost` accepts either the
227
227
 
228
228
  `inline-image-byte-budget` caps retained base64 image characters for a deployment's request body. It leaves room for tool schemas and text beneath the provider's body-size limit; the coding agent reads it through `resolveInlineImageByteBudget` before sending live history, and snapcompact gives its archive frames half of it (`frameDataBytesBudget`). The budget applies only while the request reaches the host the rules describe (the Anthropic API, first-party OpenAI, the Codex backend at its default URL, DeepSeek's API, or Factory Droid's own global or EU API host), which callers decide with pi-ai's `reachesBudgetedHost`: `compat.officialEndpoint` for the configured `baseUrl`, for first-party Anthropic models also the `ANTHROPIC_BASE_URL` or Foundry `FOUNDRY_BASE_URL` reroute applied at request time, and for Factory Droid models the `baseUrl` origin. A custom or rerouted endpoint imposes its own body limit.
229
229
 
230
- `request-body-byte-limit` is the largest request body the host accepts (Factory Droid's hosted routes: 4,500,000 bytes), under the same gate. Where it is set, the byte clamp keeps the inline images of the newest user message and then of the newest image-bearing tool result even past `inline-image-byte-budget`, each only while the kept images fit the limit less the request's other serialized bytes, and evicts older images instead; read through `resolveRequestBodyByteLimit`.
230
+ `request-body-byte-limit` is the largest request body the host accepts (Factory Droid's hosted routes: 4,500,000 bytes; Anthropic's Messages API: 128,000,000 bytes), under the same gate. Where it is set, the byte clamp also keeps inline images within what the request's other serialized bytes leave of the limit, and keeps the inline images of the newest user message and then of the newest image-bearing tool result even past `inline-image-byte-budget`, each only while the kept images fit the limit less the request's other serialized bytes, and evicts older images instead; read through `resolveRequestBodyByteLimit`.
231
231
 
232
232
  `catalog-endpoint-budgets #true` makes these host budgets apply whenever a request reaches the provider's own catalog endpoint (an unset `baseUrl`, or an `endpoint-hosts` host; see `isCatalogEndpointUrl`), for a hosted gateway such as Factory Droid whose compat names no official endpoint, or a first-party provider such as DeepSeek whose `openai-completions` compat resolves no `officialEndpoint`. Unassigned, they apply only on the official endpoint.
233
233
 
@@ -258,6 +258,8 @@ Opted in: Muse Code `muse-spark-1.3`, `muse-spark-1.3-contributor`, and the four
258
258
 
259
259
  The routed-subscription registry axes (`upstream-rotation`, `region-upstreams-global|us|eu`, `region-limits-eu`, `credit-rates`, `list-price-from`, `routing-family`, `policy-aliases`, `entitlement`, `default-reasoning-off`) describe a gateway whose proxy fans one model out to several upstreams. They are read through `src/compat/factory-droid.ts` by Factory Droid discovery and its request provider, not materialized by `buildModel`. A provider-wide `region-upstreams-*` rule is the upstream serving table and a model rule replaces it for that region. `list-price-from "<provider>" ["<id>"]` shows a bundled row's list price beside the subscription's own billing; unlike seed values it is resolved at runtime and degrades to the seed's zero cost when the row is gone. See [`providers/factory-droid.kdl`](providers/factory-droid.kdl), whose wire and billing pool per model are `api-routes` and `quota-tiers` rules in `runtime/behavior.kdl`.
260
260
 
261
+ `credit-rates` accepts the same optional `effective-rates` block of named dated cards as `cost-patch`, parsed by the same code: each card has a distinct ISO UTC `effective-from` and any of `input`/`output`/`cache-read`, and the latest card at or before the moment the model browser renders overwrites the legs it names. A vendor credit promotion is two cards, the discounted rate from its start and the base rate again from its end, so a card left behind after the end changes nothing. See [`providers/factory-droid.kdl`](providers/factory-droid.kdl).
262
+
261
263
  ### Time-based pricing
262
264
 
263
265
  The catalog object axis `time-based-cost` materializes into `ModelCost.timeBased`. It uses **named child objects**, not KDL arrays or repeated anonymous windows. For example, inside a matching provider/model scope:
@@ -415,7 +417,7 @@ auth "anthropic" {
415
417
 
416
418
  Login kinds:
417
419
 
418
- - `login "api-key" { auth-url "…"; instructions "…"; prompt "…" placeholder="…"; empty-fallback "…"; normalize "strip-bearer"; validate … }` — `validate "chat-completions" base-url= model= tolerate-model-denied= max-tokens-field= max-tokens=`, `validate "anthropic-messages" base-url= model=`, or `validate "models-endpoint" url= base-url-env= headers-hook=`; all accept `label=` (error-message label, defaults to `name`), `optional=#true` (only auth failures reject), and `trust-forbidden=#true` (requires `optional=#true`; a 403 no longer rejects, so only a 401 does).
420
+ - `login "api-key" { auth-url "…"; instructions "…"; prompt "…" placeholder="…"; empty-fallback "…"; normalize "strip-bearer"; validate … }` — `validate "chat-completions" base-url= model= tolerate-model-denied= max-tokens-field= max-tokens=`, `validate "anthropic-messages" base-url= model=`, or `validate "models-endpoint" url= base-url-env= base-url-path= headers-hook=` (`base-url-path`, default `/models`, is appended to the `base-url-env` value and needs it); all accept `label=` (error-message label, defaults to `name`), `optional=#true` (only auth failures reject), and `trust-forbidden=#true` (requires `optional=#true`; a 403 no longer rejects, so only a 401 does).
419
421
  - `login "oauth-code" { … }` as above; `token`/`refresh` `params` values may use `{code}`, `{state}`, `{redirect_uri}`, `{code_verifier}`, `{client_id}`, `{client_secret}`, `{refresh_token}`, `{scope}`; the standard grant parameters are sent unless `standard=#false`.
420
422
  - `login "device-code" { client-id …; base-url "…"; scopes …; headers-hook "…"; device url="{base}/…" body="form" { params {…} headers {…} }; token url="…" url-hook="…"; response user-code= device-code= verification-uri= verification-uri-complete= interval= expires-in=; instructions "Enter code: {user_code}"; credential {…}; userinfo …; after-exchange hook=… }`.
421
423
  - `login "custom" hook="name"` — the whole flow is a named `@linxiraos/pi-ai` hook (`src/registry/hooks/custom.ts`).
@@ -10,4 +10,4 @@ login-order "openai-codex" "anthropic" "zai" "zai-coding-plan" "kimi-code" "open
10
10
  "qianfan" "venice" "siliconflow" "siliconflow-cn" "synthetic" "nanogpt" "wafer-serverless" "coreweave" \
11
11
  "vercel-ai-gateway" "cloudflare-ai-gateway" "cloudflare-workers-ai" "snowflake" "litellm" "kilo" "zenmux" "opencode-zen" "opencode-go" \
12
12
  "yolo-auto" "tavily" "kagi" "exa" "parallel" "typesafe" "ollama" "ollama-cloud" "lm-studio" "llama.cpp" "vllm" \
13
- "gmi-cloud" "stencil" "singularityapi-dev" "singularityapi-tech" "coralbricks"
13
+ "gmi-cloud" "stencil" "singularityapi-dev" "singularityapi-tech" "coralbricks" "modular" "mistral" "scaleway"
@@ -1,3 +1,7 @@
1
+ // Browser sign-in mirrors the Mistral Vibe CLI and mints a regular API key billed
2
+ // against the plan's Vibe Code quota; the hook returns it as a plain API key.
1
3
  auth "mistral" {
2
4
  name "Mistral"
5
+ env "MISTRAL_API_KEY"
6
+ login "custom" hook="mistral-vibe-sign-in"
3
7
  }
@@ -0,0 +1,9 @@
1
+ auth "modular" {
2
+ name "Modular"
3
+ login "api-key" {
4
+ auth-url "https://console.modular.com/api_keys"
5
+ instructions "Create an API key in the Modular Console"
6
+ prompt "Paste your Modular API key" placeholder="..."
7
+ validate "models-endpoint" label="Modular" url="https://api.modular.com/v1/models"
8
+ }
9
+ }
@@ -0,0 +1,17 @@
1
+ auth "scaleway" {
2
+ name "Scaleway"
3
+ login "api-key" {
4
+ auth-url "https://console.scaleway.com/iam/api-keys"
5
+ instructions "Create an API key on the Scaleway console and paste its Secret Key (SCW_SECRET_KEY)"
6
+ // Scaleway secret keys are UUID-shaped opaque strings with no `sk-`
7
+ // prefix, so the placeholder must not teach a credential shape the
8
+ // console never issues.
9
+ prompt "Paste your Scaleway secret key" placeholder="..."
10
+ normalize "strip-bearer"
11
+ // `/v1/models` is key-protected: it answers 401 without a bearer key
12
+ // and 403 to a rejected one (verified 2026-10-21), so login validates
13
+ // the pasted key there. The probe bills nothing, unlike a
14
+ // chat-completions round-trip against a prepaid balance.
15
+ validate "models-endpoint" label="Scaleway" url="https://api.scaleway.ai/v1/models"
16
+ }
17
+ }
@@ -8,6 +8,7 @@ auth "typesafe" {
8
8
  auth-url "https://console.typesafe.ai/"
9
9
  instructions "Create or copy your API key from the TypeSafe console."
10
10
  prompt "Paste your TypeSafe API key" placeholder="API key"
11
- validate "models-endpoint" label="TypeSafe" url="https://api.typesafe.ai/v1/models" base-url-env="TYPESAFE_BASE_URL"
11
+ // TYPESAFE_BASE_URL is an origin without `/v1` (the SDK appends `/v1/systemone`).
12
+ validate "models-endpoint" label="TypeSafe" url="https://api.typesafe.ai/v1/models" base-url-env="TYPESAFE_BASE_URL" base-url-path="/v1/models"
12
13
  }
13
14
  }
@@ -29,6 +29,11 @@ class "anthropic" {
29
29
  // back as text (`reasoning_extraction`, issue #6093).
30
30
  classifier-cot-extraction #true
31
31
  thinking-replay-tokens "output"
32
+ // Summarized thinking repeats one progress line verbatim while long hidden
33
+ // reasoning runs ("Still writing the parser..." six-plus times back to
34
+ // back), which reads as an exact cycle. Claude has no runaway-loop failure
35
+ // that warrants the guard, so it never discards a turn here.
36
+ thinking-loop-guard "off"
32
37
  // verified: billing matched this formula on Opus 4.7+ and Fable 5.1.
33
38
  image-tokenization {
34
39
  regime "anthropic-patch"
@@ -90,10 +90,11 @@ class "deepseek" {
90
90
  }
91
91
  // V4.1 Flash is natively multimodal (vision encoder + projector, image-text
92
92
  // pre-training) but its release id carries no `vision` token to key on.
93
+ // The leading glob also covers publisher-namespaced ids (`ds/deepseek-flash`).
93
94
  // Same priority as the V4.1 Flash carve-out: the OpenCode Go provider rule
94
95
  // declares the same value for its `deepseek-flash` lane and would otherwise
95
96
  // tie at equal rank.
96
- models "deepseek-flash" priority=10 {
97
+ models "*deepseek-flash" priority=10 {
97
98
  strip-image-input #false
98
99
  }
99
100
  // DSML is the model's own tool-call grammar, not a host quirk: any server
@@ -101,7 +102,7 @@ class "deepseek" {
101
102
  // leaks it into content — hosted gateways, local backends, and custom
102
103
  // providers alike. On hosts that parse it the healer sees no markup.
103
104
  stream-markup-healing-pattern "dsml"
104
- thinking-loop-guard "deepseek"
105
+ thinking-loop-guard "semantic"
105
106
  // V4 reasoning reaches omp as its plaintext trace on every host, and the
106
107
  // revision pins the weights (flash 4.0 / 4.1, pro 4.0). Earlier lineages
107
108
  // classify too coarsely to carry: `r1` also matches the R1 distills.
@@ -149,7 +149,7 @@ class "gemini" {
149
149
  }
150
150
  }
151
151
 
152
- thinking-loop-guard "gemini"
152
+ thinking-loop-guard "semantic"
153
153
  }
154
154
 
155
155
  // Google Search grounding is a Gemini 2+ lineage capability on every Gemini transport.
@@ -84,14 +84,14 @@ class "openai" {
84
84
  on-api "openai-responses" {
85
85
  revision ">=5" {
86
86
  web-search "openai"
87
- web-search-model "gpt-5.6-luna"
87
+ web-search-model "gpt-6-luna"
88
88
  hosted-image #true
89
89
  image-model "gpt-image-2"
90
90
  }
91
91
  }
92
92
  on-api "openai-codex-responses" {
93
93
  revision ">=5" {
94
- web-search-model "gpt-5.6-luna"
94
+ web-search-model "gpt-6-luna"
95
95
  hosted-image #true
96
96
  image-model "gpt-image-2"
97
97
  }
@@ -67,7 +67,7 @@ class "xai" {
67
67
  }
68
68
  }
69
69
  }
70
- thinking-loop-guard "xai"
70
+ thinking-loop-guard "semantic"
71
71
  }
72
72
 
73
73
  // Same-provider swap targets for hosted search and image generation.
@@ -78,12 +78,16 @@ provider "anthropic" {
78
78
  // Code's `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS` kill switch for gateways
79
79
  // that reject experimental beta fields.
80
80
  honors-claude-code-beta-kill-switch #true
81
- // Messages requests cap at 32 MB. Reserve 8 MB for text, tools, and JSON
82
- // framing when retaining inline base64 images in a long conversation.
83
- // Applied only on the official endpoint; a custom baseUrl has its own limit.
81
+ // Messages requests cap at 128 MB. Reserve 8 MB for text, tools, and JSON
82
+ // framing when retaining inline base64 images in a long conversation; the
83
+ // body limit keeps images within what the other bytes leave, and lets the
84
+ // newest user message's and tool result's images use the reserve.
85
+ // Applied only on the official endpoint; a custom baseUrl has its own limit
86
+ // (Bedrock 20 MB; Vertex, Foundry, and Claude Platform on AWS 30-32 MB).
84
87
  // https://platform.claude.com/docs/en/api/overview#request-size-limits
85
88
  on-api "anthropic-messages" {
86
- inline-image-byte-budget 24000000
89
+ inline-image-byte-budget 120000000
90
+ request-body-byte-limit 128000000
87
91
  }
88
92
  // The official endpoint carries at most 600 images and documents per
89
93
  // request, 100 on models with a 200k-token window: every Claude line before
@@ -387,6 +387,16 @@ provider "cursor" {
387
387
  cache-write 0
388
388
  }
389
389
  }
390
+ // DeepSeek V4.1 Flash 1017: $0.30/$1.20, cache read $0.006, no write fee.
391
+ // The bare id and every reasoning-effort wire id share one card.
392
+ models "deepseek-v41-flash-1017*" {
393
+ cost-patch {
394
+ input 0.3
395
+ output 1.2
396
+ cache-read 0.006
397
+ cache-write 0
398
+ }
399
+ }
390
400
  // Gemini 3 Flash: $0.50/$3.00, cache read $0.05.
391
401
  models "gemini-3-flash" {
392
402
  cost-patch {
@@ -7,8 +7,8 @@ provider "deepseek" {
7
7
 
8
8
  // DeepSeek's vision guide documents 600 images per request and a 48 MiB
9
9
  // request body. OMP reserves 8 MiB for text, tools, and the JSON envelope
10
- // (48 MiB - 8 MiB = 40 MiB); Anthropic's 24,000,000-byte image budget under
11
- // its 32 MB body uses an 8 MB reserve. DeepSeek documents MiB, so this uses
10
+ // (48 MiB - 8 MiB = 40 MiB); Anthropic's 120,000,000-byte image budget under
11
+ // its 128 MB body uses an 8 MB reserve. DeepSeek documents MiB, so this uses
12
12
  // an 8 MiB reserve. The split is OMP's conservative margin, not a
13
13
  // DeepSeek-documented figure. A custom baseUrl keeps the conservative
14
14
  // catalog floor because the gateway's own limits are unknown.