diff --git a/native/omk-providers/README.md b/native/omk-providers/README.md index ecd4f53e78..2b1008c5aa 100644 --- a/native/omk-providers/README.md +++ b/native/omk-providers/README.md @@ -1,9 +1,9 @@ # omk-providers — first offline Anthropic slice -This unpublished crate adopts the exact B1-reviewed transport graph and provides a -synthetic request builder, byte-chunk SSE replay library and `replay-anthropic` -stdin/stdout executable. It is **not a live provider, core selector or completed K1**. -No production Node provider behavior changes. +This unpublished crate adopts the exact B1-reviewed transport graph and provides +synthetic replay plus an explicit catalog-selected Anthropic dispatch library and +`provider` executable. It is **not the installed provider host, core selector or +completed K1**. No production Node provider behavior changes. Approval, implementation scope and validation are recorded in [the K1 adoption record](../../specs/120-rust-core/k1-adoption.md). @@ -34,6 +34,26 @@ consuming CR at the end of a chunk can prematurely flush an empty event on LF. Intact CRLF succeeds. Empty input also preserves Node's current empty success. Fixing these baselines is separate work, not a reason to rewrite an oracle. +## Incremental response consumption + +`anthropic::Stream` exposes the existing recorded text-model decoder/reducer as +`new`, `feed`, `take_events` and consuming `finish(error, aborted)`. Drain after +construction and every feed, including a failed feed. Complete semantic frames +are available before EOF; drained events are never returned twice. `finish` +flushes trailing EOF frames and returns undrained events plus one terminal event +and the final message. An earlier parser failure takes precedence over a later +transport/sink diagnostic. Feeding after failure returns the same latched error. + +The stream retains decoder/reducer state, not the original chunks, and enforces +an 8 MiB total wire bound. Callers still own transport cancellation, deadlines, +backpressure and prompt event draining. Existing replay and its executable use +this same state machine, preserving all frozen event/result and tool-argument +oracles. A loopback transport test waits for a delivered text event before sending +the remaining response, and verifies socket closure and recorded partial results +when cancelled at that event. This does not add a production provider dispatcher, +mutable partial snapshots, cost/auth/catalog policy or vision response support. +See [the incremental stream unit](../../specs/120-rust-core/k1-stream.md). + ## JSON repair and partial tool arguments A separate Node-only oracle, `scripts/record-anthropic-json-fixtures.mjs`, records @@ -63,14 +83,220 @@ not apply to default replay. See [the JSON unit record](../../specs/120-rust-cor The optional request `history` array accepts `{role: "user" | "assistant", text}` before the existing final `user` string. Twelve independently recorded Node/SDK requests cover multi-turn text, Unicode, blank filtering and exact serialized -body bytes through the Rust library and executable. Unsupported roles or fields -are refused. This does not add tool-result, image, thinking, cross-provider or -live-dispatch support. See [the text-history unit](../../specs/120-rust-core/k1-text-history.md). +body bytes through the Rust library and executable. The original text corpus remains +unchanged. See [the text-history unit](../../specs/120-rust-core/k1-text-history.md). `node scripts/record-anthropic-history-fixtures.mjs --check` checks this separate oracle without changing either existing provider corpus. Its script regression is included by the repository's normal script-test discovery. +## Tool and thinking conversation history + +`history` additionally accepts assistant `content` blocks (`text`, `thinking`, +`toolCall`) with an optional `stopReason`, and `toolResult` messages with +`toolCallId`, text `content` blocks and `isError`. The earlier `{role, text}` input +still works. These shapes are mutually exclusive; unsupported fields are refused. + +The separate 25-case Node oracle records exact request bodies and non-runtime +headers before Rust implementation. The library and executable preserve same-model +call IDs, consecutive-result grouping, missing-result synthesis, orphan-result +filtering, error/aborted-turn removal, signed/redacted thinking and unsigned-thinking +text fallback. This builds requests only: it neither executes tools nor owns an +agent loop. Run `node scripts/record-anthropic-tool-history-fixtures.mjs --check`. + +History is limited to 4096 messages and 4096 blocks per message. Tool arguments use +the existing 1 MiB/64-level safe-number JSON guard. Arguments preserve recorded +Node JSON key order; equivalence for arbitrary JSON number/escape spellings is not +claimed. Cross-provider history, OAuth, caching and live dispatch remain unsupported. +See [the tool-history unit](../../specs/120-rust-core/k1-tool-history.md). + +## User arrays and non-vision image downgrade + +For the existing text-only synthetic model, user `history` accepts `content` arrays +of `{type: "text", text}` and `{type: "image", data, mimeType}`. Tool-result arrays +accept the same blocks. Images are replaced with the Node role-specific omission +text; adjacent image placeholders are deduplicated before user blank filtering. +User arrays remain block arrays; tool-result text is joined with newlines, including +blank blocks. Empty user arrays still interrupt tool flow before being omitted. +The original `{role, text}` and final `user` string remain unchanged. + +The separate 26-case Node/SDK oracle compares request bytes in the library and +executable. Run `node scripts/record-anthropic-content-fixtures.mjs --check`. +The 4096-block limit counts inputs before deduplication, including orphan results. +Image payloads are never decoded, fetched or transmitted. This does not enable +vision, dimension guards or a model-capability option; unknown fields are refused. +See [the content-history unit](../../specs/120-rust-core/k1-content-history.md). + +## Synthetic vision requests and image header guard + +The separately recorded `synthetic-anthropic-vision` model accepts image blocks +in user and tool-result history. The existing text-only model is unchanged. +User images retain order and their original base64/MIME strings. Tool results use +mixed blocks when images remain, adding `(see attached image)` only for image-only +results; text-only results still join with newlines. + +The Node-derived PNG/JPEG/GIF/WebP header guard replaces recognized dimensions +above 1900px with the exact Node omission text. It decodes at most the first 87384 +UTF-16 code units (up to 65538 bytes), including Node's permissive base64 behavior. +Unknown/short/malformed formats remain unchanged; this is not an image validator +or proof the API will accept them. There is no image fetching, resizing or dispatch. + +`node scripts/record-anthropic-vision-fixtures.mjs --check` verifies 50 independent +Node/SDK request recordings through both Rust library and CLI tests. Vision replay +admits only the empty response used by the request oracle; nonempty responses and +cancellation remain refused until independently recorded. See +[the vision unit record](../../specs/120-rust-core/k1-vision-history.md). + +## Credential snapshot resolution + +`auth::Snapshot` resolves a host-supplied credential-store snapshot in Node priority +order: nonempty runtime override, stored API-key config, provider-selected environment +key, then optional model-config fallback. Unreadable/malformed stores block substitution; +a stored empty key or unresolved template does not fall through to another account. +`auth::resolve_config` supports the Node literal/`$NAME`/`${NAME}` grammar and `$$`/`$!` +escapes with caller-supplied environment lookup. Keys have redacted `Debug` output. + +The independent real Node `AuthStorage` oracle contains 52 cases, compared through +both library and `replay-auth`. Run `node scripts/record-auth-fixtures.mjs --check`. +This offline diagnostic explicitly prints resolved **supplied stdin values**; use only +synthetic keys, not real credentials. It never reads auth files or ambient environment. +Snapshots are read-only and must be refreshed by their host before use. File storage, +locking, OAuth refresh, command execution and provider environment-name policy remain +unimplemented. The separate catalog/dispatch adapter below consumes these snapshots. +Commands and OAuth entries return typed host-required refusals rather than falling back. See +[the auth-resolution unit](../../specs/120-rust-core/k1-auth-resolution.md). + +## Explicit catalog and authenticated dispatch + +`catalog::Catalog::load` embeds 2,245 public Node models and applies host-supplied +models.json text. Sixteen independently recorded overlays cover defaults, inheritance, +replacement, ordering, nested compatibility/cost merges, headers, visibility and invalid +configuration. `view` takes authenticated provider IDs from the host; it does not infer +login status from text. Invalid overlays retain builtins for inspection but dispatch +refuses them; invalid explicit visibility fails closed. Overlay input is bounded at 1 MiB. +This is a frozen catalog, not runtime discovery, refresh or OAuth model mutation. + +`dispatch::prepare` selects an `anthropic-messages` model, resolves explicit credential +sources and headers, and reuses the existing request/transport/stream owners. Model-config +key fallback requires `KeySources.include_fallback`; a supplied fallback takes precedence +over catalog configuration. Empty/unresolved stored keys, unreadable stores, commands and +OAuth never silently substitute another account. `Prepared` has no Debug/Serialize. + +The adapter defaults to no cache, one attempt and explicit maxTokens. Optional typed +thinking/temperature/metadata/tool-choice policies are described below. Copilot, Cloudflare +and Kimi special client policies and OAuth bearer tokens remain refused. Recorded eager-tool +and beta headers, configured header precedence and catalog image request capability are reused. +Ten independent Node SDK cases compare body bytes, non-runtime headers, semantic events +and final token/content projections through real loopback library and executable paths. +This does not establish vision-response, arbitrary-model, cache/thinking/retry or live TLS parity. + +`provider catalog` reads `{overlay?, providers?, authenticated?}` JSON from stdin. +`provider stream` reads `{overlay?, provider, input, store?, runtime?, environment?, env?, +timeoutMs?, maxResponseBytes?}` and flushes `{event: ...}` NDJSON, then `{result: ...}`. +Both refuse unknown fields and stdin above 2 MiB. `input` has the replay request shape, +with a catalog model ID. The CLI explicitly enables the catalog key fallback and never +reads ambient environment/auth files. Its `store` and `env` are caller-supplied snapshots. +Use synthetic credentials for offline diagnostics. Provider errors are sanitized; a valid +stream protocol with an error result is not a successful provider completion. The CLI's +exit status reports protocol execution; callers must inspect the terminal event/result. +Callbacks must return promptly; blocked output cannot be preempted by the deadline. + +Run `node scripts/record-catalog-fixtures.mjs --check` and +`node scripts/record-dispatch-fixtures.mjs --check` to check provenance without rewriting. +See [the catalog/dispatch unit](../../specs/120-rust-core/k1-catalog-dispatch.md). + +## Explicit Anthropic request options + +Catalog dispatch additionally accepts `input.options` with `temperature`, `thinkingEnabled`, +`thinkingBudgetTokens`, `thinkingDisplay`, `effort`, `metadata` and `toolChoice`. +Thirty-two independently recorded Node SDK cases compare exact request bytes and projected +responses through both existing loopback library and actual CLI tests. Options preserve +non-reasoning gates, thinking/temperature exclusion, classic zero-budget fallback to 1024, +adaptive effort/display, explicit disabled-thinking compatibility, user_id-only metadata +and the auto/any/none/named-tool choice shapes. Eight additional Node model-name observations +check the default disabled-thinking gate and explicit compatibility overrides. + +Unknown options and invalid enum/shape input are refused. This bounded interface also +refuses temperature outside 0 through 1, non-u32 budgets and empty/over-256-byte named tools; +these are admission bounds, not claims that Node rejects the same values. Legacy synthetic +replay refuses `options` rather than silently ignoring them. Existing replay corpora remain +unchanged. No ambient defaults, simple-reasoning inference, OAuth or retry/error-policy +parity, provider-model acceptance or installed adoption is added by that unit. The explicit +cache/system-boundary follow-up is described below. +Run `node scripts/record-anthropic-policy-fixtures.mjs --check`. +See [the request-policy record](../../specs/120-rust-core/k1-request-policy.md). + +## Explicit Anthropic request cache + +Catalog dispatch accepts `input.options.cacheRetention` as `none`, `short` or `long`. +Long retention includes a one-hour TTL only when model compatibility allows it. Cache +control is attached to the final supplied tool when allowed and to the final converted +user text/image/tool-result block. Tool order and schemas are canonicalized as described +in the tool-schema section below; the final tool is selected after sorting. + +`input.systemPromptCacheBoundary` uses UTF-16 units. A valid positive integral boundary +splits stable prefix from dynamic suffix and caches only the prefix. Explicit invalid +metadata (including null), or `systemPromptCacheBoundaryBypass: true`, leaves the system +prompt uncached; conversation/tool cache is independent. Splitting a surrogate pair +removes unpaired units exactly as the Node sanitizer does. Boundary presence is retained +instead of conflating missing with null. Cache/bypass shapes are strict, and synthetic +replay still refuses new policies. Omitted retention preserves the bounded adapter's +previous no-cache behavior; Node's ambient/default retention is not inferred. + +Thirty-two new independent Node SDK cases match exact library/executable socket requests. +All prior corpora remain unchanged. Run +`node scripts/record-anthropic-cache-fixtures.mjs --check`. +See [the cache unit](../../specs/120-rust-core/k1-request-cache.md). +This is explicit API-key request caching, not provider acceptance, cache-affinity policy, +OAuth, caching success/billing, full K1 or installed runtime adoption. + +## Empty thinking-signature compatibility + +Catalog-selected `compat.allowEmptySignature` now preserves nonblank same-model thinking +with an empty signature when the original signature is missing or ECMAScript-blank. +Without the flag it remains plain text. Compatibility applies even when `input.options` +is absent. Valid signatures, redacted opaque blocks and blank-thinking omission retain +existing behavior; replay defaults and malformed-redacted refusals are unchanged. +Eighteen independent SDK requests match both library and executable sockets, including +BOM versus NEL trim behavior and empty redacted data. This is not cross-model history, +OAuth or full provider parity. Run +`node scripts/record-anthropic-signature-fixtures.mjs --check`. +See [the signature unit](../../specs/120-rust-core/k1-thinking-signature.md). + +## Tool schema canonicalization and collation + +Every request now applies the Node `stableTools` contract inside the existing builder. +Tools are sorted by name with en-US/ICU root order for `[A-Za-z0-9_-]`: punctuation, +digits, then letters, with lowercase before uppercase on ties. `properties` is +re-emitted in JSON.parse key order: array-index keys first, then UTF-16 order. The +last duplicate key wins, `required: null` is dropped, numbers use ECMAScript +formatting and non-object roots become `{}`. Five independent SDK requests match through +the library and executable; 25 `stableToolSchema` literals match through the library. + +Names outside that alphabet, duplicate names and lone-surrogate strings are refused +instead of being misordered. Those are admission bounds, not Node parity claims. One +obsolete raw-order boundary expectation was replaced. Other corpora are unchanged. Run +`node scripts/record-anthropic-tool-schema-fixtures.mjs --check`. +See [the tool-schema unit](../../specs/120-rust-core/k1-tool-schema.md). This unit does +not cover other provider APIs, cache-affinity keys, OAuth name mapping or full K1. + +## OpenAI chat-completions request bytes + +`openai_completions::build_request` and the `request-openai-completions` executable +build the exact `{url, headers, body}` that Node `streamOpenAICompletions` and the +`openai` SDK send for a narrow API-key surface. That surface is system/developer +role, user strings and text blocks, assistant text, tools with canonical parameters +and `strict`, tool choice, temperature and both max-token fields. The caller passes +resolved compatibility flags; provider/URL detection is not ported. Twenty-one +independent Node requests match through both paths. Base URLs that WHATWG +serialization could rewrite and unsupported history shapes are refused. Later +follow-ups add images, tool history, caller-resolved `thinkingFormat`/`reasoningEffort` +parameters (`--effort` corpus) and `prompt_cache_key`/`prompt_cache_retention` +(`--cache` corpus, which also admits `api.openai.com`). There is no +response parser, dispatch or transport wiring yet. +Run `node scripts/record-openai-completions-fixtures.mjs --check`. +See [the OpenAI completions unit](../../specs/120-rust-core/k1-openai-completions-request.md). + ## Checks From the repository root, with a credential-free build environment: @@ -99,20 +325,36 @@ node --input-type=module -e 'import fs from "node:fs"; const c=JSON.parse(fs.rea `abortAfterChunks` optionally models cancellation at a consumed chunk boundary. Unknown input/oracle fields are refused. The request builder accepts only the -recorded synthetic model, API-key/no-cache user/system/tool surface. Replay has -an 8 MiB input limit, 1 MiB SSE buffer/event limit and bounded CLI input. -Beyond the bounded JSON corpus, OAuth, cache policy, model catalog, images, -history conversion, request overrides, HTTP errors/retries, proxy/deadline +recorded synthetic models, API-key/no-cache user/system/tool surface. Replay has +a 16 MiB recording-stdin limit and an 8 MiB stream/replay wire limit, 1 MiB SSE buffer/event limit and bounded CLI input. +Beyond the bounded JSON and image-request corpora, OAuth, cache policy, model catalog, +cross-provider history, request overrides, HTTP errors/retries, proxy/deadline semantics and a live network dispatcher remain outside this unit. ## Transport and distribution boundaries -`transport::build_client` is a build-only probe: it explicitly installs Ring, -refuses a preexisting process crypto-provider owner, disables redirects/retries -and proxies, applies a 30-second timeout and retains certificate verification. -It exposes no credential or dispatch integration. These are probe policies, not -claimed Node transport parity. Native trust stores and revocation behavior need -separate native-platform tests. +`transport::Transport::post` now sends an explicit single-attempt HTTP POST and +streams bounded response bytes to a synchronous consumer, with status/headers +available before each chunk. It uses the existing Ring/native-root client, no +redirects/retries/inherited proxies, and its existing 30-second ceiling. A caller +also supplies an absolute Tokio deadline and an irreversible cancellation handle; +headers and body share that deadline. There is no background request task. + +Only HTTPS or numeric loopback HTTP is admitted. URL credentials/fragments, +caller-supplied framing headers and requests/response limits above 8 MiB are +refused. Bytes over the response cap are never delivered to the consumer. Errors +are typed and do not include endpoints, credentials, request bodies or reqwest's +raw diagnostic text. HTTP error status/body is delivered once, not retried or +translated into provider errors. Dropping the future cancels local I/O, not work +already accepted by the server. Consumers must return promptly; synchronous +callbacks cannot be preempted. + +Thirteen real loopback tests run without external networking, including transmission +of an unchanged independently recorded SDK request and response replay. They test +transport ownership/policy, not Node SDK transport parity or production provider +wiring. No live credential/provider, TLS handshake, proxy, retry, native trust +store/revocation or macOS/Windows acceptance is claimed. See +[the transport unit record](../../specs/120-rust-core/k1-transport.md). The exact lock differs from the reviewed temporary lock only in the root package name. The guard checks the restored digest, direct pins/features, notice digest diff --git a/native/omk-providers/catalog.json b/native/omk-providers/catalog.json new file mode 100644 index 0000000000..b7a40422b7 --- /dev/null +++ b/native/omk-providers/catalog.json @@ -0,0 +1,57833 @@ +{ + "schema": "omk.model-catalog.v1", + "source": { + "scripts/fixtures/catalog-recorder.ts": "9f4bdd03305282699b57fefaef9811eea8a7dfdf639d91552dbd54131e74b1ee", + "packages/ai/src/models.generated.ts": "aea6840952e64f7a2a4f70ee80d457a3bbcd281e78746b213ef94fbaf2595a4e", + "packages/ai/src/models.ts": "5ba2350fc544a9b2e281f714d40e2eeaea179ffb0e1e0aaad246cb09cfb2b333", + "packages/ai/src/providers/grok-thinking.ts": "f4bc6166052f27deca753c134074125d36b183af0b66bd8b77fc6990fdd1fca2", + "packages/coding-agent/src/core/model-registry.ts": "53fba00330a076d14b020ed242903387e5b16683ab39bb5048dcf7fc8b27b7ff", + "packages/coding-agent/src/core/model-registry-schema.ts": "cc63f02dddf2a7835ed0971533e8b60e6a337bb0646cffeda321cd24a199ac4b", + "packages/coding-agent/src/utils/json.ts": "7ee95ee422abcc3610033e27d1e1da08ebadac0502b6326a1540b64843a084dd" + }, + "models": [ + { + "id": "amazon.nova-2-lite-v1:0", + "name": "Nova 2 Lite", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.33, + "output": 2.75, + "cacheRead": 0.0825, + "cacheWrite": 0.33 + }, + "contextWindow": 1000000, + "maxTokens": 65535 + }, + { + "id": "amazon.nova-lite-v1:0", + "name": "Nova Lite", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.06, + "output": 0.24, + "cacheRead": 0.015, + "cacheWrite": 0.06 + }, + "contextWindow": 300000, + "maxTokens": 10000 + }, + { + "id": "amazon.nova-micro-v1:0", + "name": "Nova Micro", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.035, + "output": 0.14, + "cacheRead": 0.00875, + "cacheWrite": 0.035 + }, + "contextWindow": 128000, + "maxTokens": 10000 + }, + { + "id": "amazon.nova-pro-v1:0", + "name": "Nova Pro", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.8, + "output": 3.2, + "cacheRead": 0.2, + "cacheWrite": 0.8 + }, + "contextWindow": 300000, + "maxTokens": 10000 + }, + { + "id": "anthropic.claude-fable-5", + "name": "Claude Fable 5", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic.claude-fable-5-1", + "name": "Claude Fable 5.1", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 0.25, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic.claude-fable-5-2", + "name": "Claude Fable 5.2", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 8, + "output": 40, + "cacheRead": 0.2, + "cacheWrite": 10 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic.claude-haiku-4-5-20251001-v1:0", + "name": "Claude Haiku 4.5", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "anthropic.claude-opus-4-1-20250805-v1:0", + "name": "Claude Opus 4.1", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 15, + "output": 75, + "cacheRead": 1.5, + "cacheWrite": 18.75 + }, + "contextWindow": 200000, + "maxTokens": 32000 + }, + { + "id": "anthropic.claude-opus-4-5-20251101-v1:0", + "name": "Claude Opus 4.5", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "anthropic.claude-opus-4-6-v1", + "name": "Claude Opus 4.6", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5.5, + "output": 27.5, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic.claude-opus-4-7", + "name": "Claude Opus 4.7", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic.claude-opus-4-8", + "name": "Claude Opus 4.8", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic.claude-opus-5", + "name": "Claude Opus 5", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic.claude-opus-5-5", + "name": "Claude Opus 5.5", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.2, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic.claude-sonnet-4-5-20250929-v1:0", + "name": "Claude Sonnet 4.5", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "anthropic.claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3.3, + "output": 16.5, + "cacheRead": 0.33, + "cacheWrite": 4.125 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic.claude-sonnet-5", + "name": "Claude Sonnet 5", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "apac.amazon.nova-lite-v1:0", + "name": "Nova Lite (APAC)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.063, + "output": 0.252, + "cacheRead": 0.01575, + "cacheWrite": 0.063 + }, + "contextWindow": 300000, + "maxTokens": 10000 + }, + { + "id": "apac.amazon.nova-micro-v1:0", + "name": "Nova Micro (APAC)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.037, + "output": 0.148, + "cacheRead": 0.00925, + "cacheWrite": 0.037 + }, + "contextWindow": 128000, + "maxTokens": 10000 + }, + { + "id": "apac.amazon.nova-pro-v1:0", + "name": "Nova Pro (APAC)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.84, + "output": 3.36, + "cacheRead": 0.21, + "cacheWrite": 0.84 + }, + "contextWindow": 300000, + "maxTokens": 10000 + }, + { + "id": "apac.anthropic.claude-sonnet-4-20250514-v1:0", + "name": "Claude Sonnet 4 (APAC)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "au.anthropic.claude-haiku-4-5-20251001-v1:0", + "name": "Claude Haiku 4.5 (AU)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.1, + "output": 5.5, + "cacheRead": 0.11, + "cacheWrite": 1.375 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "au.anthropic.claude-opus-4-6-v1", + "name": "AU Anthropic Claude Opus 4.6", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5.5, + "output": 27.5, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "au.anthropic.claude-opus-4-7", + "name": "Claude Opus 4.7 (AU)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5.5, + "output": 27.5, + "cacheRead": 0.55, + "cacheWrite": 6.875 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "au.anthropic.claude-opus-4-8", + "name": "Claude Opus 4.8 (AU)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5.5, + "output": 27.5, + "cacheRead": 0.55, + "cacheWrite": 6.875 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "au.anthropic.claude-opus-5", + "name": "Claude Opus 5 (AU)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5.5, + "output": 27.5, + "cacheRead": 0.55, + "cacheWrite": 6.875 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "au.anthropic.claude-opus-5-5", + "name": "Claude Opus 5.5 (AU)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4.4, + "output": 22, + "cacheRead": 0.22, + "cacheWrite": 5.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "au.anthropic.claude-sonnet-4-5-20250929-v1:0", + "name": "Claude Sonnet 4.5 (AU)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3.3, + "output": 16.5, + "cacheRead": 0.33, + "cacheWrite": 4.125 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "au.anthropic.claude-sonnet-4-6", + "name": "AU Anthropic Claude Sonnet 4.6", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3.3, + "output": 16.5, + "cacheRead": 0.33, + "cacheWrite": 4.125 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "au.anthropic.claude-sonnet-5", + "name": "Claude Sonnet 5 (AU)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.2, + "output": 11, + "cacheRead": 0.22, + "cacheWrite": 2.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "ca.amazon.nova-lite-v1:0", + "name": "Nova Lite (CA)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.064, + "output": 0.256, + "cacheRead": 0.016, + "cacheWrite": 0.064 + }, + "contextWindow": 300000, + "maxTokens": 10000 + }, + { + "id": "deepseek.v3-v1:0", + "name": "DeepSeek-V3.1", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.58, + "output": 1.68, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 163840, + "maxTokens": 81920 + }, + { + "id": "deepseek.v3.2", + "name": "DeepSeek V3.2", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.62, + "output": 1.85, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 163840, + "maxTokens": 81920 + }, + { + "id": "eu.amazon.nova-2-lite-v1:0", + "name": "Nova 2 Lite (EU)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.eu-central-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.374, + "output": 3.157, + "cacheRead": 0.0935, + "cacheWrite": 0.374 + }, + "contextWindow": 1000000, + "maxTokens": 65535 + }, + { + "id": "eu.amazon.nova-lite-v1:0", + "name": "Nova Lite (EU)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.eu-central-1.amazonaws.com", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.069, + "output": 0.276, + "cacheRead": 0.01725, + "cacheWrite": 0.069 + }, + "contextWindow": 300000, + "maxTokens": 10000 + }, + { + "id": "eu.amazon.nova-micro-v1:0", + "name": "Nova Micro (EU)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.eu-central-1.amazonaws.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.04, + "output": 0.16, + "cacheRead": 0.01, + "cacheWrite": 0.04 + }, + "contextWindow": 128000, + "maxTokens": 10000 + }, + { + "id": "eu.amazon.nova-pro-v1:0", + "name": "Nova Pro (EU)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.eu-central-1.amazonaws.com", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.92, + "output": 3.68, + "cacheRead": 0.23, + "cacheWrite": 0.92 + }, + "contextWindow": 300000, + "maxTokens": 10000 + }, + { + "id": "eu.anthropic.claude-fable-5", + "name": "Claude Fable 5 (EU)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.eu-central-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 11, + "output": 55, + "cacheRead": 1.1, + "cacheWrite": 13.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "eu.anthropic.claude-haiku-4-5-20251001-v1:0", + "name": "Claude Haiku 4.5 (EU)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.eu-central-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.1, + "output": 5.5, + "cacheRead": 0.11, + "cacheWrite": 1.375 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "eu.anthropic.claude-opus-4-5-20251101-v1:0", + "name": "Claude Opus 4.5 (EU)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.eu-central-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5.5, + "output": 27.5, + "cacheRead": 0.55, + "cacheWrite": 6.875 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "eu.anthropic.claude-opus-4-6-v1", + "name": "Claude Opus 4.6 (EU)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.eu-central-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5.5, + "output": 27.5, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "eu.anthropic.claude-opus-4-7", + "name": "Claude Opus 4.7 (EU)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.eu-central-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5.5, + "output": 27.5, + "cacheRead": 0.55, + "cacheWrite": 6.875 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "eu.anthropic.claude-opus-4-8", + "name": "Claude Opus 4.8 (EU)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.eu-central-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5.5, + "output": 27.5, + "cacheRead": 0.55, + "cacheWrite": 6.875 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "eu.anthropic.claude-opus-5", + "name": "Claude Opus 5 (EU)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.eu-central-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5.5, + "output": 27.5, + "cacheRead": 0.55, + "cacheWrite": 6.875 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "eu.anthropic.claude-opus-5-5", + "name": "Claude Opus 5.5 (EU)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.eu-central-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4.4, + "output": 22, + "cacheRead": 0.22, + "cacheWrite": 5.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "eu.anthropic.claude-sonnet-4-20250514-v1:0", + "name": "Claude Sonnet 4 (EU)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.eu-central-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "eu.anthropic.claude-sonnet-4-5-20250929-v1:0", + "name": "Claude Sonnet 4.5 (EU)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.eu-central-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3.3, + "output": 16.5, + "cacheRead": 0.33, + "cacheWrite": 4.125 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "eu.anthropic.claude-sonnet-4-6", + "name": "Claude Sonnet 4.6 (EU)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.eu-central-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3.3, + "output": 16.5, + "cacheRead": 0.33, + "cacheWrite": 4.125 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "eu.anthropic.claude-sonnet-5", + "name": "Claude Sonnet 5 (EU)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.eu-central-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.2, + "output": 11, + "cacheRead": 0.22, + "cacheWrite": 2.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "eu.mistral.pixtral-large-2502-v1:0", + "name": "Pixtral Large (25.02) (EU)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.eu-central-1.amazonaws.com", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 8192 + }, + { + "id": "global.amazon.nova-2-lite-v1:0", + "name": "Nova 2 Lite (Global)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 2.5, + "cacheRead": 0.075, + "cacheWrite": 0.3 + }, + "contextWindow": 1000000, + "maxTokens": 65535 + }, + { + "id": "global.anthropic.claude-fable-5", + "name": "Claude Fable 5 (Global)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "global.anthropic.claude-fable-5-1", + "name": "Claude Fable 5.1 (Global)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 0.25, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "global.anthropic.claude-fable-5-2", + "name": "Claude Fable 5.2 (Global)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 8, + "output": 40, + "cacheRead": 0.2, + "cacheWrite": 10 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "global.anthropic.claude-haiku-4-5-20251001-v1:0", + "name": "Claude Haiku 4.5 (Global)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "global.anthropic.claude-opus-4-5-20251101-v1:0", + "name": "Claude Opus 4.5 (Global)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "global.anthropic.claude-opus-4-6-v1", + "name": "Claude Opus 4.6 (Global)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "global.anthropic.claude-opus-4-7", + "name": "Claude Opus 4.7 (Global)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "global.anthropic.claude-opus-4-8", + "name": "Claude Opus 4.8 (Global)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "global.anthropic.claude-opus-5", + "name": "Claude Opus 5 (Global)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "global.anthropic.claude-opus-5-5", + "name": "Claude Opus 5.5 (Global)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.2, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "global.anthropic.claude-sonnet-4-20250514-v1:0", + "name": "Claude Sonnet 4 (Global)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "global.anthropic.claude-sonnet-4-5-20250929-v1:0", + "name": "Claude Sonnet 4.5 (Global)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "global.anthropic.claude-sonnet-4-6", + "name": "Claude Sonnet 4.6 (Global)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "global.anthropic.claude-sonnet-5", + "name": "Claude Sonnet 5 (Global)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "global.openai.gpt-5.6-luna", + "name": "GPT-5.6 Luna (Global)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.2, + "output": 1.2, + "cacheRead": 0.02, + "cacheWrite": 0.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "global.openai.gpt-5.6-sol", + "name": "GPT-5.6 Sol (Global)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.4, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "global.openai.gpt-5.6-terra", + "name": "GPT-5.6 Terra (Global)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 12, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "global.openai.gpt-6-astra", + "name": "GPT-6 Astra (Global)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "global.openai.gpt-6-luna", + "name": "GPT-6 Luna (Global)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.5, + "cacheRead": 0.01, + "cacheWrite": 0.125 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "global.openai.gpt-6-sol", + "name": "GPT-6 Sol (Global)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "global.openai.gpt-6.1-sol", + "name": "GPT-6.1 Sol (Global)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.1, + "cacheWrite": 2.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "global.openai.gpt-6.1-terra", + "name": "GPT-6.1 Terra (Global)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.05, + "cacheWrite": 1.25 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "global.xai.grok-4.6", + "name": "Grok 4.6 (Global)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 500000 + }, + { + "id": "global.xai.grok-4.7", + "name": "Grok 4.7 (Global)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 500000 + }, + { + "id": "global.zai.glm-5.3", + "name": "GLM-5.3 (Global)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 1.68, + "output": 5.28, + "cacheRead": 0.312, + "cacheWrite": 2.1 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "google.gemma-4-26b-a4b", + "name": "Gemma 4 26B A4B IT", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.13, + "output": 0.4, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "google.gemma-4-31b", + "name": "Gemma 4 31B IT", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.14, + "output": 0.4, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "google.gemma-4-e2b", + "name": "Gemma 4 E2B IT", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.04, + "output": 0.08, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 8192 + }, + { + "id": "in.anthropic.claude-haiku-4-5-20251001-v1:0", + "name": "Claude Haiku 4.5 (India)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.1, + "output": 5.5, + "cacheRead": 0.11, + "cacheWrite": 1.375 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "in.anthropic.claude-opus-5", + "name": "Claude Opus 5 (India)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5.5, + "output": 27.5, + "cacheRead": 0.55, + "cacheWrite": 6.875 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "in.anthropic.claude-sonnet-5", + "name": "Claude Sonnet 5 (India)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.2, + "output": 11, + "cacheRead": 0.22, + "cacheWrite": 2.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "in.openai.gpt-5.6-luna", + "name": "GPT-5.6 Luna (India)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.22, + "output": 1.32, + "cacheRead": 0.022, + "cacheWrite": 0.275 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "in.openai.gpt-5.6-terra", + "name": "GPT-5.6 Terra (India)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.2, + "output": 13.2, + "cacheRead": 0.22, + "cacheWrite": 2.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "jp.amazon.nova-2-lite-v1:0", + "name": "Nova 2 Lite (JP)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.396, + "output": 3.311, + "cacheRead": 0.099, + "cacheWrite": 0.396 + }, + "contextWindow": 1000000, + "maxTokens": 65535 + }, + { + "id": "jp.anthropic.claude-haiku-4-5-20251001-v1:0", + "name": "Claude Haiku 4.5 (JP)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.1, + "output": 5.5, + "cacheRead": 0.11, + "cacheWrite": 1.375 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "jp.anthropic.claude-opus-4-7", + "name": "Claude Opus 4.7 (JP)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5.5, + "output": 27.5, + "cacheRead": 0.55, + "cacheWrite": 6.875 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "jp.anthropic.claude-opus-4-8", + "name": "Claude Opus 4.8 (JP)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5.5, + "output": 27.5, + "cacheRead": 0.55, + "cacheWrite": 6.875 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "jp.anthropic.claude-opus-5", + "name": "Claude Opus 5 (JP)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5.5, + "output": 27.5, + "cacheRead": 0.55, + "cacheWrite": 6.875 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "jp.anthropic.claude-opus-5-5", + "name": "Claude Opus 5.5 (JP)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4.4, + "output": 22, + "cacheRead": 0.22, + "cacheWrite": 5.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "jp.anthropic.claude-sonnet-4-5-20250929-v1:0", + "name": "Claude Sonnet 4.5 (JP)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3.3, + "output": 16.5, + "cacheRead": 0.33, + "cacheWrite": 4.125 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "jp.anthropic.claude-sonnet-4-6", + "name": "Claude Sonnet 4.6 (JP)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3.3, + "output": 16.5, + "cacheRead": 0.33, + "cacheWrite": 4.125 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "jp.anthropic.claude-sonnet-5", + "name": "Claude Sonnet 5 (JP)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.2, + "output": 11, + "cacheRead": 0.22, + "cacheWrite": 2.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "meta.llama3-1-70b-instruct-v1:0", + "name": "Llama 3.1 70B Instruct", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.72, + "output": 0.72, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 4096 + }, + { + "id": "meta.llama3-1-8b-instruct-v1:0", + "name": "Llama 3.1 8B Instruct", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.22, + "output": 0.22, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 4096 + }, + { + "id": "meta.llama3-3-70b-instruct-v1:0", + "name": "Llama 3.3 70B Instruct", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.72, + "output": 0.72, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 4096 + }, + { + "id": "meta.llama4-maverick-17b-instruct-v1:0", + "name": "Llama 4 Maverick 17B Instruct", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.24, + "output": 0.97, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 8192 + }, + { + "id": "meta.llama4-scout-17b-instruct-v1:0", + "name": "Llama 4 Scout 17B Instruct", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.17, + "output": 0.66, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 10000000, + "maxTokens": 8192 + }, + { + "id": "minimax.minimax-m2", + "name": "MiniMax-M2", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 204608, + "maxTokens": 128000 + }, + { + "id": "minimax.minimax-m2.1", + "name": "MiniMax-M2.1", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 196608, + "maxTokens": 131072 + }, + { + "id": "minimax.minimax-m2.5", + "name": "MiniMax-M2.5", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 196608, + "maxTokens": 98304 + }, + { + "id": "mistral.devstral-2-123b", + "name": "Devstral 2 123B", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.4, + "output": 2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 8192 + }, + { + "id": "mistral.magistral-small-2509", + "name": "Magistral Small 1.2", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.5, + "output": 1.5, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 40000 + }, + { + "id": "mistral.ministral-3-14b-instruct", + "name": "Ministral 14B 3.0", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.2, + "output": 0.2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 4096 + }, + { + "id": "mistral.ministral-3-3b-instruct", + "name": "Ministral 3 3B", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.1, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 8192 + }, + { + "id": "mistral.ministral-3-8b-instruct", + "name": "Ministral 3 8B", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.15, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 4096 + }, + { + "id": "mistral.mistral-large-3-675b-instruct", + "name": "Mistral Large 3", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.5, + "output": 1.5, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 8192 + }, + { + "id": "mistral.pixtral-large-2502-v1:0", + "name": "Pixtral Large (25.02)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 8192 + }, + { + "id": "mistral.voxtral-mini-3b-2507", + "name": "Voxtral Mini 3B 2507", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.04, + "output": 0.04, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 32768, + "maxTokens": 4096 + }, + { + "id": "mistral.voxtral-small-24b-2507", + "name": "Voxtral Small 24B 2507", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.1, + "output": 0.3, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 32768, + "maxTokens": 8192 + }, + { + "id": "moonshot.kimi-k2-thinking", + "name": "Kimi K2 Thinking", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.6, + "output": 2.5, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 16000 + }, + { + "id": "moonshotai.kimi-k2.5", + "name": "Kimi K2.5", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.6, + "output": 3, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 16384 + }, + { + "id": "nvidia.nemotron-nano-12b-v2", + "name": "NVIDIA Nemotron Nano 12B v2 VL BF16", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.2, + "output": 0.6, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 8192 + }, + { + "id": "nvidia.nemotron-nano-3-30b", + "name": "NVIDIA Nemotron Nano 3 30B", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.06, + "output": 0.24, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 8192 + }, + { + "id": "nvidia.nemotron-nano-9b-v2", + "name": "NVIDIA Nemotron Nano 9B v2", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.06, + "output": 0.23, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 8192 + }, + { + "id": "nvidia.nemotron-super-3-120b", + "name": "NVIDIA Nemotron 3 Super 120B A12B", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.15, + "output": 0.65, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 131072 + }, + { + "id": "openai.gpt-5.4", + "name": "GPT-5.4", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.75, + "output": 16.5, + "cacheRead": 0.275, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai.gpt-5.5", + "name": "GPT-5.5", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5.5, + "output": 33, + "cacheRead": 0.55, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai.gpt-5.6-luna", + "name": "GPT-5.6 Luna", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.22, + "output": 1.32, + "cacheRead": 0.022, + "cacheWrite": 0.275 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai.gpt-5.6-sol", + "name": "GPT-5.6 Sol", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4.4, + "output": 22, + "cacheRead": 0.44, + "cacheWrite": 5.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai.gpt-5.6-terra", + "name": "GPT-5.6 Terra", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.2, + "output": 13.2, + "cacheRead": 0.22, + "cacheWrite": 2.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai.gpt-6-astra", + "name": "GPT-6 Astra", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 11, + "output": 55, + "cacheRead": 1.1, + "cacheWrite": 13.75 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai.gpt-6-luna", + "name": "GPT-6 Luna", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.11, + "output": 0.55, + "cacheRead": 0.011, + "cacheWrite": 0.1375 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai.gpt-6-sol", + "name": "GPT-6 Sol", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.2, + "output": 11, + "cacheRead": 0.22, + "cacheWrite": 2.75 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai.gpt-6.1-sol", + "name": "GPT-6.1 Sol", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.2, + "output": 11, + "cacheRead": 0.11, + "cacheWrite": 2.75 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai.gpt-6.1-terra", + "name": "GPT-6.1 Terra", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.1, + "output": 5.5, + "cacheRead": 0.055, + "cacheWrite": 1.375 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai.gpt-oss-120b", + "name": "gpt-oss-120b", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 131072 + }, + { + "id": "openai.gpt-oss-120b-1:0", + "name": "gpt-oss-120b", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 128000 + }, + { + "id": "openai.gpt-oss-20b", + "name": "gpt-oss-20b", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.07, + "output": 0.3, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 131072 + }, + { + "id": "openai.gpt-oss-20b-1:0", + "name": "gpt-oss-20b", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.07, + "output": 0.3, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 128000 + }, + { + "id": "openai.gpt-oss-safeguard-120b", + "name": "GPT OSS Safeguard 120B", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "openai.gpt-oss-safeguard-20b", + "name": "GPT OSS Safeguard 20B", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.07, + "output": 0.2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "qwen.qwen3-235b-a22b-2507-v1:0", + "name": "Qwen3 235B-A22B Instruct 2507", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.22, + "output": 0.88, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 131072 + }, + { + "id": "qwen.qwen3-32b-v1:0", + "name": "Qwen3 32B", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 32768, + "maxTokens": 16384 + }, + { + "id": "qwen.qwen3-coder-30b-a3b-v1:0", + "name": "Qwen3-Coder 30B-A3B Instruct", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 131072 + }, + { + "id": "qwen.qwen3-coder-480b-a35b-v1:0", + "name": "Qwen3-Coder 480B-A35B Instruct", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.45, + "output": 1.8, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 65536 + }, + { + "id": "qwen.qwen3-coder-next", + "name": "Qwen3 Coder Next", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.5, + "output": 1.2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "qwen.qwen3-next-80b-a3b", + "name": "Qwen3-Next 80B-A3B Instruct", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.15, + "output": 1.2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262000 + }, + { + "id": "qwen.qwen3-vl-235b-a22b", + "name": "Qwen3 VL 235B A22B Instruct", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.53, + "output": 2.66, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262000 + }, + { + "id": "us-gov.openai.gpt-oss-120b-1:0", + "name": "gpt-oss-120b (GovCloud)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.18, + "output": 0.72, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "us-gov.openai.gpt-oss-20b-1:0", + "name": "gpt-oss-20b (GovCloud)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.084, + "output": 0.36, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "us.amazon.nova-2-lite-v1:0", + "name": "Nova 2 Lite (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.33, + "output": 2.75, + "cacheRead": 0.0825, + "cacheWrite": 0.33 + }, + "contextWindow": 1000000, + "maxTokens": 65535 + }, + { + "id": "us.amazon.nova-lite-v1:0", + "name": "Nova Lite (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.06, + "output": 0.24, + "cacheRead": 0.015, + "cacheWrite": 0.06 + }, + "contextWindow": 300000, + "maxTokens": 10000 + }, + { + "id": "us.amazon.nova-micro-v1:0", + "name": "Nova Micro (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.035, + "output": 0.14, + "cacheRead": 0.00875, + "cacheWrite": 0.035 + }, + "contextWindow": 128000, + "maxTokens": 10000 + }, + { + "id": "us.amazon.nova-premier-v1:0", + "name": "Nova Premier (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 12.5, + "cacheRead": 0.625, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 10000 + }, + { + "id": "us.amazon.nova-pro-v1:0", + "name": "Nova Pro (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.8, + "output": 3.2, + "cacheRead": 0.2, + "cacheWrite": 0.8 + }, + "contextWindow": 300000, + "maxTokens": 10000 + }, + { + "id": "us.anthropic.claude-fable-5", + "name": "Claude Fable 5 (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 11, + "output": 55, + "cacheRead": 1.1, + "cacheWrite": 13.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "us.anthropic.claude-fable-5-1", + "name": "Claude Fable 5.1 (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 11, + "output": 55, + "cacheRead": 0.275, + "cacheWrite": 13.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "us.anthropic.claude-fable-5-2", + "name": "Claude Fable 5.2 (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 8.8, + "output": 44, + "cacheRead": 0.22, + "cacheWrite": 11 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "us.anthropic.claude-haiku-4-5-20251001-v1:0", + "name": "Claude Haiku 4.5 (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.1, + "output": 5.5, + "cacheRead": 0.11, + "cacheWrite": 1.375 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "us.anthropic.claude-opus-4-1-20250805-v1:0", + "name": "Claude Opus 4.1 (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 15, + "output": 75, + "cacheRead": 1.5, + "cacheWrite": 18.75 + }, + "contextWindow": 200000, + "maxTokens": 32000 + }, + { + "id": "us.anthropic.claude-opus-4-5-20251101-v1:0", + "name": "Claude Opus 4.5 (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5.5, + "output": 27.5, + "cacheRead": 0.55, + "cacheWrite": 6.875 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "us.anthropic.claude-opus-4-6-v1", + "name": "Claude Opus 4.6 (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5.5, + "output": 27.5, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "us.anthropic.claude-opus-4-7", + "name": "Claude Opus 4.7 (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5.5, + "output": 27.5, + "cacheRead": 0.55, + "cacheWrite": 6.875 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "us.anthropic.claude-opus-4-8", + "name": "Claude Opus 4.8 (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5.5, + "output": 27.5, + "cacheRead": 0.55, + "cacheWrite": 6.875 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "us.anthropic.claude-opus-5", + "name": "Claude Opus 5 (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5.5, + "output": 27.5, + "cacheRead": 0.55, + "cacheWrite": 6.875 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "us.anthropic.claude-opus-5-5", + "name": "Claude Opus 5.5 (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4.4, + "output": 22, + "cacheRead": 0.22, + "cacheWrite": 5.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "us.anthropic.claude-sonnet-4-20250514-v1:0", + "name": "Claude Sonnet 4 (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "us.anthropic.claude-sonnet-4-5-20250929-v1:0", + "name": "Claude Sonnet 4.5 (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3.3, + "output": 16.5, + "cacheRead": 0.33, + "cacheWrite": 4.125 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "us.anthropic.claude-sonnet-4-6", + "name": "Claude Sonnet 4.6 (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3.3, + "output": 16.5, + "cacheRead": 0.33, + "cacheWrite": 4.125 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "us.anthropic.claude-sonnet-5", + "name": "Claude Sonnet 5 (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.2, + "output": 11, + "cacheRead": 0.22, + "cacheWrite": 2.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "us.meta.llama3-1-70b-instruct-v1:0", + "name": "Llama 3.1 70B Instruct (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.72, + "output": 0.72, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 4096 + }, + { + "id": "us.meta.llama3-1-8b-instruct-v1:0", + "name": "Llama 3.1 8B Instruct (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.22, + "output": 0.22, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 4096 + }, + { + "id": "us.meta.llama3-3-70b-instruct-v1:0", + "name": "Llama 3.3 70B Instruct (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.72, + "output": 0.72, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 4096 + }, + { + "id": "us.meta.llama4-maverick-17b-instruct-v1:0", + "name": "Llama 4 Maverick 17B Instruct (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.24, + "output": 0.97, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 8192 + }, + { + "id": "us.meta.llama4-scout-17b-instruct-v1:0", + "name": "Llama 4 Scout 17B Instruct (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.17, + "output": 0.66, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 10000000, + "maxTokens": 8192 + }, + { + "id": "us.mistral.pixtral-large-2502-v1:0", + "name": "Pixtral Large (25.02) (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 8192 + }, + { + "id": "us.openai.gpt-5.6-luna", + "name": "GPT-5.6 Luna (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.22, + "output": 1.32, + "cacheRead": 0.022, + "cacheWrite": 0.275 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "us.openai.gpt-5.6-sol", + "name": "GPT-5.6 Sol (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4.4, + "output": 22, + "cacheRead": 0.44, + "cacheWrite": 5.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "us.openai.gpt-5.6-terra", + "name": "GPT-5.6 Terra (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.2, + "output": 13.2, + "cacheRead": 0.22, + "cacheWrite": 2.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "us.openai.gpt-6-astra", + "name": "GPT-6 Astra (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 11, + "output": 55, + "cacheRead": 1.1, + "cacheWrite": 13.75 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "us.openai.gpt-6-luna", + "name": "GPT-6 Luna (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.11, + "output": 0.55, + "cacheRead": 0.011, + "cacheWrite": 0.1375 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "us.openai.gpt-6-sol", + "name": "GPT-6 Sol (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.2, + "output": 11, + "cacheRead": 0.22, + "cacheWrite": 2.75 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "us.openai.gpt-6.1-sol", + "name": "GPT-6.1 Sol (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.2, + "output": 11, + "cacheRead": 0.11, + "cacheWrite": 2.75 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "us.openai.gpt-6.1-terra", + "name": "GPT-6.1 Terra (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.1, + "output": 5.5, + "cacheRead": 0.055, + "cacheWrite": 1.375 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "us.writer.palmyra-x4-v1:0", + "name": "Palmyra X4 (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 2.5, + "output": 10, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 122880, + "maxTokens": 8192 + }, + { + "id": "us.writer.palmyra-x5-v1:0", + "name": "Palmyra X5 (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.6, + "output": 6, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1040000, + "maxTokens": 8192 + }, + { + "id": "us.xai.grok-4.6", + "name": "Grok 4.6 (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.2, + "output": 6.6, + "cacheRead": 0.55, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 500000 + }, + { + "id": "us.xai.grok-4.7", + "name": "Grok 4.7 (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.2, + "output": 6.6, + "cacheRead": 0.55, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 500000 + }, + { + "id": "us.zai.glm-5.3", + "name": "GLM-5.3 (US)", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 1.848, + "output": 5.808, + "cacheRead": 0.3432, + "cacheWrite": 2.31 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "writer.palmyra-x4-v1:0", + "name": "Palmyra X4", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 2.5, + "output": 10, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 122880, + "maxTokens": 8192 + }, + { + "id": "writer.palmyra-x5-v1:0", + "name": "Palmyra X5", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.6, + "output": 6, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1040000, + "maxTokens": 8192 + }, + { + "id": "xai.grok-4.3", + "name": "Grok 4.3", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 2.5, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "xai.grok-4.6", + "name": "Grok 4.6", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.2, + "output": 6.6, + "cacheRead": 0.55, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 500000 + }, + { + "id": "zai.glm-4.7", + "name": "GLM-4.7", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.6, + "output": 2.2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 202752, + "maxTokens": 131072 + }, + { + "id": "zai.glm-4.7-flash", + "name": "GLM-4.7-Flash", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.07, + "output": 0.4, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 202752, + "maxTokens": 131072 + }, + { + "id": "zai.glm-5", + "name": "GLM-5", + "api": "bedrock-converse-stream", + "provider": "amazon-bedrock", + "baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 1, + "output": 3.2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 202752, + "maxTokens": 131072 + }, + { + "id": "Ling-2.6-1T", + "name": "Ling 2.6 1T", + "api": "openai-completions", + "provider": "ant-ling", + "baseUrl": "https://api.ant-ling.com/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsLongCacheRetention": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.06, + "output": 0.25, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "Ling-2.6-flash", + "name": "Ling 2.6 Flash", + "api": "openai-completions", + "provider": "ant-ling", + "baseUrl": "https://api.ant-ling.com/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsLongCacheRetention": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.01, + "output": 0.02, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "Ring-2.6-1T", + "name": "Ring 2.6 1T", + "api": "openai-completions", + "provider": "ant-ling", + "baseUrl": "https://api.ant-ling.com/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsLongCacheRetention": false, + "thinkingFormat": "ant-ling" + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": "xhigh" + }, + "input": [ + "text" + ], + "cost": { + "input": 0.06, + "output": 0.25, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "claude-fable-5", + "name": "Claude Fable 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-1", + "name": "Claude Fable 5.1", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 0.25, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-2", + "name": "Claude Fable 5.2", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 8, + "output": 40, + "cacheRead": 0.2, + "cacheWrite": 10 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-haiku-4-5", + "name": "Claude Haiku 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-haiku-4-5-20251001", + "name": "Claude Haiku 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5", + "name": "Claude Opus 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5-20251101", + "name": "Claude Opus 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-6", + "name": "Claude Opus 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-7", + "name": "Claude Opus 4.7", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-8", + "name": "Claude Opus 4.8", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5", + "name": "Claude Opus 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-5", + "name": "Claude Opus 5.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.2, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-4-5", + "name": "Claude Sonnet 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-5-20250929", + "name": "Claude Sonnet 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5", + "name": "Claude Sonnet 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-4", + "name": "GPT-4", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 30, + "output": 60, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 8192, + "maxTokens": 8192 + }, + { + "id": "gpt-4-turbo", + "name": "GPT-4 Turbo", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 30, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 4096 + }, + { + "id": "gpt-4.1", + "name": "GPT-4.1", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 8, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 1047576, + "maxTokens": 32768 + }, + { + "id": "gpt-4.1-mini", + "name": "GPT-4.1 mini", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.4, + "output": 1.6, + "cacheRead": 0.1, + "cacheWrite": 0 + }, + "contextWindow": 1047576, + "maxTokens": 32768 + }, + { + "id": "gpt-4.1-nano", + "name": "GPT-4.1 nano", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.4, + "cacheRead": 0.025, + "cacheWrite": 0 + }, + "contextWindow": 1047576, + "maxTokens": 32768 + }, + { + "id": "gpt-4o", + "name": "GPT-4o", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 10, + "cacheRead": 1.25, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "gpt-4o-2024-05-13", + "name": "GPT-4o (2024-05-13)", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 15, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 4096 + }, + { + "id": "gpt-4o-2024-08-06", + "name": "GPT-4o (2024-08-06)", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 10, + "cacheRead": 1.25, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "gpt-4o-2024-11-20", + "name": "GPT-4o (2024-11-20)", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 10, + "cacheRead": 1.25, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "gpt-4o-mini", + "name": "GPT-4o mini", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "gpt-5", + "name": "GPT-5", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.125, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-chat-latest", + "name": "GPT-5 Chat Latest", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": false, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.125, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "gpt-5-mini", + "name": "GPT-5 Mini", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 2, + "cacheRead": 0.025, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-nano", + "name": "GPT-5 Nano", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.05, + "output": 0.4, + "cacheRead": 0.005, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-pro", + "name": "GPT-5 Pro", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 15, + "output": 120, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 272000 + }, + { + "id": "gpt-5.1", + "name": "GPT-5.1", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.125, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.1-codex", + "name": "GPT-5.1 Codex", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 5, + "cacheRead": 0.125, + "cacheWrite": 1.25 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.1-codex-max", + "name": "GPT-5.1 Codex Max", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.125, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.2", + "name": "GPT-5.2", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.75, + "output": 14, + "cacheRead": 0.175, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.2-chat-latest", + "name": "GPT-5.2 Chat", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.75, + "output": 14, + "cacheRead": 0.175, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "gpt-5.2-pro", + "name": "GPT-5.2 Pro", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 21, + "output": 168, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.3-chat-latest", + "name": "GPT-5.3 Chat (latest)", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": false, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.75, + "output": 14, + "cacheRead": 0.175, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "gpt-5.3-codex", + "name": "GPT-5.3 Codex", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.75, + "output": 14, + "cacheRead": 0.175, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.3-codex-spark", + "name": "GPT-5.3 Codex Spark", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.75, + "output": 14, + "cacheRead": 0.175, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 32000 + }, + { + "id": "gpt-5.4", + "name": "GPT-5.4", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 15, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.4-mini", + "name": "GPT-5.4 mini", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 4.5, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.4-nano", + "name": "GPT-5.4 nano", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.2, + "output": 1.25, + "cacheRead": 0.02, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.4-pro", + "name": "GPT-5.4 Pro", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 30, + "output": 180, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.5", + "name": "GPT-5.5", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 30, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.5-pro", + "name": "GPT-5.5 Pro", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh", + "minimal": null, + "low": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 30, + "output": 180, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.6", + "name": "GPT-5.6", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.4, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.6-luna", + "name": "GPT-5.6 Luna", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.2, + "output": 1.2, + "cacheRead": 0.02, + "cacheWrite": 0.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.6-sol", + "name": "GPT-5.6 Sol", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.4, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.6-terra", + "name": "GPT-5.6 Terra", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 12, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-astra", + "name": "GPT-6 Astra", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-luna", + "name": "GPT-6 Luna", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.5, + "cacheRead": 0.01, + "cacheWrite": 0.125 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-sol", + "name": "GPT-6 Sol", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-6.1-sol", + "name": "GPT-6.1 Sol", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.1, + "cacheWrite": 2.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-6.1-terra", + "name": "GPT-6.1 Terra", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.05, + "cacheWrite": 1.25 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-daybreak-blue-latest", + "name": "Daybreak Blue", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.4, + "cacheWrite": 5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-daybreak-red-latest", + "name": "Daybreak Red", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 12.5, + "output": 75, + "cacheRead": 1.25, + "cacheWrite": 15.625 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-realtime-2.1", + "name": "GPT-Realtime-2.1", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 24, + "cacheRead": 0.4, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 32000 + }, + { + "id": "o1", + "name": "o1", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 15, + "output": 60, + "cacheRead": 7.5, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "o1-pro", + "name": "o1-pro", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 150, + "output": 600, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "o3", + "name": "o3", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 8, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "o3-mini", + "name": "o3-mini", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 1.1, + "output": 4.4, + "cacheRead": 0.55, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "o3-pro", + "name": "o3-pro", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 20, + "output": 80, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "o4-mini", + "name": "o4-mini", + "api": "azure-openai-responses", + "provider": "azure-openai-responses", + "baseUrl": "", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.1, + "output": 4.4, + "cacheRead": 0.275, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "gpt-oss-120b", + "name": "GPT OSS 120B", + "api": "openai-completions", + "provider": "cerebras", + "baseUrl": "https://api.cerebras.ai/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.35, + "output": 0.75, + "cacheRead": 0.35, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 40960 + }, + { + "id": "qwen-3.8-27b", + "name": "Qwen3.8 27B", + "api": "openai-completions", + "provider": "cerebras", + "baseUrl": "https://api.cerebras.ai/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.99, + "output": 1.49, + "cacheRead": 0.99, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 40960 + }, + { + "id": "claude-fable-5", + "name": "Claude Fable 5", + "api": "anthropic-messages", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5.1", + "name": "Claude Fable 5.1", + "api": "anthropic-messages", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 0.25, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-haiku-4.5", + "name": "Claude Haiku 4.5 (latest)", + "api": "anthropic-messages", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4.5", + "name": "Claude Opus 4.5 (latest)", + "api": "anthropic-messages", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4.6", + "name": "Claude Opus 4.6", + "api": "anthropic-messages", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4.7", + "name": "Claude Opus 4.7", + "api": "anthropic-messages", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4.8", + "name": "Claude Opus 4.8", + "api": "anthropic-messages", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5", + "name": "Claude Opus 5", + "api": "anthropic-messages", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5.5", + "name": "Claude Opus 5.5", + "api": "anthropic-messages", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic", + "compat": { + "forceAdaptiveThinking": true, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.2, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-4.5", + "name": "Claude Sonnet 4.5 (latest)", + "api": "anthropic-messages", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4.6", + "name": "Claude Sonnet 4.6", + "api": "anthropic-messages", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5", + "name": "Claude Sonnet 5", + "api": "anthropic-messages", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-4.1", + "name": "GPT-4.1", + "api": "openai-responses", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 8, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 1047576, + "maxTokens": 32768 + }, + { + "id": "gpt-4.1-mini", + "name": "GPT-4.1 mini", + "api": "openai-responses", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.4, + "output": 1.6, + "cacheRead": 0.1, + "cacheWrite": 0 + }, + "contextWindow": 1047576, + "maxTokens": 32768 + }, + { + "id": "gpt-4.1-nano", + "name": "GPT-4.1 nano", + "api": "openai-responses", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.4, + "cacheRead": 0.025, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 32768 + }, + { + "id": "gpt-4o", + "name": "GPT-4o", + "api": "openai-responses", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 5, + "cacheRead": 0.625, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "gpt-4o-mini", + "name": "GPT-4o mini", + "api": "openai-responses", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.075, + "output": 0.3, + "cacheRead": 0.0375, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "gpt-5", + "name": "GPT-5", + "api": "openai-responses", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.125, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-mini", + "name": "GPT-5 Mini", + "api": "openai-responses", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 2, + "cacheRead": 0.025, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-nano", + "name": "GPT-5 Nano", + "api": "openai-responses", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.05, + "output": 0.4, + "cacheRead": 0.005, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.1", + "name": "GPT-5.1", + "api": "openai-responses", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.125, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.4", + "name": "GPT-5.4", + "api": "openai-responses", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 15, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.4-mini", + "name": "GPT-5.4 mini", + "api": "openai-responses", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 4.5, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.4-nano", + "name": "GPT-5.4 nano", + "api": "openai-responses", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.2, + "output": 1.25, + "cacheRead": 0.02, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.4-pro", + "name": "GPT-5.4 Pro", + "api": "openai-responses", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 30, + "output": 180, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.5", + "name": "GPT-5.5", + "api": "openai-responses", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 30, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.5-pro", + "name": "GPT-5.5 Pro", + "api": "openai-responses", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh", + "minimal": null, + "low": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 30, + "output": 180, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.6-luna", + "name": "GPT-5.6 Luna", + "api": "openai-responses", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.2, + "output": 1.2, + "cacheRead": 0.02, + "cacheWrite": 0.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.6-sol", + "name": "GPT-5.6 Sol", + "api": "openai-responses", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.4, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.6-terra", + "name": "GPT-5.6 Terra", + "api": "openai-responses", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 12, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-astra", + "name": "GPT-6 Astra", + "api": "openai-responses", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-luna", + "name": "GPT-6 Luna", + "api": "openai-responses", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.5, + "cacheRead": 0.01, + "cacheWrite": 0.125 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-sol", + "name": "GPT-6 Sol", + "api": "openai-responses", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-6.1-sol", + "name": "GPT-6.1 Sol", + "api": "openai-responses", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.1, + "cacheWrite": 2.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-6.1-terra", + "name": "GPT-6.1 Terra", + "api": "openai-responses", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.05, + "cacheWrite": 1.25 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "o3", + "name": "o3", + "api": "openai-responses", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 8, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "o3-mini", + "name": "o3-mini", + "api": "openai-responses", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 1.1, + "output": 4.4, + "cacheRead": 0.55, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "o4-mini", + "name": "o4-mini", + "api": "openai-responses", + "provider": "cloudflare-ai-gateway", + "baseUrl": "https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/openai", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.1, + "output": 4.4, + "cacheRead": 0.275, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "@cf/deepseek-ai/deepseek-v4-flash-0731", + "name": "DeepSeek V4 Flash 0731", + "api": "openai-completions", + "provider": "cloudflare-workers-ai", + "baseUrl": "https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1", + "compat": { + "sendSessionAffinityHeaders": true, + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 0.44, + "output": 1.32, + "cacheRead": 0.014, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "@cf/deepseek-ai/deepseek-v4-pro-0813", + "name": "DeepSeek V4 Pro 0813", + "api": "openai-completions", + "provider": "cloudflare-workers-ai", + "baseUrl": "https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1", + "compat": { + "sendSessionAffinityHeaders": true, + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 1.32, + "output": 3.96, + "cacheRead": 0.044, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "@cf/deepseek-ai/deepseek-v4.1-flash-1017", + "name": "DeepSeek V4.1 Flash 1017", + "api": "openai-completions", + "provider": "cloudflare-workers-ai", + "baseUrl": "https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1", + "compat": { + "sendSessionAffinityHeaders": true, + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.006, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "@cf/google/gemma-4-26b-a4b-it", + "name": "Gemma 4 26B A4B IT", + "api": "openai-completions", + "provider": "cloudflare-workers-ai", + "baseUrl": "https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1", + "compat": { + "sendSessionAffinityHeaders": true + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.3, + "cacheRead": 0.05, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 16384 + }, + { + "id": "@cf/ibm-granite/granite-4.0-h-micro", + "name": "Granite 4.0 H Micro", + "api": "openai-completions", + "provider": "cloudflare-workers-ai", + "baseUrl": "https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1", + "compat": { + "sendSessionAffinityHeaders": true + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.017, + "output": 0.112, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131000, + "maxTokens": 131000 + }, + { + "id": "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "name": "Llama 3.3 70B Instruct fp8 Fast", + "api": "openai-completions", + "provider": "cloudflare-workers-ai", + "baseUrl": "https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1", + "compat": { + "sendSessionAffinityHeaders": true + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.293, + "output": 2.253, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 24000, + "maxTokens": 24000 + }, + { + "id": "@cf/meta/llama-4-scout-17b-16e-instruct", + "name": "Llama 4 Scout 17B 16E Instruct", + "api": "openai-completions", + "provider": "cloudflare-workers-ai", + "baseUrl": "https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1", + "compat": { + "sendSessionAffinityHeaders": true + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.27, + "output": 0.85, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131000, + "maxTokens": 16384 + }, + { + "id": "@cf/mistralai/mistral-small-3.1-24b-instruct", + "name": "Mistral Small 3.1 24B Instruct", + "api": "openai-completions", + "provider": "cloudflare-workers-ai", + "baseUrl": "https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1", + "compat": { + "sendSessionAffinityHeaders": true + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.351, + "output": 0.555, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 128000 + }, + { + "id": "@cf/moonshotai/kimi-k2.6", + "name": "Kimi K2.6", + "api": "openai-completions", + "provider": "cloudflare-workers-ai", + "baseUrl": "https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1", + "compat": { + "sendSessionAffinityHeaders": true + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.95, + "output": 4, + "cacheRead": 0.16, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 256000 + }, + { + "id": "@cf/moonshotai/kimi-k2.7-code", + "name": "Kimi K2.7 Code", + "api": "openai-completions", + "provider": "cloudflare-workers-ai", + "baseUrl": "https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1", + "compat": { + "sendSessionAffinityHeaders": true + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.95, + "output": 4, + "cacheRead": 0.19, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "@cf/nvidia/nemotron-3-120b-a12b", + "name": "Nemotron 3 Super 120B", + "api": "openai-completions", + "provider": "cloudflare-workers-ai", + "baseUrl": "https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1", + "compat": { + "sendSessionAffinityHeaders": true + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.5, + "output": 1.5, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 256000 + }, + { + "id": "@cf/openai/gpt-oss-120b", + "name": "GPT OSS 120B", + "api": "openai-completions", + "provider": "cloudflare-workers-ai", + "baseUrl": "https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1", + "compat": { + "sendSessionAffinityHeaders": true + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.35, + "output": 0.75, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "@cf/openai/gpt-oss-20b", + "name": "GPT OSS 20B", + "api": "openai-completions", + "provider": "cloudflare-workers-ai", + "baseUrl": "https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1", + "compat": { + "sendSessionAffinityHeaders": true + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.2, + "output": 0.3, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "@cf/qwen/qwen3-30b-a3b-fp8", + "name": "Qwen3 30B A3b fp8", + "api": "openai-completions", + "provider": "cloudflare-workers-ai", + "baseUrl": "https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1", + "compat": { + "sendSessionAffinityHeaders": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 0.0509, + "output": 0.335, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 32768, + "maxTokens": 32768 + }, + { + "id": "@cf/qwen/qwen3.8-27b", + "name": "Qwen3.8 27B", + "api": "openai-completions", + "provider": "cloudflare-workers-ai", + "baseUrl": "https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1", + "compat": { + "sendSessionAffinityHeaders": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.45, + "output": 3.2, + "cacheRead": 0.05, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "@cf/zai-org/glm-4.7-flash", + "name": "GLM-4.7-Flash", + "api": "openai-completions", + "provider": "cloudflare-workers-ai", + "baseUrl": "https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1", + "compat": { + "sendSessionAffinityHeaders": true + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.0605, + "output": 0.4, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 131072 + }, + { + "id": "@cf/zai-org/glm-5.2", + "name": "Glm 5.2", + "api": "openai-completions", + "provider": "cloudflare-workers-ai", + "baseUrl": "https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1", + "compat": { + "sendSessionAffinityHeaders": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 1.4, + "output": 4.4, + "cacheRead": 0.26, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 256000 + }, + { + "id": "@cf/zai-org/glm-5.3", + "name": "Glm 5.3", + "api": "openai-completions", + "provider": "cloudflare-workers-ai", + "baseUrl": "https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1", + "compat": { + "sendSessionAffinityHeaders": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 1.4, + "output": 4.4, + "cacheRead": 0.26, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "@cf/zai-org/glm-5.3-flash", + "name": "Glm 5.3 Flash", + "api": "openai-completions", + "provider": "cloudflare-workers-ai", + "baseUrl": "https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1", + "compat": { + "sendSessionAffinityHeaders": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.5, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "claude-4-sonnet", + "name": "Claude Sonnet 4 (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-4-sonnet-thinking", + "name": "Claude Sonnet 4 Thinking (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-4.5-opus-high", + "name": "Claude Opus 4.5 (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-4.5-opus-high-thinking", + "name": "Claude Opus 4.5 Thinking (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-4.5-sonnet", + "name": "Claude Sonnet 4.5 (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-4.5-sonnet-thinking", + "name": "Claude Sonnet 4.5 Thinking (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-4.6-opus-high", + "name": "Claude Opus 4.6 1M (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-4.6-opus-high-thinking", + "name": "Claude Opus 4.6 1M Thinking (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-4.6-opus-max", + "name": "Claude Opus 4.6 1M Max (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-4.6-opus-max-thinking", + "name": "Claude Opus 4.6 1M Max Thinking (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-4.6-sonnet-medium", + "name": "Claude Sonnet 4.6 1M (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-4.6-sonnet-medium-thinking", + "name": "Claude Sonnet 4.6 1M Thinking (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-fable-5-1-high", + "name": "Claude Fable 5.1 1M (NO ZDR) (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-fable-5-1-low", + "name": "Claude Fable 5.1 1M Low (NO ZDR) (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-fable-5-1-max", + "name": "Claude Fable 5.1 1M Max (NO ZDR) (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-fable-5-1-medium", + "name": "Claude Fable 5.1 1M Medium (NO ZDR) (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-fable-5-1-thinking-high", + "name": "Claude Fable 5.1 1M Thinking (NO ZDR) (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-fable-5-1-thinking-low", + "name": "Claude Fable 5.1 1M Low Thinking (NO ZDR) (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-fable-5-1-thinking-max", + "name": "Claude Fable 5.1 1M Max Thinking (NO ZDR) (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-fable-5-1-thinking-medium", + "name": "Claude Fable 5.1 1M Medium Thinking (NO ZDR) (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-fable-5-1-thinking-xhigh", + "name": "Claude Fable 5.1 1M Extra High Thinking (NO ZDR) (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-fable-5-1-xhigh", + "name": "Claude Fable 5.1 1M Extra High (NO ZDR) (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-fable-5-high", + "name": "Claude Fable 5 1M (NO ZDR) (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-fable-5-low", + "name": "Claude Fable 5 1M Low (NO ZDR) (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-fable-5-max", + "name": "Claude Fable 5 1M Max (NO ZDR) (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-fable-5-medium", + "name": "Claude Fable 5 1M Medium (NO ZDR) (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-fable-5-thinking-high", + "name": "Claude Fable 5 1M Thinking (NO ZDR) (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-fable-5-thinking-low", + "name": "Claude Fable 5 1M Low Thinking (NO ZDR) (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-fable-5-thinking-max", + "name": "Claude Fable 5 1M Max Thinking (NO ZDR) (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-fable-5-thinking-medium", + "name": "Claude Fable 5 1M Medium Thinking (NO ZDR) (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-fable-5-thinking-xhigh", + "name": "Claude Fable 5 1M Extra High Thinking (NO ZDR) (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-fable-5-xhigh", + "name": "Claude Fable 5 1M Extra High (NO ZDR) (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-7-high", + "name": "Claude Opus 4.7 1M High (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-7-high-fast", + "name": "Claude Opus 4.7 1M High Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-7-low", + "name": "Claude Opus 4.7 1M Low (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-7-low-fast", + "name": "Claude Opus 4.7 1M Low Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-7-max", + "name": "Claude Opus 4.7 1M Max (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-7-max-fast", + "name": "Claude Opus 4.7 1M Max Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-7-medium", + "name": "Claude Opus 4.7 1M Medium (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-7-medium-fast", + "name": "Claude Opus 4.7 1M Medium Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-7-thinking-high", + "name": "Claude Opus 4.7 1M High Thinking (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-7-thinking-high-fast", + "name": "Claude Opus 4.7 1M High Thinking Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-7-thinking-low", + "name": "Claude Opus 4.7 1M Low Thinking (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-7-thinking-low-fast", + "name": "Claude Opus 4.7 1M Low Thinking Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-7-thinking-max", + "name": "Claude Opus 4.7 1M Max Thinking (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-7-thinking-max-fast", + "name": "Claude Opus 4.7 1M Max Thinking Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-7-thinking-medium", + "name": "Claude Opus 4.7 1M Medium Thinking (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-7-thinking-medium-fast", + "name": "Claude Opus 4.7 1M Medium Thinking Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-7-thinking-xhigh", + "name": "Claude Opus 4.7 1M Thinking (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-7-thinking-xhigh-fast", + "name": "Claude Opus 4.7 1M Thinking Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-7-xhigh", + "name": "Claude Opus 4.7 1M (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-7-xhigh-fast", + "name": "Claude Opus 4.7 1M Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-8-high", + "name": "Claude Opus 4.8 1M (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-8-high-fast", + "name": "Claude Opus 4.8 1M Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-8-low", + "name": "Claude Opus 4.8 1M Low (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-8-low-fast", + "name": "Claude Opus 4.8 1M Low Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-8-max", + "name": "Claude Opus 4.8 1M Max (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-8-max-fast", + "name": "Claude Opus 4.8 1M Max Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-8-medium", + "name": "Claude Opus 4.8 1M Medium (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-8-medium-fast", + "name": "Claude Opus 4.8 1M Medium Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-8-thinking-high", + "name": "Claude Opus 4.8 1M Thinking (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-8-thinking-high-fast", + "name": "Claude Opus 4.8 1M Thinking Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-8-thinking-low", + "name": "Claude Opus 4.8 1M Low Thinking (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-8-thinking-low-fast", + "name": "Claude Opus 4.8 1M Low Thinking Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-8-thinking-max", + "name": "Claude Opus 4.8 1M Max Thinking (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-8-thinking-max-fast", + "name": "Claude Opus 4.8 1M Max Thinking Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-8-thinking-medium", + "name": "Claude Opus 4.8 1M Medium Thinking (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-8-thinking-medium-fast", + "name": "Claude Opus 4.8 1M Medium Thinking Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-8-thinking-xhigh", + "name": "Claude Opus 4.8 1M Extra High Thinking (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-8-thinking-xhigh-fast", + "name": "Claude Opus 4.8 1M Extra High Thinking Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-8-xhigh", + "name": "Claude Opus 4.8 1M Extra High (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-8-xhigh-fast", + "name": "Claude Opus 4.8 1M Extra High Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-5-high", + "name": "Claude Opus 5 1M (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-5-high-fast", + "name": "Claude Opus 5 1M Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-5-low", + "name": "Claude Opus 5 1M Low (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-5-low-fast", + "name": "Claude Opus 5 1M Low Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-5-medium", + "name": "Claude Opus 5 1M Medium (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-5-medium-fast", + "name": "Claude Opus 5 1M Medium Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-5-thinking-high", + "name": "Claude Opus 5 1M Thinking (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-5-thinking-high-fast", + "name": "Claude Opus 5 1M Thinking Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-5-thinking-low", + "name": "Claude Opus 5 1M Low Thinking (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-5-thinking-low-fast", + "name": "Claude Opus 5 1M Low Thinking Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-5-thinking-max", + "name": "Claude Opus 5 1M Max Thinking (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-5-thinking-max-fast", + "name": "Claude Opus 5 1M Max Thinking Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-5-thinking-medium", + "name": "Claude Opus 5 1M Medium Thinking (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-5-thinking-medium-fast", + "name": "Claude Opus 5 1M Medium Thinking Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-5-thinking-xhigh", + "name": "Claude Opus 5 1M Extra High Thinking (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-5-thinking-xhigh-fast", + "name": "Claude Opus 5 1M Extra High Thinking Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-5-high", + "name": "Claude Sonnet 5 1M (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-5-low", + "name": "Claude Sonnet 5 1M Low (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-5-max", + "name": "Claude Sonnet 5 1M Max (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-5-medium", + "name": "Claude Sonnet 5 1M Medium (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-5-thinking-high", + "name": "Claude Sonnet 5 1M Thinking (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-5-thinking-low", + "name": "Claude Sonnet 5 1M Low Thinking (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-5-thinking-max", + "name": "Claude Sonnet 5 1M Max Thinking (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-5-thinking-medium", + "name": "Claude Sonnet 5 1M Medium Thinking (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-5-thinking-xhigh", + "name": "Claude Sonnet 5 1M Extra High Thinking (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-5-xhigh", + "name": "Claude Sonnet 5 1M Extra High (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "composer-2.5", + "name": "Composer 2.5 (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "composer-2.5-fast", + "name": "Composer 2.5 Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "cursor-grok-4.5-high", + "name": "Cursor Grok 4.5 (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 64000 + }, + { + "id": "cursor-grok-4.5-high-fast", + "name": "Cursor Grok 4.5 Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 64000 + }, + { + "id": "cursor-grok-4.5-low", + "name": "Cursor Grok 4.5 Low (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 64000 + }, + { + "id": "cursor-grok-4.5-low-fast", + "name": "Cursor Grok 4.5 Low Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 64000 + }, + { + "id": "cursor-grok-4.5-medium", + "name": "Cursor Grok 4.5 Medium (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 64000 + }, + { + "id": "cursor-grok-4.5-medium-fast", + "name": "Cursor Grok 4.5 Medium Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 64000 + }, + { + "id": "cursor-grok-4.6-high", + "name": "Cursor Grok 4.6 (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 64000 + }, + { + "id": "cursor-grok-4.6-high-fast", + "name": "Cursor Grok 4.6 Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 64000 + }, + { + "id": "cursor-grok-4.6-low", + "name": "Cursor Grok 4.6 Low (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 64000 + }, + { + "id": "cursor-grok-4.6-low-fast", + "name": "Cursor Grok 4.6 Low Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 64000 + }, + { + "id": "cursor-grok-4.6-medium", + "name": "Cursor Grok 4.6 Medium (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 64000 + }, + { + "id": "cursor-grok-4.6-medium-fast", + "name": "Cursor Grok 4.6 Medium Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 64000 + }, + { + "id": "cursor-grok-4.6-xhigh", + "name": "Cursor Grok 4.6 Extra High (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 64000 + }, + { + "id": "cursor-grok-4.6-xhigh-fast", + "name": "Cursor Grok 4.6 Extra High Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 64000 + }, + { + "id": "default", + "name": "Auto (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "gemini-3-flash", + "name": "Gemini 3 Flash (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 64000 + }, + { + "id": "gemini-3.1-pro", + "name": "Gemini 3.1 Pro (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 64000 + }, + { + "id": "gemini-3.5-flash", + "name": "Gemini 3.5 Flash (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 64000 + }, + { + "id": "gemini-3.6-flash-high", + "name": "Gemini 3.6 Flash (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 64000 + }, + { + "id": "gemini-3.6-flash-low", + "name": "Gemini 3.6 Flash Low (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 64000 + }, + { + "id": "gemini-3.6-flash-medium", + "name": "Gemini 3.6 Flash Medium (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 64000 + }, + { + "id": "gemini-3.6-flash-minimal", + "name": "Gemini 3.6 Flash Minimal (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 64000 + }, + { + "id": "gemini-3.7-flash-high", + "name": "Gemini 3.7 Flash (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 64000 + }, + { + "id": "gemini-3.7-flash-low", + "name": "Gemini 3.7 Flash Low (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 64000 + }, + { + "id": "gemini-3.7-flash-medium", + "name": "Gemini 3.7 Flash Medium (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 64000 + }, + { + "id": "gemini-3.8-flash-high", + "name": "Gemini 3.8 Flash High (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 64000 + }, + { + "id": "gemini-3.8-flash-low", + "name": "Gemini 3.8 Flash Low (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 64000 + }, + { + "id": "gemini-3.8-flash-medium", + "name": "Gemini 3.8 Flash Medium (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 64000 + }, + { + "id": "glm-5.2-high", + "name": "GLM 5.2 (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 64000 + }, + { + "id": "glm-5.2-max", + "name": "GLM 5.2 Max (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 64000 + }, + { + "id": "gpt-5-mini", + "name": "GPT-5 Mini (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.1", + "name": "GPT-5.1 (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.1-high", + "name": "GPT-5.1 High (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.1-low", + "name": "GPT-5.1 Low (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.2", + "name": "GPT-5.2 (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 384000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.2-fast", + "name": "GPT-5.2 Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 384000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.2-high", + "name": "GPT-5.2 High (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 384000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.2-high-fast", + "name": "GPT-5.2 High Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 384000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.2-low", + "name": "GPT-5.2 Low (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 384000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.2-low-fast", + "name": "GPT-5.2 Low Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 384000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.2-xhigh", + "name": "GPT-5.2 Extra High (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 384000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.2-xhigh-fast", + "name": "GPT-5.2 Extra High Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 384000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.3-codex", + "name": "Codex 5.3 (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.3-codex-fast", + "name": "Codex 5.3 Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.3-codex-high", + "name": "Codex 5.3 High (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.3-codex-high-fast", + "name": "Codex 5.3 High Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.3-codex-low", + "name": "Codex 5.3 Low (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.3-codex-low-fast", + "name": "Codex 5.3 Low Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.3-codex-xhigh", + "name": "Codex 5.3 Extra High (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.3-codex-xhigh-fast", + "name": "Codex 5.3 Extra High Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.4-high", + "name": "GPT-5.4 1M High (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.4-high-fast", + "name": "GPT-5.4 High Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.4-low", + "name": "GPT-5.4 1M Low (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.4-medium", + "name": "GPT-5.4 1M (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.4-medium-fast", + "name": "GPT-5.4 Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.4-mini-high", + "name": "GPT-5.4 Mini High (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.4-mini-low", + "name": "GPT-5.4 Mini Low (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.4-mini-medium", + "name": "GPT-5.4 Mini (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.4-mini-none", + "name": "GPT-5.4 Mini None (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.4-mini-xhigh", + "name": "GPT-5.4 Mini Extra High (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.4-nano-high", + "name": "GPT-5.4 Nano High (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.4-nano-low", + "name": "GPT-5.4 Nano Low (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.4-nano-medium", + "name": "GPT-5.4 Nano (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.4-nano-none", + "name": "GPT-5.4 Nano None (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.4-nano-xhigh", + "name": "GPT-5.4 Nano Extra High (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.4-xhigh", + "name": "GPT-5.4 1M Extra High (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.4-xhigh-fast", + "name": "GPT-5.4 Extra High Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.5-extra-high", + "name": "GPT-5.5 1M Extra High (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.5-extra-high-fast", + "name": "GPT-5.5 Extra High Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.5-high", + "name": "GPT-5.5 1M High (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.5-high-fast", + "name": "GPT-5.5 High Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.5-low", + "name": "GPT-5.5 1M Low (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.5-low-fast", + "name": "GPT-5.5 Low Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.5-medium", + "name": "GPT-5.5 1M (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.5-medium-fast", + "name": "GPT-5.5 Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.5-none", + "name": "GPT-5.5 1M None (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.5-none-fast", + "name": "GPT-5.5 None Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-luna-high", + "name": "GPT-5.6 Luna 1M High (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-luna-high-fast", + "name": "GPT-5.6 Luna 1M High Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-luna-low", + "name": "GPT-5.6 Luna 1M Low (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-luna-low-fast", + "name": "GPT-5.6 Luna 1M Low Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-luna-max", + "name": "GPT-5.6 Luna 1M Max (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-luna-max-fast", + "name": "GPT-5.6 Luna 1M Max Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-luna-medium", + "name": "GPT-5.6 Luna 1M (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-luna-medium-fast", + "name": "GPT-5.6 Luna 1M Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-luna-none", + "name": "GPT-5.6 Luna 1M None (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-luna-none-fast", + "name": "GPT-5.6 Luna 1M None Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-luna-xhigh", + "name": "GPT-5.6 Luna 1M Extra High (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-luna-xhigh-fast", + "name": "GPT-5.6 Luna 1M Extra High Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-sol-high", + "name": "GPT-5.6 Sol 1M High (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-sol-high-fast", + "name": "GPT-5.6 Sol 1M High Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-sol-low", + "name": "GPT-5.6 Sol 1M Low (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-sol-low-fast", + "name": "GPT-5.6 Sol 1M Low Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-sol-max", + "name": "GPT-5.6 Sol 1M Max (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-sol-max-fast", + "name": "GPT-5.6 Sol 1M Max Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-sol-medium", + "name": "GPT-5.6 Sol 1M (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-sol-medium-fast", + "name": "GPT-5.6 Sol 1M Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-sol-none", + "name": "GPT-5.6 Sol 1M None (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-sol-none-fast", + "name": "GPT-5.6 Sol 1M None Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-sol-xhigh", + "name": "GPT-5.6 Sol 1M Extra High (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-sol-xhigh-fast", + "name": "GPT-5.6 Sol 1M Extra High Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-terra-high", + "name": "GPT-5.6 Terra 1M High (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-terra-high-fast", + "name": "GPT-5.6 Terra 1M High Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-terra-low", + "name": "GPT-5.6 Terra 1M Low (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-terra-low-fast", + "name": "GPT-5.6 Terra 1M Low Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-terra-max", + "name": "GPT-5.6 Terra 1M Max (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-terra-max-fast", + "name": "GPT-5.6 Terra 1M Max Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-terra-medium", + "name": "GPT-5.6 Terra 1M (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-terra-medium-fast", + "name": "GPT-5.6 Terra 1M Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-terra-none", + "name": "GPT-5.6 Terra 1M None (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-terra-none-fast", + "name": "GPT-5.6 Terra 1M None Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-terra-xhigh", + "name": "GPT-5.6 Terra 1M Extra High (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gpt-5.6-terra-xhigh-fast", + "name": "GPT-5.6 Terra 1M Extra High Fast (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "kimi-k2.7-code", + "name": "Kimi K2.7 Code (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 64000 + }, + { + "id": "kimi-k3-high", + "name": "Kimi K3 High (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 64000 + }, + { + "id": "kimi-k3-low", + "name": "Kimi K3 Low (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 64000 + }, + { + "id": "kimi-k3-max", + "name": "Kimi K3 (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 64000 + }, + { + "id": "muse-spark-1.3-high", + "name": "Muse Spark 1.3 1M (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "muse-spark-1.3-low", + "name": "Muse Spark 1.3 1M Low (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "muse-spark-1.3-max", + "name": "Muse Spark 1.3 1M Max (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "muse-spark-1.3-medium", + "name": "Muse Spark 1.3 1M Medium (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "muse-spark-1.3-minimal", + "name": "Muse Spark 1.3 1M Minimal (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "muse-spark-1.3-xhigh", + "name": "Muse Spark 1.3 1M Extra High (Cursor)", + "api": "cursor-agent", + "provider": "cursor", + "baseUrl": "https://api2.cursor.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "deepseek-flash", + "name": "DeepSeek V4.1 Flash 1017", + "api": "openai-completions", + "provider": "deepseek", + "baseUrl": "https://api.deepseek.com", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek", + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.006, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 384000 + }, + { + "id": "deepseek-v4-flash", + "name": "DeepSeek V4.1 Flash 1017 (legacy alias)", + "api": "openai-completions", + "provider": "deepseek", + "baseUrl": "https://api.deepseek.com", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek", + "maxTokensField": "max_tokens" + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": "max", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.006, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 384000 + }, + { + "id": "deepseek-v4-pro", + "name": "DeepSeek V4 Pro", + "api": "openai-completions", + "provider": "deepseek", + "baseUrl": "https://api.deepseek.com", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": "max", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 1.32, + "output": 3.96, + "cacheRead": 0.044, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 384000 + }, + { + "id": "MODEL_CHAT_GPT_4_1_2025_04_14", + "name": "GPT-4.1 (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1047576, + "maxTokens": 32768 + }, + { + "id": "MODEL_CLAUDE_4_5_OPUS", + "name": "Claude Opus 4.5 (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "MODEL_CLAUDE_4_5_OPUS_THINKING", + "name": "Claude Opus 4.5 Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "MODEL_GOOGLE_GEMINI_3_0_FLASH_HIGH", + "name": "Gemini 3 Flash High (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65535 + }, + { + "id": "MODEL_GOOGLE_GEMINI_3_0_FLASH_LOW", + "name": "Gemini 3 Flash Low (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65535 + }, + { + "id": "MODEL_GOOGLE_GEMINI_3_0_FLASH_MEDIUM", + "name": "Gemini 3 Flash Medium (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65535 + }, + { + "id": "MODEL_GOOGLE_GEMINI_3_0_FLASH_MINIMAL", + "name": "Gemini 3 Flash Minimal (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65535 + }, + { + "id": "MODEL_GPT_5_2_HIGH", + "name": "GPT-5.2 High Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 384000, + "maxTokens": 128000 + }, + { + "id": "MODEL_GPT_5_2_LOW", + "name": "GPT-5.2 Low Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 384000, + "maxTokens": 128000 + }, + { + "id": "MODEL_GPT_5_2_MEDIUM", + "name": "GPT-5.2 Medium Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 384000, + "maxTokens": 128000 + }, + { + "id": "MODEL_GPT_5_2_NONE", + "name": "GPT-5.2 No Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 384000, + "maxTokens": 128000 + }, + { + "id": "MODEL_GPT_5_2_XHIGH", + "name": "GPT-5.2 XHigh Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 384000, + "maxTokens": 128000 + }, + { + "id": "MODEL_PRIVATE_11", + "name": "Claude Haiku 4.5 (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "MODEL_PRIVATE_12", + "name": "GPT-5.1 No Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "MODEL_PRIVATE_13", + "name": "GPT-5.1 Low Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "MODEL_PRIVATE_14", + "name": "GPT-5.1 Medium Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "MODEL_PRIVATE_15", + "name": "GPT-5.1 High Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "claude-5-fable-high", + "name": "Claude Fable 5 High (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-5-fable-low", + "name": "Claude Fable 5 Low (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-5-fable-max", + "name": "Claude Fable 5 Max (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-5-fable-medium", + "name": "Claude Fable 5 Medium (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-5-fable-xhigh", + "name": "Claude Fable 5 XHigh (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-1-high", + "name": "Claude Fable 5.1 High (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-1-low", + "name": "Claude Fable 5.1 Low (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-1-max", + "name": "Claude Fable 5.1 Max (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-1-medium", + "name": "Claude Fable 5.1 Medium (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-1-xhigh", + "name": "Claude Fable 5.1 XHigh (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-haiku-5-5-high", + "name": "Claude Haiku 5.5 High (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-haiku-5-5-low", + "name": "Claude Haiku 5.5 Low (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-haiku-5-5-max", + "name": "Claude Haiku 5.5 Max (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-haiku-5-5-medium", + "name": "Claude Haiku 5.5 Medium (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-haiku-5-5-xhigh", + "name": "Claude Haiku 5.5 XHigh (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-6", + "name": "Claude Opus 4.6 (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-6-1m", + "name": "Claude Opus 4.6 1M (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-6-thinking", + "name": "Claude Opus 4.6 Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-6-thinking-1m", + "name": "Claude Opus 4.6 Thinking 1M (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-7-high", + "name": "Claude Opus 4.7 High (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-7-low", + "name": "Claude Opus 4.7 Low (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-7-max", + "name": "Claude Opus 4.7 Max (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-7-medium", + "name": "Claude Opus 4.7 Medium (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-7-xhigh", + "name": "Claude Opus 4.7 XHigh (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-8-high", + "name": "Claude Opus 4.8 High (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-8-high-fast", + "name": "Claude Opus 4.8 High Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-8-low", + "name": "Claude Opus 4.8 Low (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-8-low-fast", + "name": "Claude Opus 4.8 Low Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-8-max", + "name": "Claude Opus 4.8 Max (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-8-max-fast", + "name": "Claude Opus 4.8 Max Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-8-medium", + "name": "Claude Opus 4.8 Medium (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-8-medium-fast", + "name": "Claude Opus 4.8 Medium Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-8-xhigh", + "name": "Claude Opus 4.8 XHigh (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-8-xhigh-fast", + "name": "Claude Opus 4.8 XHigh Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-5-high", + "name": "Claude Opus 5.5 High (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-5-high-fast", + "name": "Claude Opus 5.5 High Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-5-low", + "name": "Claude Opus 5.5 Low (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-5-low-fast", + "name": "Claude Opus 5.5 Low Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-5-max", + "name": "Claude Opus 5.5 Max (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-5-max-fast", + "name": "Claude Opus 5.5 Max Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-5-medium", + "name": "Claude Opus 5.5 Medium (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-5-medium-fast", + "name": "Claude Opus 5.5 Medium Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-5-xhigh", + "name": "Claude Opus 5.5 XHigh (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-5-xhigh-fast", + "name": "Claude Opus 5.5 XHigh Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-high", + "name": "Claude Opus 5 High (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-high-fast", + "name": "Claude Opus 5 High Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-low", + "name": "Claude Opus 5 Low (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-low-fast", + "name": "Claude Opus 5 Low Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-max", + "name": "Claude Opus 5 Max (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-max-fast", + "name": "Claude Opus 5 Max Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-medium", + "name": "Claude Opus 5 Medium (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-medium-fast", + "name": "Claude Opus 5 Medium Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-xhigh", + "name": "Claude Opus 5 XHigh (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-xhigh-fast", + "name": "Claude Opus 5 XHigh Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-4-6", + "name": "Claude Sonnet 4.6 (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-4-6-1m", + "name": "Claude Sonnet 4.6 1M (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-4-6-thinking", + "name": "Claude Sonnet 4.6 Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-4-6-thinking-1m", + "name": "Claude Sonnet 4.6 Thinking 1M (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5-5-high", + "name": "Claude Sonnet 5.5 High (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5-5-low", + "name": "Claude Sonnet 5.5 Low (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5-5-max", + "name": "Claude Sonnet 5.5 Max (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5-5-medium", + "name": "Claude Sonnet 5.5 Medium (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5-5-xhigh", + "name": "Claude Sonnet 5.5 XHigh (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5-high", + "name": "Claude Sonnet 5 High (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5-low", + "name": "Claude Sonnet 5 Low (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5-max", + "name": "Claude Sonnet 5 Max (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5-medium", + "name": "Claude Sonnet 5 Medium (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5-xhigh", + "name": "Claude Sonnet 5 XHigh (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "deepseek-v4-1-flash-high", + "name": "DeepSeek V4.1 Flash High (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 384000 + }, + { + "id": "deepseek-v4-1-flash-max", + "name": "DeepSeek V4.1 Flash Max (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 384000 + }, + { + "id": "deepseek-v4-flash-high", + "name": "DeepSeek V4 Flash High (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 384000 + }, + { + "id": "deepseek-v4-flash-max", + "name": "DeepSeek V4 Flash Max (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 384000 + }, + { + "id": "deepseek-v4-pro-high", + "name": "DeepSeek V4 Pro High (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 384000 + }, + { + "id": "deepseek-v4-pro-max", + "name": "DeepSeek V4 Pro Max (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 384000 + }, + { + "id": "gemini-3-1-pro-high", + "name": "Gemini 3.1 Pro High Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65535 + }, + { + "id": "gemini-3-1-pro-low", + "name": "Gemini 3.1 Pro Low Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65535 + }, + { + "id": "gemini-3-5-flash-high", + "name": "Gemini 3.5 Flash High (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65535 + }, + { + "id": "gemini-3-5-flash-low", + "name": "Gemini 3.5 Flash Low (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65535 + }, + { + "id": "gemini-3-5-flash-medium", + "name": "Gemini 3.5 Flash Medium (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65535 + }, + { + "id": "gemini-3-5-flash-minimal", + "name": "Gemini 3.5 Flash Minimal (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65535 + }, + { + "id": "gemini-3-6-flash-high", + "name": "Gemini 3.6 Flash High (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65535 + }, + { + "id": "gemini-3-6-flash-low", + "name": "Gemini 3.6 Flash Low (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65535 + }, + { + "id": "gemini-3-6-flash-medium", + "name": "Gemini 3.6 Flash Medium (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65535 + }, + { + "id": "gemini-3-6-flash-minimal", + "name": "Gemini 3.6 Flash Minimal (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65535 + }, + { + "id": "gemini-3-7-flash-high", + "name": "Gemini 3.7 Flash High (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65535 + }, + { + "id": "gemini-3-7-flash-low", + "name": "Gemini 3.7 Flash Low (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65535 + }, + { + "id": "gemini-3-7-flash-medium", + "name": "Gemini 3.7 Flash Medium (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65535 + }, + { + "id": "gemini-3-8-flash-high", + "name": "Gemini 3.8 Flash High (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65535 + }, + { + "id": "gemini-3-8-flash-low", + "name": "Gemini 3.8 Flash Low (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65535 + }, + { + "id": "gemini-3-8-flash-medium", + "name": "Gemini 3.8 Flash Medium (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65535 + }, + { + "id": "glm-5-2", + "name": "GLM-5.2 High (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 128000 + }, + { + "id": "glm-5-2-1m", + "name": "GLM-5.2 High 1M (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "glm-5-2-max", + "name": "GLM-5.2 Max (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 128000 + }, + { + "id": "glm-5-2-max-1m", + "name": "GLM-5.2 Max 1M (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "glm-5-2-none", + "name": "GLM-5.2 No Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 128000 + }, + { + "id": "glm-5-2-none-1m", + "name": "GLM-5.2 No Thinking 1M (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "glm-5-3-flash-high", + "name": "GLM-5.3 Flash High (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "glm-5-3-flash-low", + "name": "GLM-5.3 Flash Low (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "glm-5-3-flash-max", + "name": "GLM-5.3 Flash Max (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "glm-5-3-high", + "name": "GLM-5.3 High (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 128000 + }, + { + "id": "glm-5-3-low", + "name": "GLM-5.3 Low (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 128000 + }, + { + "id": "glm-5-3-max", + "name": "GLM-5.3 Max (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 128000 + }, + { + "id": "gpt-5-3-codex-high", + "name": "GPT-5.3-Codex High (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-3-codex-high-priority", + "name": "GPT-5.3-Codex High Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-3-codex-low", + "name": "GPT-5.3-Codex Low (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-3-codex-low-priority", + "name": "GPT-5.3-Codex Low Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-3-codex-medium", + "name": "GPT-5.3-Codex Medium (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-3-codex-medium-priority", + "name": "GPT-5.3-Codex Medium Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-3-codex-xhigh", + "name": "GPT-5.3-Codex X-High (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-3-codex-xhigh-priority", + "name": "GPT-5.3-Codex XHigh Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-4-high", + "name": "GPT-5.4 High Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-4-high-priority", + "name": "GPT-5.4 High Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-4-low", + "name": "GPT-5.4 Low Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-4-low-priority", + "name": "GPT-5.4 Low Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-4-medium", + "name": "GPT-5.4 Medium Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-4-medium-priority", + "name": "GPT-5.4 Medium Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-4-mini-high", + "name": "GPT-5.4 Mini High Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-4-mini-low", + "name": "GPT-5.4 Mini Low Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-4-mini-medium", + "name": "GPT-5.4 Mini Medium Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-4-mini-xhigh", + "name": "GPT-5.4 Mini XHigh Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-4-none", + "name": "GPT-5.4 No Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-4-none-priority", + "name": "GPT-5.4 No Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-4-xhigh", + "name": "GPT-5.4 XHigh Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-4-xhigh-priority", + "name": "GPT-5.4 XHigh Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-5-high", + "name": "GPT-5.5 High Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-5-high-priority", + "name": "GPT-5.5 High Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-5-low", + "name": "GPT-5.5 Low Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-5-low-priority", + "name": "GPT-5.5 Low Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-5-medium", + "name": "GPT-5.5 Medium Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-5-medium-priority", + "name": "GPT-5.5 Medium Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-5-none", + "name": "GPT-5.5 No Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-5-none-priority", + "name": "GPT-5.5 No Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-5-xhigh", + "name": "GPT-5.5 XHigh Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-5-xhigh-priority", + "name": "GPT-5.5 XHigh Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-luna-high", + "name": "GPT-5.6 Luna High Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-luna-high-priority", + "name": "GPT-5.6 Luna High Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-luna-low", + "name": "GPT-5.6 Luna Low Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-luna-low-priority", + "name": "GPT-5.6 Luna Low Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-luna-max", + "name": "GPT-5.6 Luna Max Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-luna-max-priority", + "name": "GPT-5.6 Luna Max Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-luna-medium", + "name": "GPT-5.6 Luna Medium Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-luna-medium-priority", + "name": "GPT-5.6 Luna Medium Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-luna-none", + "name": "GPT-5.6 Luna No Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-luna-none-priority", + "name": "GPT-5.6 Luna No Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-luna-xhigh", + "name": "GPT-5.6 Luna XHigh Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-luna-xhigh-priority", + "name": "GPT-5.6 Luna XHigh Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-sol-high", + "name": "GPT-5.6 Sol High Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-sol-high-priority", + "name": "GPT-5.6 Sol High Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-sol-low", + "name": "GPT-5.6 Sol Low Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-sol-low-priority", + "name": "GPT-5.6 Sol Low Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-sol-max", + "name": "GPT-5.6 Sol Max Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-sol-max-priority", + "name": "GPT-5.6 Sol Max Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-sol-medium", + "name": "GPT-5.6 Sol Medium Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-sol-medium-priority", + "name": "GPT-5.6 Sol Medium Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-sol-none", + "name": "GPT-5.6 Sol No Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-sol-none-priority", + "name": "GPT-5.6 Sol No Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-sol-xhigh", + "name": "GPT-5.6 Sol XHigh Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-sol-xhigh-priority", + "name": "GPT-5.6 Sol XHigh Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-terra-high", + "name": "GPT-5.6 Terra High Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-terra-high-priority", + "name": "GPT-5.6 Terra High Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-terra-low", + "name": "GPT-5.6 Terra Low Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-terra-low-priority", + "name": "GPT-5.6 Terra Low Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-terra-max", + "name": "GPT-5.6 Terra Max Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-terra-max-priority", + "name": "GPT-5.6 Terra Max Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-terra-medium", + "name": "GPT-5.6 Terra Medium Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-terra-medium-priority", + "name": "GPT-5.6 Terra Medium Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-terra-none", + "name": "GPT-5.6 Terra No Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-terra-none-priority", + "name": "GPT-5.6 Terra No Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-terra-xhigh", + "name": "GPT-5.6 Terra XHigh Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-6-terra-xhigh-priority", + "name": "GPT-5.6 Terra XHigh Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-1-sol-high", + "name": "GPT-6.1 Sol High Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-1-sol-high-priority", + "name": "GPT-6.1 Sol High Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-1-sol-low", + "name": "GPT-6.1 Sol Low Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-1-sol-low-priority", + "name": "GPT-6.1 Sol Low Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-1-sol-max", + "name": "GPT-6.1 Sol Max Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-1-sol-max-priority", + "name": "GPT-6.1 Sol Max Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-1-sol-medium", + "name": "GPT-6.1 Sol Medium Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-1-sol-medium-priority", + "name": "GPT-6.1 Sol Medium Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-1-sol-xhigh", + "name": "GPT-6.1 Sol XHigh Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-1-sol-xhigh-priority", + "name": "GPT-6.1 Sol XHigh Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-astra-high", + "name": "GPT-6 Astra High Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-astra-high-priority", + "name": "GPT-6 Astra High Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-astra-low", + "name": "GPT-6 Astra Low Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-astra-low-priority", + "name": "GPT-6 Astra Low Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-astra-max", + "name": "GPT-6 Astra Max Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-astra-max-priority", + "name": "GPT-6 Astra Max Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-astra-medium", + "name": "GPT-6 Astra Medium Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-astra-medium-priority", + "name": "GPT-6 Astra Medium Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-astra-xhigh", + "name": "GPT-6 Astra XHigh Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-astra-xhigh-priority", + "name": "GPT-6 Astra XHigh Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-luna-high", + "name": "GPT-6 Luna High Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-luna-high-priority", + "name": "GPT-6 Luna High Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-luna-low", + "name": "GPT-6 Luna Low Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-luna-low-priority", + "name": "GPT-6 Luna Low Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-luna-max", + "name": "GPT-6 Luna Max Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-luna-max-priority", + "name": "GPT-6 Luna Max Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-luna-medium", + "name": "GPT-6 Luna Medium Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-luna-medium-priority", + "name": "GPT-6 Luna Medium Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-luna-none", + "name": "GPT-6 Luna No Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-luna-none-priority", + "name": "GPT-6 Luna No Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-luna-xhigh", + "name": "GPT-6 Luna XHigh Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-luna-xhigh-priority", + "name": "GPT-6 Luna XHigh Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-sol-high", + "name": "GPT-6 Sol High Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-sol-high-priority", + "name": "GPT-6 Sol High Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-sol-low", + "name": "GPT-6 Sol Low Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-sol-low-priority", + "name": "GPT-6 Sol Low Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-sol-max", + "name": "GPT-6 Sol Max Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-sol-max-priority", + "name": "GPT-6 Sol Max Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-sol-medium", + "name": "GPT-6 Sol Medium Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-sol-medium-priority", + "name": "GPT-6 Sol Medium Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-sol-none", + "name": "GPT-6 Sol No Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-sol-none-priority", + "name": "GPT-6 Sol No Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-sol-xhigh", + "name": "GPT-6 Sol XHigh Thinking (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-sol-xhigh-priority", + "name": "GPT-6 Sol XHigh Thinking Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "grok-4-5-high", + "name": "Grok 4.5 High (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 100000 + }, + { + "id": "grok-4-5-low", + "name": "Grok 4.5 Low (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 100000 + }, + { + "id": "grok-4-5-medium", + "name": "Grok 4.5 Medium (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 100000 + }, + { + "id": "grok-4-6-high", + "name": "Grok 4.6 High (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 100000 + }, + { + "id": "grok-4-6-low", + "name": "Grok 4.6 Low (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 100000 + }, + { + "id": "grok-4-6-medium", + "name": "Grok 4.6 Medium (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 100000 + }, + { + "id": "grok-4-6-xhigh", + "name": "Grok 4.6 XHigh (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 100000 + }, + { + "id": "grok-4-7-high", + "name": "Grok 4.7 High (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 100000 + }, + { + "id": "grok-4-7-low", + "name": "Grok 4.7 Low (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 100000 + }, + { + "id": "grok-4-7-medium", + "name": "Grok 4.7 Medium (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 100000 + }, + { + "id": "grok-4-7-xhigh", + "name": "Grok 4.7 XHigh (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 100000 + }, + { + "id": "kimi-k2-6", + "name": "Kimi K2.6 (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 8192 + }, + { + "id": "kimi-k2-7", + "name": "Kimi K2.7 (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 16000 + }, + { + "id": "kimi-k3-high", + "name": "Kimi K3 High (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "kimi-k3-low", + "name": "Kimi K3 Low (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "kimi-k3-max", + "name": "Kimi K3 Max (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "nemotron-3-ultra-high", + "name": "Nemotron 3 Ultra High (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 32768 + }, + { + "id": "nemotron-3-ultra-medium", + "name": "Nemotron 3 Ultra Medium (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 32768 + }, + { + "id": "nemotron-3-ultra-none", + "name": "Nemotron 3 Ultra None (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 32768 + }, + { + "id": "swe-1-6", + "name": "SWE-1.6 (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 128000 + }, + { + "id": "swe-1-6-fast", + "name": "SWE-1.6 Fast (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 128000 + }, + { + "id": "swe-1-7", + "name": "SWE-1.7 Max (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262000, + "maxTokens": 128000 + }, + { + "id": "swe-1-7-lightning", + "name": "SWE-1.7 Lightning Max (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 202752, + "maxTokens": 96000 + }, + { + "id": "swe-1-7-lightning-medium", + "name": "SWE-1.7 Lightning Medium (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 202752, + "maxTokens": 96000 + }, + { + "id": "swe-1-7-medium", + "name": "SWE-1.7 Medium (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262000, + "maxTokens": 128000 + }, + { + "id": "swe-2", + "name": "SWE-2 (Devin CLI)", + "api": "devin-agent", + "provider": "devin", + "baseUrl": "https://server.codeium.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 16384 + }, + { + "id": "aion-2.0", + "name": "Aion 2.0", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.8, + "output": 1.6, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 32768 + }, + { + "id": "aion-3.0", + "name": "Aion 3.0", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 3, + "output": 6, + "cacheRead": 0.75, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 32768 + }, + { + "id": "aion-3.0-mini", + "name": "Aion 3.0 Mini", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.7, + "output": 1.4, + "cacheRead": 0.18, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 32768 + }, + { + "id": "claude-fable-5", + "name": "Claude Fable 5", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5.1", + "name": "Claude Fable 5.1", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 0.25, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-latest", + "name": "Claude Fable Latest", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 0.25, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-haiku-4.5", + "name": "Claude Haiku 4.5", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-haiku-5.5", + "name": "Claude Haiku 5.5", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.5, + "cacheRead": 0.01, + "cacheWrite": 0.125 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-haiku-latest", + "name": "Claude Haiku Latest", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.01, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4.5", + "name": "Claude Opus 4.5", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4.6", + "name": "Claude Opus 4.6", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4.7", + "name": "Claude Opus 4.7", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4.8", + "name": "Claude Opus 4.8", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5", + "name": "Claude Opus 5", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5.5", + "name": "Claude Opus 5.5", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.2, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-latest", + "name": "Claude Opus Latest", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-4.5", + "name": "Claude Sonnet 4.5", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4.6", + "name": "Claude Sonnet 4.6", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5", + "name": "Claude Sonnet 5", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5.5", + "name": "Claude Sonnet 5.5", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.1, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-latest", + "name": "Claude Sonnet Latest", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "codestral-2508", + "name": "Codestral 2508", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 0.9, + "cacheRead": 0.3, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 204800 + }, + { + "id": "command-a", + "name": "Command A", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 2.5, + "output": 10, + "cacheRead": 2.5, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 8192 + }, + { + "id": "command-r-08-2024", + "name": "Command R (08-2024)", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 4000 + }, + { + "id": "command-r-plus-08-2024", + "name": "Command R+ (08-2024)", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 2.5, + "output": 10, + "cacheRead": 2.5, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 4000 + }, + { + "id": "deepseek-r1", + "name": "Deepseek R1", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.7, + "output": 2.5, + "cacheRead": 0.7, + "cacheWrite": 0 + }, + "contextWindow": 65536, + "maxTokens": 16000 + }, + { + "id": "deepseek-r1-0528", + "name": "Deepseek R1 0528", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": "ultra" + }, + "input": [ + "text" + ], + "cost": { + "input": 0.5, + "output": 2.15, + "cacheRead": 0.35, + "cacheWrite": 0 + }, + "contextWindow": 163840, + "maxTokens": 32768 + }, + { + "id": "deepseek-v3.2", + "name": "DeepSeek V3.2", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.28, + "output": 0.42, + "cacheRead": 0.028, + "cacheWrite": 0 + }, + "contextWindow": 163840, + "maxTokens": 163840 + }, + { + "id": "deepseek-v3.2-exp", + "name": "DeepSeek V3.2 Exp", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.27, + "output": 0.41, + "cacheRead": 0.27, + "cacheWrite": 0 + }, + "contextWindow": 163840, + "maxTokens": 147456 + }, + { + "id": "deepseek-v4-flash", + "name": "DeepSeek V4 Flash", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.19, + "output": 0.51, + "cacheRead": 0.028, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 384000 + }, + { + "id": "deepseek-v4-flash-0731", + "name": "DeepSeek V4 Flash 0731", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.44, + "output": 1.32, + "cacheRead": 0.028, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 393216 + }, + { + "id": "deepseek-v4-flash-latest", + "name": "DeepSeek V4 Flash Latest", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": "ultra" + }, + "input": [ + "text" + ], + "cost": { + "input": 0.44, + "output": 1.32, + "cacheRead": 0.028, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 393216 + }, + { + "id": "deepseek-v4-pro", + "name": "DeepSeek V4 Pro", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 1.74, + "output": 3.48, + "cacheRead": 0.145, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 393216 + }, + { + "id": "deepseek-v4-pro-0813", + "name": "DeepSeek V4 Pro 0813", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 1.188, + "output": 3.564, + "cacheRead": 0.022, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 393216 + }, + { + "id": "deepseek-v4.1-flash", + "name": "DeepSeek V4.1 Flash", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.006, + "cacheWrite": 0.3 + }, + "contextWindow": 1048576, + "maxTokens": 393216 + }, + { + "id": "deepseek-v4.1-flash-1017", + "name": "DeepSeek V4.1 Flash 1017", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.006, + "cacheWrite": 0.3 + }, + "contextWindow": 1048576, + "maxTokens": 393216 + }, + { + "id": "deepseek-v4.1-flash-uncensored", + "name": "DeepSeek V4.1 Flash 1017 Uncensored", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.03, + "cacheWrite": 0.3 + }, + "contextWindow": 1048576, + "maxTokens": 393216 + }, + { + "id": "fugu-max", + "name": "Fugu Max", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "fugu-ultra", + "name": "Fugu Ultra", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 30, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "fugu-ultra-v2", + "name": "Fugu Ultra v2", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 30, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gemini-2.5-flash", + "name": "Gemini 2.5 Flash", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 2.5, + "cacheRead": 0.03, + "cacheWrite": 0.03 + }, + "contextWindow": 1048576, + "maxTokens": 65535 + }, + { + "id": "gemini-2.5-flash-lite", + "name": "Gemini 2.5 Flash Lite", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.4, + "cacheRead": 0.01, + "cacheWrite": 0.01 + }, + "contextWindow": 1048576, + "maxTokens": 65535 + }, + { + "id": "gemini-2.5-pro", + "name": "Gemini 2.5 Pro", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.125, + "cacheWrite": 0.125 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-2.5-pro-preview", + "name": "Gemini 2.5 Pro Preview 06-05", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.125, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3-flash-preview", + "name": "Gemini 3 Flash Preview", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.5, + "output": 3, + "cacheRead": 0.05, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 4096 + }, + { + "id": "gemini-3-pro-image", + "name": "Nano Banana Pro (Gemini 3 Pro Image)", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 12, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 32768 + }, + { + "id": "gemini-3.1-flash-lite", + "name": "Gemini 3.1 Flash Lite", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 1.5, + "cacheRead": 0.025, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3.1-pro-preview", + "name": "Gemini 3.1 Pro Preview", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 12, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 4096 + }, + { + "id": "gemini-3.1-pro-preview-customtools", + "name": "Gemini 3.1 Pro Preview Custom Tools", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 12, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 4096 + }, + { + "id": "gemini-3.5-flash", + "name": "Gemini 3.5 Flash", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.5, + "output": 9, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3.5-flash-lite", + "name": "Gemini 3.5 Flash Lite", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 2.5, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3.6-flash", + "name": "Gemini 3.6 Flash", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 3.75, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3.7-flash", + "name": "Gemini 3.7 Flash", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.375, + "output": 1.875, + "cacheRead": 0.0375, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3.8-flash", + "name": "Gemini 3.8 Flash", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 3.75, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-4-argon", + "name": "Gemini 4 Argon", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.1, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 32768 + }, + { + "id": "gemini-flash-latest", + "name": "Gemini Flash Latest", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.375, + "output": 1.875, + "cacheRead": 0.0375, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 4096 + }, + { + "id": "gemini-pro-latest", + "name": "Gemini Pro Latest", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 12, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 4096 + }, + { + "id": "gemma-3-12b-it", + "name": "Gemma 3 12B IT", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.05, + "output": 0.15, + "cacheRead": 0.05, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 16384 + }, + { + "id": "gemma-3-27b-it", + "name": "Gemma 3 27B PT", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.08, + "output": 0.45, + "cacheRead": 0.04, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 117964 + }, + { + "id": "gemma-4-26b-a4b-it", + "name": "Gemma 4 26b A4b It", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "gemma-4-31b-it", + "name": "Gemma 4 31b It", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.09, + "output": 0.34, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 16384 + }, + { + "id": "glm-4.6v", + "name": "GLM 4.6V", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 0.9, + "cacheRead": 0.055, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 32768 + }, + { + "id": "glm-4.7", + "name": "GLM 4.7", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.6, + "output": 2.2, + "cacheRead": 0.11, + "cacheWrite": 0 + }, + "contextWindow": 202752, + "maxTokens": 131072 + }, + { + "id": "glm-4.7-flash", + "name": "GLM 4.7 Flash", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.07, + "output": 0.408, + "cacheRead": 0.014, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 131072 + }, + { + "id": "glm-5", + "name": "GLM 5", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 1, + "output": 3.2, + "cacheRead": 0.2, + "cacheWrite": 1 + }, + "contextWindow": 204800, + "maxTokens": 128000 + }, + { + "id": "glm-5-turbo", + "name": "GLM 5 Turbo", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 1.2, + "output": 4, + "cacheRead": 0.24, + "cacheWrite": 0 + }, + "contextWindow": 202752, + "maxTokens": 131072 + }, + { + "id": "glm-5.1", + "name": "GLM 5.1", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": "ultra" + }, + "input": [ + "text" + ], + "cost": { + "input": 1.4, + "output": 4.4, + "cacheRead": 0.26, + "cacheWrite": 1.4 + }, + "contextWindow": 204800, + "maxTokens": 128000 + }, + { + "id": "glm-5.2", + "name": "GLM 5.2", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 1.4, + "output": 4.4, + "cacheRead": 0.26, + "cacheWrite": 1.4 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "glm-5.3", + "name": "GLM 5.3", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 1.75, + "output": 5.5, + "cacheRead": 0.325, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "glm-5.3-flash", + "name": "GLM-5.3 Flash", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.5, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "glm-5.3-flash-uncensored", + "name": "GLM-5.3 Flash Uncensored", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.15, + "output": 0.5, + "cacheRead": 0.06, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "glm-5.3-uncensored", + "name": "GLM-5.3 Uncensored", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 1.4, + "output": 4.4, + "cacheRead": 0.26, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "glm-5v-turbo", + "name": "GLM 5V Turbo", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.2, + "output": 4, + "cacheRead": 0.24, + "cacheWrite": 0 + }, + "contextWindow": 202752, + "maxTokens": 131072 + }, + { + "id": "glm-latest", + "name": "GLM Latest", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 1.4, + "output": 4.4, + "cacheRead": 0.078, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "gpt-3.5-turbo-0613", + "name": "GPT-3.5 Turbo 0613", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 1, + "output": 2, + "cacheRead": 1, + "cacheWrite": 0 + }, + "contextWindow": 4095, + "maxTokens": 3685 + }, + { + "id": "gpt-3.5-turbo-16k", + "name": "GPT-3.5 Turbo 16K", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 3, + "output": 4, + "cacheRead": 3, + "cacheWrite": 0 + }, + "contextWindow": 16385, + "maxTokens": 4096 + }, + { + "id": "gpt-4.1", + "name": "GPT-4.1", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 2, + "output": 8, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 1047576, + "maxTokens": 32768 + }, + { + "id": "gpt-4.1-mini", + "name": "GPT-4.1 Mini", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.4, + "output": 1.6, + "cacheRead": 0.1, + "cacheWrite": 0 + }, + "contextWindow": 1047576, + "maxTokens": 32768 + }, + { + "id": "gpt-4.1-nano", + "name": "GPT-4.1 Nano", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.1, + "output": 0.4, + "cacheRead": 0.025, + "cacheWrite": 0 + }, + "contextWindow": 1047576, + "maxTokens": 32768 + }, + { + "id": "gpt-4o", + "name": "GPT-4o", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 2.5, + "output": 10, + "cacheRead": 1.25, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "gpt-4o-mini", + "name": "GPT-4o Mini", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "gpt-5", + "name": "GPT-5", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_completion_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.125, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-mini", + "name": "GPT-5 Mini", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_completion_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 2, + "cacheRead": 0.025, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-nano", + "name": "GPT-5 Nano", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_completion_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.05, + "output": 0.4, + "cacheRead": 0.005, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.1", + "name": "GPT-5.1", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_completion_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.125, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.1-codex", + "name": "GPT-5.1 Codex", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.13, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.1-codex-max", + "name": "GPT-5.1 Codex Max", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.125, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.1-codex-mini", + "name": "GPT-5.1 Codex Mini", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.25, + "output": 2, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.2", + "name": "GPT-5.2", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_completion_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 1.75, + "output": 14, + "cacheRead": 0.175, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.2-codex", + "name": "GPT-5.2 Codex", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 1.75, + "output": 14, + "cacheRead": 0.175, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.3-codex", + "name": "GPT-5.3 Codex", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 1.75, + "output": 14, + "cacheRead": 0.175, + "cacheWrite": 2.1875 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.4", + "name": "GPT-5.4", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 15, + "cacheRead": 0.25, + "cacheWrite": 3.125 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.4-mini", + "name": "GPT-5.4 Mini", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_completion_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 4.5, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.4-nano", + "name": "GPT-5.4 Nano", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_completion_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.2, + "output": 1.25, + "cacheRead": 0.02, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.4-pro", + "name": "GPT-5.4 Pro", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 30, + "output": 180, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.5", + "name": "GPT-5.5", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 30, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.5-pro", + "name": "GPT-5.5 Pro", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 30, + "output": 180, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.6-luna", + "name": "GPT-5.6 Luna", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.2, + "output": 1.2, + "cacheRead": 0.02, + "cacheWrite": 0.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.6-sol", + "name": "GPT-5.6 Sol", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.4, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.6-terra", + "name": "GPT-5.6 Terra", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 12, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-astra", + "name": "GPT-6 Astra", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-luna", + "name": "GPT-6 Luna", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.5, + "cacheRead": 0.01, + "cacheWrite": 0.125 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-sol", + "name": "GPT-6 Sol", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-6.1-sol", + "name": "GPT-6.1 Sol", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.1, + "cacheWrite": 2.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-chat-latest", + "name": "GPT Chat Latest", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_completion_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 30, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-latest", + "name": "GPT Latest", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-mini-latest", + "name": "GPT Mini Latest", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 4.5, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-oss-120b", + "name": "GPT Oss 120b", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 4096 + }, + { + "id": "gpt-oss-safeguard-20b", + "name": "Gpt Oss Safeguard 20b", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.075, + "output": 0.3, + "cacheRead": 0.0375, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 131072 + }, + { + "id": "grok-4", + "name": "Grok 4", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 3, + "cacheWrite": 0 + }, + "contextWindow": 4096, + "maxTokens": 4096 + }, + { + "id": "grok-4.20", + "name": "Grok 4.20", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 2.5, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 4096 + }, + { + "id": "grok-4.20-multi-agent", + "name": "Grok 4.20 Multi-Agent", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 2.5, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 4096 + }, + { + "id": "grok-4.20-non-reasoning", + "name": "Grok 4.20 Non-Reasoning", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 2.5, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 4096 + }, + { + "id": "grok-4.3", + "name": "Grok 4.3", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 2.5, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 4096 + }, + { + "id": "grok-4.5", + "name": "Grok 4.5", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.3, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 4096 + }, + { + "id": "grok-4.6", + "name": "Grok 4.6", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 128000 + }, + { + "id": "grok-4.7", + "name": "Grok 4.7", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 128000 + }, + { + "id": "grok-build-0.1", + "name": "Grok Build 0.1", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 2, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 4096 + }, + { + "id": "grok-code-fast-1", + "name": "Grok Code Fast 1", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.2, + "output": 1.5, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 10000 + }, + { + "id": "grok-latest", + "name": "Grok Latest", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 450000 + }, + { + "id": "hy3", + "name": "Hy3", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.132, + "output": 0.528, + "cacheRead": 0.033, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "hy3-preview", + "name": "Hy3 Preview", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.18, + "output": 0.6, + "cacheRead": 0.06, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "hy4-preview", + "name": "Tencent Hy4 Preview", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_completion_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": "ultra" + }, + "input": [ + "text" + ], + "cost": { + "input": 0.834, + "output": 2.501, + "cacheRead": 0.042, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "inkling", + "name": "Inkling", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 4.05, + "cacheRead": 0.17, + "cacheWrite": 0 + }, + "contextWindow": 524288, + "maxTokens": 262144 + }, + { + "id": "inkling-small", + "name": "Inkling Small", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.45, + "output": 1.2, + "cacheRead": 0.1, + "cacheWrite": 0 + }, + "contextWindow": 524288, + "maxTokens": 65536 + }, + { + "id": "kimi-k2-0905", + "name": "Kimi K2 0905", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.6, + "output": 2.5, + "cacheRead": 0.6, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 98304 + }, + { + "id": "kimi-k2-thinking", + "name": "Kimi K2 Thinking", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.6, + "output": 2.5, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 98304 + }, + { + "id": "kimi-k2.5", + "name": "Kimi K2.5", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.5, + "output": 2.5, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "kimi-k2.6", + "name": "Kimi K2.6", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.95, + "output": 4, + "cacheRead": 0.16, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "kimi-k2.7-code", + "name": "Kimi K2.7 Code", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.95, + "output": 4, + "cacheRead": 0.19, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "kimi-k3", + "name": "Kimi K3", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": "ultra" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3.3, + "output": 16.5, + "cacheRead": 0.33, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 262144 + }, + { + "id": "kimi-latest", + "name": "Kimi Latest", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 16, + "cacheRead": 0.228, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 943718 + }, + { + "id": "laguna-s-2.1", + "name": "Laguna S 2.1", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.09, + "output": 0.18, + "cacheRead": 0.009, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "laguna-xs-2.1", + "name": "Laguna XS 2.1", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.06, + "output": 0.12, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "ling-3.0-flash", + "name": "Ling 3.0 Flash", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.021, + "output": 0.063, + "cacheRead": 0.0042, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "ling-3.0-flash-fin", + "name": "Ling 3.0 Flash Fin", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.075, + "output": 0.22, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 235929 + }, + { + "id": "ling-3.0-flash-sante", + "name": "Ling 3.0 Flash Sante", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.075, + "output": 0.22, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "ling-3.0-flash-vl", + "name": "Ling 3.0 Flash VL", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.075, + "output": 0.22, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 32768 + }, + { + "id": "ling-3.1-flash", + "name": "Ling 3.1 Flash", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 0.9, + "cacheRead": 0.06, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "llama-3.1-70b-instruct", + "name": "Llama 3.1 70B Instruct", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.4, + "output": 0.4, + "cacheRead": 0.4, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 16384 + }, + { + "id": "longcat-2.0", + "name": "LongCat 2.0", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.006, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 262144 + }, + { + "id": "mercury-2", + "name": "Mercury 2", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_completion_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.25, + "output": 0.75, + "cacheRead": 0.025, + "cacheWrite": 0.25 + }, + "contextWindow": 128000, + "maxTokens": 50000 + }, + { + "id": "mercury-3", + "name": "Mercury 3", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_completion_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.2, + "output": 0.7, + "cacheRead": 0.02, + "cacheWrite": 0.2 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.5", + "name": "MiMo-V2.5", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.14, + "output": 0.28, + "cacheRead": 0.00255, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "mimo-v2.5-pro", + "name": "MiMo-V2.5-Pro", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.435, + "output": 0.87, + "cacheRead": 0.0028, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.6-flash", + "name": "MiMo-V2.6-Flash", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.14, + "output": 0.28, + "cacheRead": 0.0028, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.6-pro", + "name": "MiMo-V2.6-Pro", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.435, + "output": 0.87, + "cacheRead": 0.0036, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.6-pro-ultraspeed", + "name": "MiMo-V2.6-Pro-UltraSpeed", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 4.35, + "output": 8.7, + "cacheRead": 0.036, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "minimax-m1", + "name": "MiniMax M1", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.55, + "output": 2.2, + "cacheRead": 0.55, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 40000 + }, + { + "id": "minimax-m2.1", + "name": "MiniMax M2.1", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 196608, + "maxTokens": 131072 + }, + { + "id": "minimax-m2.5", + "name": "MiniMax M2.5", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.27, + "output": 1.08, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 196608, + "maxTokens": 131072 + }, + { + "id": "minimax-m3", + "name": "Minimax M3", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.06, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 4096 + }, + { + "id": "ministral-14b-2512", + "name": "Ministral 3 14B 2512", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.2, + "output": 0.2, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 4096 + }, + { + "id": "ministral-3-3b-instruct", + "name": "Ministral 3 3B Instruct", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.1, + "cacheRead": 0.1, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 8192 + }, + { + "id": "ministral-3-8b-instruct", + "name": "Ministral 3 8B Instruct", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.15, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 8192 + }, + { + "id": "mistral-large", + "name": "Mistral Large", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 102400 + }, + { + "id": "mistral-large-3", + "name": "Mistral Large 3", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.5, + "output": 1.5, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 4096 + }, + { + "id": "mistral-large-4", + "name": "Mistral Large 4", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.68, + "output": 2.09, + "cacheRead": 0.07, + "cacheWrite": 0 + }, + "contextWindow": 524288, + "maxTokens": 209715 + }, + { + "id": "mistral-medium-3", + "name": "Mistral Medium 3", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.4, + "output": 2, + "cacheRead": 0.04, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 104857 + }, + { + "id": "mistral-medium-3-5", + "name": "Mistral Medium 3.5", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.5, + "output": 7.5, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 4096 + }, + { + "id": "mistral-medium-3.1", + "name": "Mistral Medium 3.1", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.4, + "output": 2, + "cacheRead": 0.04, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 104857 + }, + { + "id": "mistral-nemo", + "name": "Mistral Nemo", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.029, + "output": 0.03, + "cacheRead": 0.029, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 16384 + }, + { + "id": "mistral-saba", + "name": "Mistral Saba", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.2, + "output": 0.6, + "cacheRead": 0.02, + "cacheWrite": 0 + }, + "contextWindow": 32768, + "maxTokens": 26214 + }, + { + "id": "mistral-small-2603", + "name": "Mistral Small 4", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 209715 + }, + { + "id": "mistral-small-3.1-24b-instruct", + "name": "Mistral Small 3.1 24B Instruct", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.351, + "output": 0.555, + "cacheRead": 0.351, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 102400 + }, + { + "id": "mistral-small-3.2-24b-instruct", + "name": "Mistral Small 3.2 24B Instruct", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.09375, + "output": 0.25, + "cacheRead": 0.09375, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 16384 + }, + { + "id": "mixtral-8x22b-instruct", + "name": "Mixtral 8x22B Instruct", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 65536, + "maxTokens": 52428 + }, + { + "id": "muse-spark-1.1", + "name": "Muse Spark 1.1", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "xhigh", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 4.25, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "muse-spark-1.2", + "name": "Muse Spark 1.2", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "xhigh", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 4.25, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "muse-spark-1.2-contributor", + "name": "Muse Spark 1.2 Contributor", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "xhigh", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.2, + "cacheRead": 0.002, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "muse-spark-1.3", + "name": "Muse Spark 1.3", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "xhigh", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 1.25, + "output": 4.25, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "muse-spark-1.3-contributor", + "name": "Muse Spark 1.3 Contributor", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "xhigh", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.1, + "output": 0.2, + "cacheRead": 0.002, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "muse-spark-open", + "name": "Muse Spark Open", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 4.25, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "muse-wonder-1.0", + "name": "Muse Wonder", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "nemotron-3-nano-30b-a3b", + "name": "Nemotron 3 Nano 30B A3B", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.06, + "output": 0.24, + "cacheRead": 0.06, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 235929 + }, + { + "id": "nemotron-3-super-120b-a12b", + "name": "Nemotron 3 Super", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.08, + "output": 0.45, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 16384 + }, + { + "id": "nemotron-3-ultra-550b-a55b", + "name": "Nemotron 3 Ultra", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.6, + "output": 2.4, + "cacheRead": 0.12, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 4096 + }, + { + "id": "nemotron-3.5-lightning", + "name": "Nemotron 3.5 Lightning", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.05, + "output": 0.2, + "cacheRead": 0.01, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 131072 + }, + { + "id": "nova-2-lite-v1", + "name": "Nova 2 Lite", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 2.5, + "cacheRead": 0.3, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 65535 + }, + { + "id": "nova-premier-v1", + "name": "Nova Premier 1.0", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 12.5, + "cacheRead": 0.625, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 32000 + }, + { + "id": "o3", + "name": "o3", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 2, + "output": 8, + "cacheRead": 0.5, + "cacheWrite": 2.5 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "o3-mini", + "name": "o3 Mini", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 1.1, + "output": 4.4, + "cacheRead": 0.55, + "cacheWrite": 1.375 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "o3-mini-high", + "name": "o3 Mini High", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 1.1, + "output": 4.4, + "cacheRead": 0.55, + "cacheWrite": 1.375 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "o4-mini", + "name": "o4 Mini", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 1.1, + "output": 4.4, + "cacheRead": 0.275, + "cacheWrite": 1.375 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "o4-mini-high", + "name": "o4 Mini High", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.1, + "output": 4.4, + "cacheRead": 0.275, + "cacheWrite": 1.375 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "qwen-plus", + "name": "Qwen Plus", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.26, + "output": 0.78, + "cacheRead": 0.052, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 32768 + }, + { + "id": "qwen3-30b-a3b", + "name": "Qwen3 30B A3B", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.095, + "output": 0.285, + "cacheRead": 0.0475, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 4096 + }, + { + "id": "qwen3-8b", + "name": "Qwen3 8B", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.4465, + "output": 0.4465, + "cacheRead": 0.22325, + "cacheWrite": 0 + }, + "contextWindow": 40960, + "maxTokens": 4096 + }, + { + "id": "qwen3-coder-flash", + "name": "Qwen3 Coder Flash", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.195, + "output": 0.975, + "cacheRead": 0.039, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 65536 + }, + { + "id": "qwen3-omni-30b-a3b-thinking", + "name": "Qwen3 Omni 30B A3B Thinking", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.25, + "output": 0.97, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 65536, + "maxTokens": 16384 + }, + { + "id": "qwen3.5-122b-a10b", + "name": "Qwen3.5 122b A10b", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.29, + "output": 2.4, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "qwen3.5-27b", + "name": "Qwen3.5 27b", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.195, + "output": 1.56, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "qwen3.5-35b-a3b", + "name": "Qwen3.5 35b A3b", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_completion_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.25, + "output": 1.25, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "qwen3.5-397b-a17b", + "name": "Qwen3.5 397b A17b", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_completion_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.39, + "output": 2.34, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 235929 + }, + { + "id": "qwen3.5-9b", + "name": "Qwen3.5 9B", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.04, + "output": 0.065, + "cacheRead": 0.02, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "qwen3.5-flash-02-23", + "name": "Qwen3.5 Flash 02-23", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.065, + "output": 0.26, + "cacheRead": 0.065, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 65536 + }, + { + "id": "qwen3.5-plus-02-15", + "name": "Qwen3.5 Plus 2026-02-15", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.26, + "output": 1.56, + "cacheRead": 0.26, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 65536 + }, + { + "id": "qwen3.5-plus-20260420", + "name": "Qwen3.5 Plus 2026-04-20", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 1.8, + "cacheRead": 0.3, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 65536 + }, + { + "id": "qwen3.6-27b", + "name": "Qwen3.6 27B", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.6, + "output": 3.6, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "qwen3.6-35b-a3b", + "name": "Qwen3.6 35b A3b", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_completion_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.1, + "output": 0.9, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "qwen3.6-flash", + "name": "Qwen3.6 Flash", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 1.5, + "cacheRead": 0.025, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 65536 + }, + { + "id": "qwen3.6-plus", + "name": "Qwen3.6 Plus", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.325, + "output": 1.95, + "cacheRead": 0.325, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 65536 + }, + { + "id": "qwen3.7-flash", + "name": "Qwen3.7 Flash", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.03, + "output": 0.13, + "cacheRead": 0.006, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 65536 + }, + { + "id": "qwen3.7-max", + "name": "Qwen3.7 Max", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_completion_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 2.5, + "output": 7.5, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "qwen3.7-plus", + "name": "Qwen3.7 Plus", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.4, + "output": 1.6, + "cacheRead": 0.08, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "qwen3.8-2.4t-a95b", + "name": "Qwen3.8 2.4T A95B", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "qwen3.8-27b", + "name": "Qwen3.8 27B", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_completion_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.99, + "output": 1.49, + "cacheRead": 0.99, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "qwen3.8-flash", + "name": "Qwen3.8 Flash", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_completion_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.47, + "cacheRead": 0.016, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "qwen3.8-max", + "name": "Qwen3.8 Max", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_completion_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "qwen3.8-max-0902", + "name": "Qwen3.8 Max (0902)", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "reka-edge", + "name": "Reka Edge", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.1, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 16384, + "maxTokens": 4096 + }, + { + "id": "relace-search", + "name": "Relace Search", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 1, + "output": 3, + "cacheRead": 1, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 128000 + }, + { + "id": "seed-1.6", + "name": "Seed 1.6", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 2, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "seed-1.6-flash", + "name": "Seed 1.6 Flash", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.075, + "output": 0.3, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "seed-2-1-turbo", + "name": "Seed 2.1 Turbo", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.5, + "output": 2.5, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 235929 + }, + { + "id": "seed-2.0-code", + "name": "Seed-2.0-Code", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.5, + "output": 3, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 131072 + }, + { + "id": "seed-2.0-lite", + "name": "Seed 2.0 Lite", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 2, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 131072 + }, + { + "id": "seed-2.0-mini", + "name": "Seed 2.0 Mini", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.4, + "cacheRead": 0.1, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 131072 + }, + { + "id": "solar-pro-3", + "name": "Solar Pro 3", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 117964 + }, + { + "id": "solar-pro4", + "name": "Solar Pro 4", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 524288, + "maxTokens": 131072 + }, + { + "id": "step-3.5-flash", + "name": "Step 3.5 Flash", + "api": "openai-completions", + "provider": "experientiallabs", + "baseUrl": "https://api.experientiallabs.ai/v1", + "compat": { + "maxTokensField": "max_tokens", + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.1, + "output": 0.3, + "cacheRead": 0.1, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "accounts/fireworks/models/deepseek-v4p1-flash", + "name": "DeepSeek V4.1 Flash", + "api": "anthropic-messages", + "provider": "fireworks", + "baseUrl": "https://api.fireworks.ai/inference", + "compat": { + "sendSessionAffinityHeaders": true, + "supportsEagerToolInputStreaming": false, + "supportsCacheControlOnTools": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.006, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 384000 + }, + { + "id": "accounts/fireworks/models/deepseek-v4p1-flash-1017", + "name": "DeepSeek V4.1 Flash 1017", + "api": "anthropic-messages", + "provider": "fireworks", + "baseUrl": "https://api.fireworks.ai/inference", + "compat": { + "sendSessionAffinityHeaders": true, + "supportsEagerToolInputStreaming": false, + "supportsCacheControlOnTools": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.006, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 384000 + }, + { + "id": "accounts/fireworks/models/ember-1", + "name": "Ember-1", + "api": "anthropic-messages", + "provider": "fireworks", + "baseUrl": "https://api.fireworks.ai/inference", + "compat": { + "sendSessionAffinityHeaders": true, + "supportsEagerToolInputStreaming": false, + "supportsCacheControlOnTools": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "accounts/fireworks/models/glm-5p3", + "name": "GLM 5.3", + "api": "anthropic-messages", + "provider": "fireworks", + "baseUrl": "https://api.fireworks.ai/inference", + "compat": { + "sendSessionAffinityHeaders": true, + "supportsEagerToolInputStreaming": false, + "supportsCacheControlOnTools": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 1.4, + "output": 4.4, + "cacheRead": 0.26, + "cacheWrite": 0 + }, + "contextWindow": 1048573, + "maxTokens": 262144 + }, + { + "id": "accounts/fireworks/models/glm-5p3-flash", + "name": "GLM 5.3 Flash", + "api": "anthropic-messages", + "provider": "fireworks", + "baseUrl": "https://api.fireworks.ai/inference", + "compat": { + "sendSessionAffinityHeaders": true, + "supportsEagerToolInputStreaming": false, + "supportsCacheControlOnTools": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.5, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 1048573, + "maxTokens": 131072 + }, + { + "id": "accounts/fireworks/models/gpt-oss-120b", + "name": "GPT OSS 120B", + "api": "anthropic-messages", + "provider": "fireworks", + "baseUrl": "https://api.fireworks.ai/inference", + "compat": { + "sendSessionAffinityHeaders": true, + "supportsEagerToolInputStreaming": false, + "supportsCacheControlOnTools": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 32768 + }, + { + "id": "accounts/fireworks/models/inkling", + "name": "Inkling", + "api": "anthropic-messages", + "provider": "fireworks", + "baseUrl": "https://api.fireworks.ai/inference", + "compat": { + "sendSessionAffinityHeaders": true, + "supportsEagerToolInputStreaming": false, + "supportsCacheControlOnTools": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 4.05, + "cacheRead": 0.17, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "accounts/fireworks/models/kimi-k3", + "name": "Kimi K3", + "api": "anthropic-messages", + "provider": "fireworks", + "baseUrl": "https://api.fireworks.ai/inference", + "compat": { + "sendSessionAffinityHeaders": true, + "supportsEagerToolInputStreaming": false, + "supportsCacheControlOnTools": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "accounts/fireworks/models/minimax-m3", + "name": "MiniMax-M3", + "api": "anthropic-messages", + "provider": "fireworks", + "baseUrl": "https://api.fireworks.ai/inference", + "compat": { + "sendSessionAffinityHeaders": true, + "supportsEagerToolInputStreaming": false, + "supportsCacheControlOnTools": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.06, + "cacheWrite": 0 + }, + "contextWindow": 512000, + "maxTokens": 512000 + }, + { + "id": "accounts/fireworks/models/minimax-m3p1-flash", + "name": "MiniMax-M3.1-Flash", + "api": "anthropic-messages", + "provider": "fireworks", + "baseUrl": "https://api.fireworks.ai/inference", + "compat": { + "sendSessionAffinityHeaders": true, + "supportsEagerToolInputStreaming": false, + "supportsCacheControlOnTools": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 512000 + }, + { + "id": "accounts/fireworks/models/muse-spark-open", + "name": "Muse Spark Open", + "api": "anthropic-messages", + "provider": "fireworks", + "baseUrl": "https://api.fireworks.ai/inference", + "compat": { + "sendSessionAffinityHeaders": true, + "supportsEagerToolInputStreaming": false, + "supportsCacheControlOnTools": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 4.25, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "accounts/fireworks/models/nemotron-3-ultra-nvfp4", + "name": "Nemotron 3 Ultra 550B A55B", + "api": "anthropic-messages", + "provider": "fireworks", + "baseUrl": "https://api.fireworks.ai/inference", + "compat": { + "sendSessionAffinityHeaders": true, + "supportsEagerToolInputStreaming": false, + "supportsCacheControlOnTools": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.6, + "output": 2.4, + "cacheRead": 0.12, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 128000 + }, + { + "id": "accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b", + "name": "Nemotron 3.5 Lightning 30B A3B", + "api": "anthropic-messages", + "provider": "fireworks", + "baseUrl": "https://api.fireworks.ai/inference", + "compat": { + "sendSessionAffinityHeaders": true, + "supportsEagerToolInputStreaming": false, + "supportsCacheControlOnTools": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.05, + "output": 0.2, + "cacheRead": 0.01, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "accounts/fireworks/models/qwen3p8-2p4t-a95b", + "name": "Qwen3.8 2.4T A95B", + "api": "anthropic-messages", + "provider": "fireworks", + "baseUrl": "https://api.fireworks.ai/inference", + "compat": { + "sendSessionAffinityHeaders": true, + "supportsEagerToolInputStreaming": false, + "supportsCacheControlOnTools": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 131072 + }, + { + "id": "accounts/fireworks/models/qwen3p8-max", + "name": "Qwen3.8 Max", + "api": "anthropic-messages", + "provider": "fireworks", + "baseUrl": "https://api.fireworks.ai/inference", + "compat": { + "sendSessionAffinityHeaders": true, + "supportsEagerToolInputStreaming": false, + "supportsCacheControlOnTools": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 131072 + }, + { + "id": "accounts/fireworks/routers/deepseek-flash-latest", + "name": "DeepSeek Flash Latest", + "api": "anthropic-messages", + "provider": "fireworks", + "baseUrl": "https://api.fireworks.ai/inference", + "compat": { + "sendSessionAffinityHeaders": true, + "supportsEagerToolInputStreaming": false, + "supportsCacheControlOnTools": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.006, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 384000 + }, + { + "id": "accounts/fireworks/routers/deepseek-v4p1-flash-1017-spot", + "name": "DeepSeek V4.1 Flash 1017 Spot", + "api": "anthropic-messages", + "provider": "fireworks", + "baseUrl": "https://api.fireworks.ai/inference", + "compat": { + "sendSessionAffinityHeaders": true, + "supportsEagerToolInputStreaming": false, + "supportsCacheControlOnTools": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.21, + "output": 0.84, + "cacheRead": 0.0042, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 384000 + }, + { + "id": "accounts/fireworks/routers/deepseek-v4p1-flash-spot", + "name": "DeepSeek V4.1 Flash Spot", + "api": "anthropic-messages", + "provider": "fireworks", + "baseUrl": "https://api.fireworks.ai/inference", + "compat": { + "sendSessionAffinityHeaders": true, + "supportsEagerToolInputStreaming": false, + "supportsCacheControlOnTools": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.21, + "output": 0.84, + "cacheRead": 0.0042, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 384000 + }, + { + "id": "accounts/fireworks/routers/glm-5p3-fast", + "name": "GLM 5.3 Fast", + "api": "anthropic-messages", + "provider": "fireworks", + "baseUrl": "https://api.fireworks.ai/inference", + "compat": { + "sendSessionAffinityHeaders": true, + "supportsEagerToolInputStreaming": false, + "supportsCacheControlOnTools": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 2.1, + "output": 6.6, + "cacheRead": 0.39, + "cacheWrite": 0 + }, + "contextWindow": 1048572, + "maxTokens": 262144 + }, + { + "id": "accounts/fireworks/routers/glm-5p3-spot", + "name": "GLM 5.3 Spot", + "api": "anthropic-messages", + "provider": "fireworks", + "baseUrl": "https://api.fireworks.ai/inference", + "compat": { + "sendSessionAffinityHeaders": true, + "supportsEagerToolInputStreaming": false, + "supportsCacheControlOnTools": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 0.98, + "output": 3.08, + "cacheRead": 0.182, + "cacheWrite": 0 + }, + "contextWindow": 1048573, + "maxTokens": 262144 + }, + { + "id": "accounts/fireworks/routers/glm-fast-latest", + "name": "GLM 5.3 Fast (Latest)", + "api": "anthropic-messages", + "provider": "fireworks", + "baseUrl": "https://api.fireworks.ai/inference", + "compat": { + "sendSessionAffinityHeaders": true, + "supportsEagerToolInputStreaming": false, + "supportsCacheControlOnTools": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 2.1, + "output": 6.6, + "cacheRead": 0.39, + "cacheWrite": 0 + }, + "contextWindow": 1048572, + "maxTokens": 262144 + }, + { + "id": "accounts/fireworks/routers/glm-flash-latest", + "name": "GLM Flash Latest (GLM 5.3 Flash)", + "api": "anthropic-messages", + "provider": "fireworks", + "baseUrl": "https://api.fireworks.ai/inference", + "compat": { + "sendSessionAffinityHeaders": true, + "supportsEagerToolInputStreaming": false, + "supportsCacheControlOnTools": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.5, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 1048573, + "maxTokens": 131072 + }, + { + "id": "accounts/fireworks/routers/glm-latest", + "name": "GLM Latest", + "api": "anthropic-messages", + "provider": "fireworks", + "baseUrl": "https://api.fireworks.ai/inference", + "compat": { + "sendSessionAffinityHeaders": true, + "supportsEagerToolInputStreaming": false, + "supportsCacheControlOnTools": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 1.4, + "output": 4.4, + "cacheRead": 0.26, + "cacheWrite": 0 + }, + "contextWindow": 1048573, + "maxTokens": 262144 + }, + { + "id": "accounts/fireworks/routers/kimi-fast-latest", + "name": "Kimi Fast Latest", + "api": "anthropic-messages", + "provider": "fireworks", + "baseUrl": "https://api.fireworks.ai/inference", + "compat": { + "sendSessionAffinityHeaders": true, + "supportsEagerToolInputStreaming": false, + "supportsCacheControlOnTools": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4.5, + "output": 22.5, + "cacheRead": 0.45, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "accounts/fireworks/routers/kimi-k3-fast", + "name": "Kimi K3 Fast", + "api": "anthropic-messages", + "provider": "fireworks", + "baseUrl": "https://api.fireworks.ai/inference", + "compat": { + "sendSessionAffinityHeaders": true, + "supportsEagerToolInputStreaming": false, + "supportsCacheControlOnTools": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4.5, + "output": 22.5, + "cacheRead": 0.45, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "accounts/fireworks/routers/kimi-k3-spot", + "name": "Kimi K3 Spot", + "api": "anthropic-messages", + "provider": "fireworks", + "baseUrl": "https://api.fireworks.ai/inference", + "compat": { + "sendSessionAffinityHeaders": true, + "supportsEagerToolInputStreaming": false, + "supportsCacheControlOnTools": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.1, + "output": 10.5, + "cacheRead": 0.21, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "accounts/fireworks/routers/kimi-latest", + "name": "Kimi Latest", + "api": "anthropic-messages", + "provider": "fireworks", + "baseUrl": "https://api.fireworks.ai/inference", + "compat": { + "sendSessionAffinityHeaders": true, + "supportsEagerToolInputStreaming": false, + "supportsCacheControlOnTools": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "accounts/fireworks/routers/minimax-latest", + "name": "MiniMax Latest", + "api": "anthropic-messages", + "provider": "fireworks", + "baseUrl": "https://api.fireworks.ai/inference", + "compat": { + "sendSessionAffinityHeaders": true, + "supportsEagerToolInputStreaming": false, + "supportsCacheControlOnTools": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.06, + "cacheWrite": 0 + }, + "contextWindow": 512000, + "maxTokens": 512000 + }, + { + "id": "accounts/fireworks/routers/qwen-max-latest", + "name": "Qwen Max Latest (Qwen3.8 Max)", + "api": "anthropic-messages", + "provider": "fireworks", + "baseUrl": "https://api.fireworks.ai/inference", + "compat": { + "sendSessionAffinityHeaders": true, + "supportsEagerToolInputStreaming": false, + "supportsCacheControlOnTools": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 131072 + }, + { + "id": "claude-fable-5", + "name": "Claude Fable 5", + "api": "openai-completions", + "provider": "github-copilot", + "baseUrl": "https://api.individual.githubcopilot.com", + "headers": { + "User-Agent": "GitHubCopilotChat/0.35.0", + "Editor-Version": "vscode/1.107.0", + "Editor-Plugin-Version": "copilot-chat/0.35.0", + "Copilot-Integration-Id": "vscode-chat" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5.1", + "name": "Claude Fable 5.1", + "api": "openai-completions", + "provider": "github-copilot", + "baseUrl": "https://api.individual.githubcopilot.com", + "headers": { + "User-Agent": "GitHubCopilotChat/0.35.0", + "Editor-Version": "vscode/1.107.0", + "Editor-Plugin-Version": "copilot-chat/0.35.0", + "Copilot-Integration-Id": "vscode-chat" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 0.25, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-haiku-4.5", + "name": "Claude Haiku 4.5 (latest)", + "api": "anthropic-messages", + "provider": "github-copilot", + "baseUrl": "https://api.individual.githubcopilot.com", + "headers": { + "User-Agent": "GitHubCopilotChat/0.35.0", + "Editor-Version": "vscode/1.107.0", + "Editor-Plugin-Version": "copilot-chat/0.35.0", + "Copilot-Integration-Id": "vscode-chat" + }, + "compat": { + "supportsEagerToolInputStreaming": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-haiku-5.5", + "name": "Claude Haiku 5.5", + "api": "openai-completions", + "provider": "github-copilot", + "baseUrl": "https://api.individual.githubcopilot.com", + "headers": { + "User-Agent": "GitHubCopilotChat/0.35.0", + "Editor-Version": "vscode/1.107.0", + "Editor-Plugin-Version": "copilot-chat/0.35.0", + "Copilot-Integration-Id": "vscode-chat" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.5, + "cacheRead": 0.01, + "cacheWrite": 0.125 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4.8", + "name": "Claude Opus 4.8", + "api": "anthropic-messages", + "provider": "github-copilot", + "baseUrl": "https://api.individual.githubcopilot.com", + "headers": { + "User-Agent": "GitHubCopilotChat/0.35.0", + "Editor-Version": "vscode/1.107.0", + "Editor-Plugin-Version": "copilot-chat/0.35.0", + "Copilot-Integration-Id": "vscode-chat" + }, + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-5", + "name": "Claude Opus 5", + "api": "openai-completions", + "provider": "github-copilot", + "baseUrl": "https://api.individual.githubcopilot.com", + "headers": { + "User-Agent": "GitHubCopilotChat/0.35.0", + "Editor-Version": "vscode/1.107.0", + "Editor-Plugin-Version": "copilot-chat/0.35.0", + "Copilot-Integration-Id": "vscode-chat" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-5.5", + "name": "Claude Opus 5.5", + "api": "openai-completions", + "provider": "github-copilot", + "baseUrl": "https://api.individual.githubcopilot.com", + "headers": { + "User-Agent": "GitHubCopilotChat/0.35.0", + "Editor-Version": "vscode/1.107.0", + "Editor-Plugin-Version": "copilot-chat/0.35.0", + "Copilot-Integration-Id": "vscode-chat" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.2, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-4.6", + "name": "Claude Sonnet 4.6", + "api": "anthropic-messages", + "provider": "github-copilot", + "baseUrl": "https://api.individual.githubcopilot.com", + "headers": { + "User-Agent": "GitHubCopilotChat/0.35.0", + "Editor-Version": "vscode/1.107.0", + "Editor-Plugin-Version": "copilot-chat/0.35.0", + "Copilot-Integration-Id": "vscode-chat" + }, + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 1000000, + "maxTokens": 32000 + }, + { + "id": "claude-sonnet-5", + "name": "Claude Sonnet 5", + "api": "openai-completions", + "provider": "github-copilot", + "baseUrl": "https://api.individual.githubcopilot.com", + "headers": { + "User-Agent": "GitHubCopilotChat/0.35.0", + "Editor-Version": "vscode/1.107.0", + "Editor-Plugin-Version": "copilot-chat/0.35.0", + "Copilot-Integration-Id": "vscode-chat" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5.5", + "name": "Claude Sonnet 5.5", + "api": "openai-completions", + "provider": "github-copilot", + "baseUrl": "https://api.individual.githubcopilot.com", + "headers": { + "User-Agent": "GitHubCopilotChat/0.35.0", + "Editor-Version": "vscode/1.107.0", + "Editor-Plugin-Version": "copilot-chat/0.35.0", + "Copilot-Integration-Id": "vscode-chat" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.1, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gemini-3.8-flash", + "name": "Gemini 3.8 Flash", + "api": "openai-completions", + "provider": "github-copilot", + "baseUrl": "https://api.individual.githubcopilot.com", + "headers": { + "User-Agent": "GitHubCopilotChat/0.35.0", + "Editor-Version": "vscode/1.107.0", + "Editor-Plugin-Version": "copilot-chat/0.35.0", + "Copilot-Integration-Id": "vscode-chat" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 3.75, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gemini-4-argon", + "name": "Gemini 4 Argon", + "api": "openai-completions", + "provider": "github-copilot", + "baseUrl": "https://api.individual.githubcopilot.com", + "headers": { + "User-Agent": "GitHubCopilotChat/0.35.0", + "Editor-Version": "vscode/1.107.0", + "Editor-Plugin-Version": "copilot-chat/0.35.0", + "Copilot-Integration-Id": "vscode-chat" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.1, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gpt-5.3-codex", + "name": "GPT-5.3 Codex", + "api": "openai-responses", + "provider": "github-copilot", + "baseUrl": "https://api.individual.githubcopilot.com", + "headers": { + "User-Agent": "GitHubCopilotChat/0.35.0", + "Editor-Version": "vscode/1.107.0", + "Editor-Plugin-Version": "copilot-chat/0.35.0", + "Copilot-Integration-Id": "vscode-chat" + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "low", + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.75, + "output": 14, + "cacheRead": 0.175, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.4-nano", + "name": "GPT-5.4 nano", + "api": "openai-responses", + "provider": "github-copilot", + "baseUrl": "https://api.individual.githubcopilot.com", + "headers": { + "User-Agent": "GitHubCopilotChat/0.35.0", + "Editor-Version": "vscode/1.107.0", + "Editor-Plugin-Version": "copilot-chat/0.35.0", + "Copilot-Integration-Id": "vscode-chat" + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "low", + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.2, + "output": 1.25, + "cacheRead": 0.02, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.6-luna", + "name": "GPT-5.6 Luna", + "api": "openai-responses", + "provider": "github-copilot", + "baseUrl": "https://api.individual.githubcopilot.com", + "headers": { + "User-Agent": "GitHubCopilotChat/0.35.0", + "Editor-Version": "vscode/1.107.0", + "Editor-Plugin-Version": "copilot-chat/0.35.0", + "Copilot-Integration-Id": "vscode-chat" + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "low", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.2, + "output": 1.2, + "cacheRead": 0.02, + "cacheWrite": 0.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.6-sol", + "name": "GPT-5.6 Sol", + "api": "openai-responses", + "provider": "github-copilot", + "baseUrl": "https://api.individual.githubcopilot.com", + "headers": { + "User-Agent": "GitHubCopilotChat/0.35.0", + "Editor-Version": "vscode/1.107.0", + "Editor-Plugin-Version": "copilot-chat/0.35.0", + "Copilot-Integration-Id": "vscode-chat" + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "low", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.4, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.6-terra", + "name": "GPT-5.6 Terra", + "api": "openai-responses", + "provider": "github-copilot", + "baseUrl": "https://api.individual.githubcopilot.com", + "headers": { + "User-Agent": "GitHubCopilotChat/0.35.0", + "Editor-Version": "vscode/1.107.0", + "Editor-Plugin-Version": "copilot-chat/0.35.0", + "Copilot-Integration-Id": "vscode-chat" + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "low", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 12, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-astra", + "name": "GPT-6 Astra", + "api": "openai-responses", + "provider": "github-copilot", + "baseUrl": "https://api.individual.githubcopilot.com", + "headers": { + "User-Agent": "GitHubCopilotChat/0.35.0", + "Editor-Version": "vscode/1.107.0", + "Editor-Plugin-Version": "copilot-chat/0.35.0", + "Copilot-Integration-Id": "vscode-chat" + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-luna", + "name": "GPT-6 Luna", + "api": "openai-responses", + "provider": "github-copilot", + "baseUrl": "https://api.individual.githubcopilot.com", + "headers": { + "User-Agent": "GitHubCopilotChat/0.35.0", + "Editor-Version": "vscode/1.107.0", + "Editor-Plugin-Version": "copilot-chat/0.35.0", + "Copilot-Integration-Id": "vscode-chat" + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.5, + "cacheRead": 0.01, + "cacheWrite": 0.125 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-sol", + "name": "GPT-6 Sol", + "api": "openai-responses", + "provider": "github-copilot", + "baseUrl": "https://api.individual.githubcopilot.com", + "headers": { + "User-Agent": "GitHubCopilotChat/0.35.0", + "Editor-Version": "vscode/1.107.0", + "Editor-Plugin-Version": "copilot-chat/0.35.0", + "Copilot-Integration-Id": "vscode-chat" + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-6.1-sol", + "name": "GPT-6.1 Sol", + "api": "openai-responses", + "provider": "github-copilot", + "baseUrl": "https://api.individual.githubcopilot.com", + "headers": { + "User-Agent": "GitHubCopilotChat/0.35.0", + "Editor-Version": "vscode/1.107.0", + "Editor-Plugin-Version": "copilot-chat/0.35.0", + "Copilot-Integration-Id": "vscode-chat" + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.1, + "cacheWrite": 2.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-6.1-terra", + "name": "GPT-6.1 Terra", + "api": "openai-responses", + "provider": "github-copilot", + "baseUrl": "https://api.individual.githubcopilot.com", + "headers": { + "User-Agent": "GitHubCopilotChat/0.35.0", + "Editor-Version": "vscode/1.107.0", + "Editor-Plugin-Version": "copilot-chat/0.35.0", + "Copilot-Integration-Id": "vscode-chat" + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.05, + "cacheWrite": 1.25 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "grok-4.5", + "name": "Grok 4.5", + "api": "openai-completions", + "provider": "github-copilot", + "baseUrl": "https://api.individual.githubcopilot.com", + "headers": { + "User-Agent": "GitHubCopilotChat/0.35.0", + "Editor-Version": "vscode/1.107.0", + "Editor-Plugin-Version": "copilot-chat/0.35.0", + "Copilot-Integration-Id": "vscode-chat" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 128000 + }, + { + "id": "grok-4.6", + "name": "Grok 4.6", + "api": "openai-completions", + "provider": "github-copilot", + "baseUrl": "https://api.individual.githubcopilot.com", + "headers": { + "User-Agent": "GitHubCopilotChat/0.35.0", + "Editor-Version": "vscode/1.107.0", + "Editor-Plugin-Version": "copilot-chat/0.35.0", + "Copilot-Integration-Id": "vscode-chat" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 128000 + }, + { + "id": "grok-4.7", + "name": "Grok 4.7", + "api": "openai-completions", + "provider": "github-copilot", + "baseUrl": "https://api.individual.githubcopilot.com", + "headers": { + "User-Agent": "GitHubCopilotChat/0.35.0", + "Editor-Version": "vscode/1.107.0", + "Editor-Plugin-Version": "copilot-chat/0.35.0", + "Copilot-Integration-Id": "vscode-chat" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 128000 + }, + { + "id": "kimi-k3", + "name": "Kimi K3", + "api": "openai-completions", + "provider": "github-copilot", + "baseUrl": "https://api.individual.githubcopilot.com", + "headers": { + "User-Agent": "GitHubCopilotChat/0.35.0", + "Editor-Version": "vscode/1.107.0", + "Editor-Plugin-Version": "copilot-chat/0.35.0", + "Copilot-Integration-Id": "vscode-chat" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "mai-code-1.1-flash", + "name": "MAI-Code-1.1-Flash", + "api": "openai-completions", + "provider": "github-copilot", + "baseUrl": "https://api.individual.githubcopilot.com", + "headers": { + "User-Agent": "GitHubCopilotChat/0.35.0", + "Editor-Version": "vscode/1.107.0", + "Editor-Plugin-Version": "copilot-chat/0.35.0", + "Copilot-Integration-Id": "vscode-chat" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.2, + "output": 1.2, + "cacheRead": 0.02, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 128000 + }, + { + "id": "deep-research-max-preview-04-2026", + "name": "Deep Research Max Preview (Apr-21-2026)", + "api": "google-generative-ai", + "provider": "google", + "baseUrl": "https://generativelanguage.googleapis.com/v1beta", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 12, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 65536 + }, + { + "id": "deep-research-preview-04-2026", + "name": "Deep Research Preview (Apr-21-2026)", + "api": "google-generative-ai", + "provider": "google", + "baseUrl": "https://generativelanguage.googleapis.com/v1beta", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 12, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 65536 + }, + { + "id": "gemini-2.5-computer-use-preview-10-2025", + "name": "Gemini 2.5 Computer Use Preview 10-2025", + "api": "google-generative-ai", + "provider": "google", + "baseUrl": "https://generativelanguage.googleapis.com/v1beta", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 64000 + }, + { + "id": "gemini-2.5-flash", + "name": "Gemini 2.5 Flash", + "api": "google-generative-ai", + "provider": "google", + "baseUrl": "https://generativelanguage.googleapis.com/v1beta", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 2.5, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-2.5-flash-lite", + "name": "Gemini 2.5 Flash-Lite", + "api": "google-generative-ai", + "provider": "google", + "baseUrl": "https://generativelanguage.googleapis.com/v1beta", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.4, + "cacheRead": 0.01, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-2.5-pro", + "name": "Gemini 2.5 Pro", + "api": "google-generative-ai", + "provider": "google", + "baseUrl": "https://generativelanguage.googleapis.com/v1beta", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.125, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3-flash-preview", + "name": "Gemini 3 Flash Preview", + "api": "google-generative-ai", + "provider": "google", + "baseUrl": "https://generativelanguage.googleapis.com/v1beta", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.5, + "output": 3, + "cacheRead": 0.05, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3.1-flash-lite", + "name": "Gemini 3.1 Flash Lite", + "api": "google-generative-ai", + "provider": "google", + "baseUrl": "https://generativelanguage.googleapis.com/v1beta", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 1.5, + "cacheRead": 0.025, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3.1-flash-lite-image", + "name": "Nano Banana 2 Lite", + "api": "google-generative-ai", + "provider": "google", + "baseUrl": "https://generativelanguage.googleapis.com/v1beta", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 30, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 65536, + "maxTokens": 4096 + }, + { + "id": "gemini-3.1-flash-lite-preview", + "name": "Gemini 3.1 Flash Lite Preview", + "api": "google-generative-ai", + "provider": "google", + "baseUrl": "https://generativelanguage.googleapis.com/v1beta", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 1.5, + "cacheRead": 0.025, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3.1-flash-live-preview", + "name": "Gemini 3.1 Flash Live Preview", + "api": "google-generative-ai", + "provider": "google", + "baseUrl": "https://generativelanguage.googleapis.com/v1beta", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 4.5, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 65536 + }, + { + "id": "gemini-3.1-pro-preview", + "name": "Gemini 3.1 Pro Preview", + "api": "google-generative-ai", + "provider": "google", + "baseUrl": "https://generativelanguage.googleapis.com/v1beta", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "LOW", + "medium": null, + "high": "HIGH" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 12, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3.1-pro-preview-customtools", + "name": "Gemini 3.1 Pro Preview Custom Tools", + "api": "google-generative-ai", + "provider": "google", + "baseUrl": "https://generativelanguage.googleapis.com/v1beta", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "LOW", + "medium": null, + "high": "HIGH" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 12, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3.5-flash", + "name": "Gemini 3.5 Flash", + "api": "google-generative-ai", + "provider": "google", + "baseUrl": "https://generativelanguage.googleapis.com/v1beta", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.5, + "output": 9, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3.5-flash-lite", + "name": "Gemini 3.5 Flash Lite", + "api": "google-generative-ai", + "provider": "google", + "baseUrl": "https://generativelanguage.googleapis.com/v1beta", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 2.5, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3.6-flash", + "name": "Gemini 3.6 Flash", + "api": "google-generative-ai", + "provider": "google", + "baseUrl": "https://generativelanguage.googleapis.com/v1beta", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 3.75, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3.7-flash", + "name": "Gemini 3.7 Flash", + "api": "google-generative-ai", + "provider": "google", + "baseUrl": "https://generativelanguage.googleapis.com/v1beta", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "LOW", + "medium": "MEDIUM", + "high": "HIGH" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 3.75, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3.8-flash", + "name": "Gemini 3.8 Flash", + "api": "google-generative-ai", + "provider": "google", + "baseUrl": "https://generativelanguage.googleapis.com/v1beta", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "LOW", + "medium": "MEDIUM", + "high": "HIGH" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 3.75, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-4-argon", + "name": "Gemini 4 Argon", + "api": "google-generative-ai", + "provider": "google", + "baseUrl": "https://generativelanguage.googleapis.com/v1beta", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "LOW", + "medium": "MEDIUM", + "high": "HIGH" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.1, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 32768 + }, + { + "id": "gemini-flash-latest", + "name": "Gemini Flash Latest", + "api": "google-generative-ai", + "provider": "google", + "baseUrl": "https://generativelanguage.googleapis.com/v1beta", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 3.75, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-flash-lite-latest", + "name": "Gemini Flash-Lite Latest", + "api": "google-generative-ai", + "provider": "google", + "baseUrl": "https://generativelanguage.googleapis.com/v1beta", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 2.5, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-pro-latest", + "name": "Gemini Pro Latest", + "api": "google-generative-ai", + "provider": "google", + "baseUrl": "https://generativelanguage.googleapis.com/v1beta", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 12, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemma-4-26b-a4b-it", + "name": "Gemma 4 26B A4B IT", + "api": "google-generative-ai", + "provider": "google", + "baseUrl": "https://generativelanguage.googleapis.com/v1beta", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "MINIMAL", + "low": null, + "medium": null, + "high": "HIGH" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "gemma-4-31b-it", + "name": "Gemma 4 31B IT", + "api": "google-generative-ai", + "provider": "google", + "baseUrl": "https://generativelanguage.googleapis.com/v1beta", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "MINIMAL", + "low": null, + "medium": null, + "high": "HIGH" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "gemini-1.5-flash", + "name": "Gemini 1.5 Flash (Vertex)", + "api": "google-vertex", + "provider": "google-vertex", + "baseUrl": "https://{location}-aiplatform.googleapis.com", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.075, + "output": 0.3, + "cacheRead": 0.01875, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 8192 + }, + { + "id": "gemini-1.5-flash-8b", + "name": "Gemini 1.5 Flash-8B (Vertex)", + "api": "google-vertex", + "provider": "google-vertex", + "baseUrl": "https://{location}-aiplatform.googleapis.com", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.0375, + "output": 0.15, + "cacheRead": 0.01, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 8192 + }, + { + "id": "gemini-1.5-pro", + "name": "Gemini 1.5 Pro (Vertex)", + "api": "google-vertex", + "provider": "google-vertex", + "baseUrl": "https://{location}-aiplatform.googleapis.com", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 5, + "cacheRead": 0.3125, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 8192 + }, + { + "id": "gemini-2.0-flash", + "name": "Gemini 2.0 Flash (Vertex)", + "api": "google-vertex", + "provider": "google-vertex", + "baseUrl": "https://{location}-aiplatform.googleapis.com", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0.0375, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 8192 + }, + { + "id": "gemini-2.0-flash-lite", + "name": "Gemini 2.0 Flash Lite (Vertex)", + "api": "google-vertex", + "provider": "google-vertex", + "baseUrl": "https://{location}-aiplatform.googleapis.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.075, + "output": 0.3, + "cacheRead": 0.01875, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-2.5-flash", + "name": "Gemini 2.5 Flash (Vertex)", + "api": "google-vertex", + "provider": "google-vertex", + "baseUrl": "https://{location}-aiplatform.googleapis.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 2.5, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-2.5-flash-lite", + "name": "Gemini 2.5 Flash Lite (Vertex)", + "api": "google-vertex", + "provider": "google-vertex", + "baseUrl": "https://{location}-aiplatform.googleapis.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.4, + "cacheRead": 0.01, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-2.5-flash-lite-preview-09-2025", + "name": "Gemini 2.5 Flash Lite Preview 09-25 (Vertex)", + "api": "google-vertex", + "provider": "google-vertex", + "baseUrl": "https://{location}-aiplatform.googleapis.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.4, + "cacheRead": 0.01, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-2.5-pro", + "name": "Gemini 2.5 Pro (Vertex)", + "api": "google-vertex", + "provider": "google-vertex", + "baseUrl": "https://{location}-aiplatform.googleapis.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.125, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3-flash-preview", + "name": "Gemini 3 Flash Preview (Vertex)", + "api": "google-vertex", + "provider": "google-vertex", + "baseUrl": "https://{location}-aiplatform.googleapis.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.5, + "output": 3, + "cacheRead": 0.05, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3-pro-preview", + "name": "Gemini 3 Pro Preview (Vertex)", + "api": "google-vertex", + "provider": "google-vertex", + "baseUrl": "https://{location}-aiplatform.googleapis.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "LOW", + "medium": null, + "high": "HIGH" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 12, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "gemini-3.1-flash-lite", + "name": "Gemini 3.1 Flash Lite", + "api": "google-vertex", + "provider": "google-vertex", + "baseUrl": "https://{location}-aiplatform.googleapis.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 1.5, + "cacheRead": 0.025, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3.1-flash-lite-image", + "name": "Nano Banana 2 Lite", + "api": "google-vertex", + "provider": "google-vertex", + "baseUrl": "https://{location}-aiplatform.googleapis.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 30, + "cacheRead": 0.025, + "cacheWrite": 0 + }, + "contextWindow": 65536, + "maxTokens": 4096 + }, + { + "id": "gemini-3.1-pro-preview", + "name": "Gemini 3.1 Pro Preview (Vertex)", + "api": "google-vertex", + "provider": "google-vertex", + "baseUrl": "https://{location}-aiplatform.googleapis.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "LOW", + "medium": null, + "high": "HIGH" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 12, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3.1-pro-preview-customtools", + "name": "Gemini 3.1 Pro Preview Custom Tools (Vertex)", + "api": "google-vertex", + "provider": "google-vertex", + "baseUrl": "https://{location}-aiplatform.googleapis.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "LOW", + "medium": null, + "high": "HIGH" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 12, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3.5-flash", + "name": "Gemini 3.5 Flash", + "api": "google-vertex", + "provider": "google-vertex", + "baseUrl": "https://{location}-aiplatform.googleapis.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.5, + "output": 9, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3.5-flash-lite", + "name": "Gemini 3.5 Flash Lite", + "api": "google-vertex", + "provider": "google-vertex", + "baseUrl": "https://{location}-aiplatform.googleapis.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 2.5, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3.6-flash", + "name": "Gemini 3.6 Flash", + "api": "google-vertex", + "provider": "google-vertex", + "baseUrl": "https://{location}-aiplatform.googleapis.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 3.75, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3.7-flash", + "name": "Gemini 3.7 Flash (Vertex)", + "api": "google-vertex", + "provider": "google-vertex", + "baseUrl": "https://{location}-aiplatform.googleapis.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "LOW", + "medium": "MEDIUM", + "high": "HIGH" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 3.75, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3.8-flash", + "name": "Gemini 3.8 Flash", + "api": "google-vertex", + "provider": "google-vertex", + "baseUrl": "https://{location}-aiplatform.googleapis.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "LOW", + "medium": "MEDIUM", + "high": "HIGH" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 3.75, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-4-argon", + "name": "Gemini 4 Argon", + "api": "google-vertex", + "provider": "google-vertex", + "baseUrl": "https://{location}-aiplatform.googleapis.com", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "LOW", + "medium": "MEDIUM", + "high": "HIGH" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.1, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "openai/gpt-oss-120b", + "name": "GPT OSS 120B", + "api": "openai-completions", + "provider": "groq", + "baseUrl": "https://api.groq.com/openai/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 65536 + }, + { + "id": "openai/gpt-oss-20b", + "name": "GPT OSS 20B", + "api": "openai-completions", + "provider": "groq", + "baseUrl": "https://api.groq.com/openai/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.075, + "output": 0.3, + "cacheRead": 0.0375, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 65536 + }, + { + "id": "openai/gpt-oss-safeguard-20b", + "name": "Safety GPT OSS 20B", + "api": "openai-completions", + "provider": "groq", + "baseUrl": "https://api.groq.com/openai/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.075, + "output": 0.3, + "cacheRead": 0.0375, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 65536 + }, + { + "id": "qwen/qwen3.8-27b", + "name": "Qwen/Qwen3.8-27B", + "api": "openai-completions", + "provider": "groq", + "baseUrl": "https://api.groq.com/openai/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max", + "minimal": null, + "low": null, + "medium": null, + "high": "default" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.7999999999999999, + "output": 4, + "cacheRead": 0.39999999999999997, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 16384 + }, + { + "id": "MiniMaxAI/MiniMax-M1-80k", + "name": "MiniMax M1 80K", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.55, + "output": 2.2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 80000 + }, + { + "id": "MiniMaxAI/MiniMax-M2", + "name": "MiniMax-M2", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 204800, + "maxTokens": 131072 + }, + { + "id": "MiniMaxAI/MiniMax-M2.1", + "name": "MiniMax-M2.1", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 204800, + "maxTokens": 131072 + }, + { + "id": "MiniMaxAI/MiniMax-M2.5", + "name": "MiniMax-M2.5", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 204800, + "maxTokens": 131072 + }, + { + "id": "MiniMaxAI/MiniMax-M2.7", + "name": "MiniMax-M2.7", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.06, + "cacheWrite": 0 + }, + "contextWindow": 204800, + "maxTokens": 131072 + }, + { + "id": "MiniMaxAI/MiniMax-M3", + "name": "MiniMax-M3", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 524288, + "maxTokens": 512000 + }, + { + "id": "MiniMaxAI/MiniMax-M3.1-Flash", + "name": "MiniMax-M3.1-Flash", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 512000 + }, + { + "id": "Qwen/Qwen2.5-Coder-32B-Instruct", + "name": "Qwen2.5-Coder-32B-Instruct", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.06, + "output": 0.2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 8192 + }, + { + "id": "Qwen/Qwen3-235B-A22B", + "name": "Qwen3 235B-A22B", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 0.2, + "output": 0.8, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 40960, + "maxTokens": 16384 + }, + { + "id": "Qwen/Qwen3-235B-A22B-Instruct-2507", + "name": "Qwen3 235B-A22B Instruct 2507", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.855, + "output": 2.565, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 16384 + }, + { + "id": "Qwen/Qwen3-235B-A22B-Thinking-2507", + "name": "Qwen3-235B-A22B-Thinking-2507", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 3, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 81920 + }, + { + "id": "Qwen/Qwen3-30B-A3B", + "name": "Qwen3 30B A3B", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 0.12, + "output": 0.5, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 40960, + "maxTokens": 16384 + }, + { + "id": "Qwen/Qwen3-32B", + "name": "Qwen3 32B", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 0.29, + "output": 0.59, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 16384 + }, + { + "id": "Qwen/Qwen3-8B", + "name": "Qwen3 8B", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 0.07, + "output": 0.18, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 40960, + "maxTokens": 32768 + }, + { + "id": "Qwen/Qwen3-Coder-30B-A3B-Instruct", + "name": "Qwen3-Coder 30B-A3B Instruct", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.07, + "output": 0.26, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "Qwen/Qwen3-Coder-480B-A35B-Instruct", + "name": "Qwen3-Coder-480B-A35B-Instruct", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 2, + "output": 2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "Qwen/Qwen3-Coder-Next", + "name": "Qwen3-Coder-Next", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.2, + "output": 1.5, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "Qwen/Qwen3-Next-80B-A3B-Instruct", + "name": "Qwen3-Next-80B-A3B-Instruct", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.25, + "output": 1, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "Qwen/Qwen3-VL-235B-A22B-Instruct", + "name": "Qwen3 VL 235B A22B Instruct", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 1.5, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 32768 + }, + { + "id": "Qwen/Qwen3-VL-235B-A22B-Thinking", + "name": "Qwen3 VL 235B A22B Thinking", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.98, + "output": 3.95, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 32768 + }, + { + "id": "Qwen/Qwen3-VL-30B-A3B-Instruct", + "name": "Qwen3 VL 30B A3B Instruct", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.2, + "output": 0.7, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 32768 + }, + { + "id": "Qwen/Qwen3.5-122B-A10B", + "name": "Qwen3.5 122B-A10B", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.4, + "output": 3.2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "Qwen/Qwen3.5-27B", + "name": "Qwen3.5 27B", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 2.4, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "Qwen/Qwen3.5-35B-A3B", + "name": "Qwen3.5 35B-A3B", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "Qwen/Qwen3.5-397B-A17B", + "name": "Qwen3.5-397B-A17B", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.6, + "output": 3.6, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "Qwen/Qwen3.5-9B", + "name": "Qwen3.5 9B", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.17, + "output": 0.25, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "Qwen/Qwen3.6-27B", + "name": "Qwen3.6 27B", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.47, + "output": 3.19, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "Qwen/Qwen3.6-35B-A3B", + "name": "Qwen3.6 35B-A3B", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.95, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "Qwen/Qwen3.8-2.4T-A95B", + "name": "Qwen3.8 2.4T A95B", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 2.5, + "output": 6.25, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 131072 + }, + { + "id": "Qwen/Qwen3.8-27B", + "name": "Qwen3.8 27B", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.4, + "output": 3, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "XiaomiMiMo/MiMo-V2.5", + "name": "MiMo-V2.5", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.4, + "output": 2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 131072 + }, + { + "id": "XiaomiMiMo/MiMo-V2.5-Pro", + "name": "MiMo-V2.5-Pro", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 1, + "output": 3, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "deepseek-ai/DeepSeek-R1", + "name": "DeepSeek-R1", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.7, + "output": 2.5, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 64000, + "maxTokens": 32768 + }, + { + "id": "deepseek-ai/DeepSeek-R1-0528", + "name": "DeepSeek-R1-0528", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 3, + "output": 5, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 163840, + "maxTokens": 32768 + }, + { + "id": "deepseek-ai/DeepSeek-V3", + "name": "DeepSeek-V3", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.4, + "output": 1.3, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 64000, + "maxTokens": 8192 + }, + { + "id": "deepseek-ai/DeepSeek-V3-0324", + "name": "DeepSeek V3 0324", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.27, + "output": 1.12, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 163840, + "maxTokens": 163840 + }, + { + "id": "deepseek-ai/DeepSeek-V3.1", + "name": "DeepSeek-V3.1", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.27, + "output": 1, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 8192 + }, + { + "id": "deepseek-ai/DeepSeek-V3.2", + "name": "DeepSeek-V3.2", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.28, + "output": 0.4, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 163840, + "maxTokens": 65536 + }, + { + "id": "deepseek-ai/DeepSeek-V4-Flash", + "name": "DeepSeek V4 Flash", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.14, + "output": 0.28, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 384000 + }, + { + "id": "deepseek-ai/DeepSeek-V4-Flash-0731", + "name": "DeepSeek V4 Flash 0731", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.14, + "output": 0.28, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 384000 + }, + { + "id": "deepseek-ai/DeepSeek-V4-Flash-Vision-Exp", + "name": "DeepSeek V4 Flash Vision Exp", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.44, + "output": 1.32, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 384000 + }, + { + "id": "deepseek-ai/DeepSeek-V4-Pro", + "name": "DeepSeek V4 Pro", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.435, + "output": 0.87, + "cacheRead": 0.003625, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 393216 + }, + { + "id": "deepseek-ai/DeepSeek-V4-Pro-0813", + "name": "DeepSeek V4 Pro 0813", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 1.32, + "output": 3.96, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 384000 + }, + { + "id": "deepseek-ai/DeepSeek-V4.1-Flash", + "name": "DeepSeek V4.1 Flash", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 384000 + }, + { + "id": "google/gemma-3-12b-it", + "name": "Gemma 3 12B IT", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.05, + "output": 0.15, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 131072 + }, + { + "id": "google/gemma-3-27b-it", + "name": "Gemma 3 27B IT", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.08, + "output": 0.16, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 131072 + }, + { + "id": "google/gemma-3-4b-it", + "name": "Gemma 3 4B IT", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.05, + "output": 0.1, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 131072 + }, + { + "id": "google/gemma-4-26B-A4B-it", + "name": "Gemma 4 26B A4B IT", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.13, + "output": 0.4, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "google/gemma-4-31B-it", + "name": "Gemma 4 31B IT", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.14, + "output": 0.4, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "meta-llama/Llama-3.1-8B-Instruct", + "name": "Llama-3.1-8B-Instruct", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.06, + "output": 0.06, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 4096 + }, + { + "id": "meta-llama/Llama-3.3-70B-Instruct", + "name": "Llama-3.3-70B-Instruct", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.59, + "output": 0.79, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 4096 + }, + { + "id": "moonshotai/Kimi-K2-Instruct", + "name": "Kimi-K2-Instruct", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 1, + "output": 3, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 16384 + }, + { + "id": "moonshotai/Kimi-K2-Instruct-0905", + "name": "Kimi-K2-Instruct-0905", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 1, + "output": 3, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 16384 + }, + { + "id": "moonshotai/Kimi-K2-Thinking", + "name": "Kimi-K2-Thinking", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.6, + "output": 2.5, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "moonshotai/Kimi-K2.5", + "name": "Kimi-K2.5", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.6, + "output": 3, + "cacheRead": 0.1, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "moonshotai/Kimi-K2.6", + "name": "Kimi-K2.6", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.95, + "output": 4, + "cacheRead": 0.16, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "moonshotai/Kimi-K2.7-Code", + "name": "Kimi K2.7 Code", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.95, + "output": 4, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "moonshotai/Kimi-K3", + "name": "Kimi K3", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "openai/gpt-oss-120b", + "name": "GPT OSS 120B", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.25, + "output": 0.69, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 32768 + }, + { + "id": "openai/gpt-oss-20b", + "name": "GPT OSS 20B", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.1, + "output": 0.5, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 32768 + }, + { + "id": "stepfun-ai/Step-3.5-Flash", + "name": "Step 3.5 Flash", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.1, + "output": 0.3, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 256000 + }, + { + "id": "stepfun-ai/Step-3.7-Flash", + "name": "Step 3.7 Flash", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.2, + "output": 1.15, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 256000 + }, + { + "id": "tencent/Hy3", + "name": "Hy3", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.14, + "output": 0.58, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 128000 + }, + { + "id": "tencent/Hy4-preview", + "name": "Hy4 preview", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.834, + "output": 2.501, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "thinkingmachines/Inkling", + "name": "Inkling", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 4.05, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "thinkingmachines/Inkling-Small", + "name": "Inkling Small", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.5, + "output": 1.2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 524288, + "maxTokens": 1048576 + }, + { + "id": "zai-org/GLM-4.5-Air", + "name": "GLM-4.5-Air", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.13, + "output": 0.85, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 98304 + }, + { + "id": "zai-org/GLM-4.5V", + "name": "GLM-4.5V", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.6, + "output": 1.8, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 65536, + "maxTokens": 16384 + }, + { + "id": "zai-org/GLM-4.6", + "name": "GLM-4.6", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.55, + "output": 2.2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 204800, + "maxTokens": 131072 + }, + { + "id": "zai-org/GLM-4.6V-Flash", + "name": "GLM-4.6V-Flash", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 0.9, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 32768 + }, + { + "id": "zai-org/GLM-4.7", + "name": "GLM-4.7", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.6, + "output": 2.2, + "cacheRead": 0.11, + "cacheWrite": 0 + }, + "contextWindow": 204800, + "maxTokens": 131072 + }, + { + "id": "zai-org/GLM-4.7-Flash", + "name": "GLM-4.7-Flash", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 128000 + }, + { + "id": "zai-org/GLM-5", + "name": "GLM-5", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 1, + "output": 3.2, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 202752, + "maxTokens": 131072 + }, + { + "id": "zai-org/GLM-5.1", + "name": "GLM-5.1", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 1, + "output": 3.2, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 202752, + "maxTokens": 131072 + }, + { + "id": "zai-org/GLM-5.2", + "name": "GLM-5.2", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 1.4, + "output": 4.4, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 131072 + }, + { + "id": "zai-org/GLM-5.3", + "name": "GLM-5.3", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 1.4, + "output": 4.4, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "zai-org/GLM-5.3-Flash", + "name": "GLM-5.3-Flash", + "api": "openai-completions", + "provider": "huggingface", + "baseUrl": "https://router.huggingface.co/v1", + "compat": { + "supportsDeveloperRole": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.5, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "k3", + "name": "Kimi K3", + "api": "anthropic-messages", + "provider": "kimi-coding", + "baseUrl": "https://api.kimi.com/coding", + "headers": { + "User-Agent": "omk" + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "k3-256k", + "name": "Kimi K3-256K", + "api": "anthropic-messages", + "provider": "kimi-coding", + "baseUrl": "https://api.kimi.com/coding", + "headers": { + "User-Agent": "omk" + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 131072 + }, + { + "id": "k3.1-pro", + "name": "Kimi K3.1 Pro", + "api": "anthropic-messages", + "provider": "kimi-coding", + "baseUrl": "https://api.kimi.com/coding", + "headers": { + "User-Agent": "omk" + }, + "compat": { + "supportsDisabledThinking": false, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "k3.1-pro-highspeed", + "name": "Kimi K3.1 Pro Highspeed", + "api": "anthropic-messages", + "provider": "kimi-coding", + "baseUrl": "https://api.kimi.com/coding", + "headers": { + "User-Agent": "omk" + }, + "compat": { + "supportsDisabledThinking": false, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "kimi-for-coding", + "name": "kimi-for-coding", + "api": "anthropic-messages", + "provider": "kimi-coding", + "baseUrl": "https://api.kimi.com/coding", + "headers": { + "User-Agent": "omk" + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 32768 + }, + { + "id": "kimi-for-coding-highspeed", + "name": "Kimi For Coding HighSpeed", + "api": "anthropic-messages", + "provider": "kimi-coding", + "baseUrl": "https://api.kimi.com/coding", + "headers": { + "User-Agent": "omk" + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "muse-spark-1.1", + "name": "Muse Spark 1.1", + "api": "openai-responses", + "provider": "meta", + "baseUrl": "https://api.meta.ai/v1", + "compat": { + "sendSessionIdHeader": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 4.25, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "muse-spark-1.2", + "name": "Muse Spark 1.2", + "api": "openai-responses", + "provider": "meta", + "baseUrl": "https://api.meta.ai/v1", + "compat": { + "sendSessionIdHeader": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 4.25, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "muse-spark-1.2-contributor", + "name": "Muse Spark 1.2 Contributor", + "api": "openai-responses", + "provider": "meta", + "baseUrl": "https://api.meta.ai/v1", + "compat": { + "sendSessionIdHeader": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.2, + "cacheRead": 0.002, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "muse-spark-1.3", + "name": "Muse Spark 1.3", + "api": "openai-responses", + "provider": "meta", + "baseUrl": "https://api.meta.ai/v1", + "compat": { + "sendSessionIdHeader": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 4.25, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "muse-spark-1.3-contributor", + "name": "Muse Spark 1.3 Contributor", + "api": "openai-responses", + "provider": "meta", + "baseUrl": "https://api.meta.ai/v1", + "compat": { + "sendSessionIdHeader": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.2, + "cacheRead": 0.002, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "muse-wonder-1.0", + "name": "Muse Wonder", + "api": "openai-responses", + "provider": "meta", + "baseUrl": "https://api.meta.ai/v1", + "compat": { + "sendSessionIdHeader": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "MiniMax-M2.7", + "name": "MiniMax-M2.7", + "api": "anthropic-messages", + "provider": "minimax", + "baseUrl": "https://api.minimax.io/anthropic", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.06, + "cacheWrite": 0.375 + }, + "contextWindow": 204800, + "maxTokens": 131072 + }, + { + "id": "MiniMax-M2.7-highspeed", + "name": "MiniMax-M2.7-highspeed", + "api": "anthropic-messages", + "provider": "minimax", + "baseUrl": "https://api.minimax.io/anthropic", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.6, + "output": 2.4, + "cacheRead": 0.06, + "cacheWrite": 0.375 + }, + "contextWindow": 204800, + "maxTokens": 131072 + }, + { + "id": "MiniMax-M3", + "name": "MiniMax-M3", + "api": "anthropic-messages", + "provider": "minimax", + "baseUrl": "https://api.minimax.io/anthropic", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.06, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 524288 + }, + { + "id": "MiniMax-M2.7", + "name": "MiniMax-M2.7", + "api": "anthropic-messages", + "provider": "minimax-cn", + "baseUrl": "https://api.minimaxi.com/anthropic", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.3137, + "output": 1.2549, + "cacheRead": 0.0627, + "cacheWrite": 0.3922 + }, + "contextWindow": 204800, + "maxTokens": 131072 + }, + { + "id": "MiniMax-M2.7-highspeed", + "name": "MiniMax-M2.7-highspeed", + "api": "anthropic-messages", + "provider": "minimax-cn", + "baseUrl": "https://api.minimaxi.com/anthropic", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.6275, + "output": 2.5098, + "cacheRead": 0.0627, + "cacheWrite": 0.3922 + }, + "contextWindow": 204800, + "maxTokens": 131072 + }, + { + "id": "MiniMax-M3", + "name": "MiniMax-M3", + "api": "anthropic-messages", + "provider": "minimax-cn", + "baseUrl": "https://api.minimaxi.com/anthropic", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3137, + "output": 1.2549, + "cacheRead": 0.0627, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 524288 + }, + { + "id": "codestral-2508", + "name": "Codestral 25.08", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 0.9, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 8192 + }, + { + "id": "codestral-latest", + "name": "Codestral (latest)", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 0.9, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 4096 + }, + { + "id": "deepseek-v4-1-flash-1017", + "name": "DeepSeek V4.1 Flash 1017", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.007, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 128000 + }, + { + "id": "devstral-2512", + "name": "Devstral 2", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.4, + "output": 2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "devstral-latest", + "name": "Devstral 2", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.4, + "output": 2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "devstral-medium-latest", + "name": "Devstral 2 (latest)", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.4, + "output": 2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "glm-5-2", + "name": "GLM-5.2", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 1.4, + "output": 4.4, + "cacheRead": 0.14, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "labs-devstral-small-2512", + "name": "Devstral Small 2", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 256000 + }, + { + "id": "labs-leanstral-1-5-1", + "name": "Leanstral 1.5", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 128000 + }, + { + "id": "magistral-medium-latest", + "name": "Magistral Medium (latest)", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 5, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 16384 + }, + { + "id": "ministral-14b-2512", + "name": "Ministral 3 14B", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.2, + "output": 0.2, + "cacheRead": 0.02, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "ministral-3b-2512", + "name": "Ministral 3 3B", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.1, + "cacheRead": 0.01, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 262144 + }, + { + "id": "ministral-3b-latest", + "name": "Ministral 3B (latest)", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.1, + "cacheRead": 0.01, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 128000 + }, + { + "id": "ministral-8b-2512", + "name": "Ministral 3 8B", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.15, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "ministral-8b-latest", + "name": "Ministral 8B (latest)", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.15, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 128000 + }, + { + "id": "mistral-large-2512", + "name": "Mistral Large 3", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.5, + "output": 1.5, + "cacheRead": 0.05, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "mistral-large-4", + "name": "Mistral Large 4", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.36, + "output": 4.18, + "cacheRead": 0.14, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 262144 + }, + { + "id": "mistral-large-latest", + "name": "Mistral Large (latest)", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.5, + "output": 1.5, + "cacheRead": 0.05, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "mistral-medium-2505", + "name": "Mistral Medium 3", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.4, + "output": 2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 131072 + }, + { + "id": "mistral-medium-2508", + "name": "Mistral Medium 3.1", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.4, + "output": 2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "mistral-medium-2604", + "name": "Mistral Medium 3.5", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.5, + "output": 7.5, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "mistral-medium-3.5", + "name": "Mistral Medium 3.5", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.5, + "output": 7.5, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "mistral-medium-latest", + "name": "Mistral Medium (latest)", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.5, + "output": 7.5, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "mistral-small-2506", + "name": "Mistral Small 3.2", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.3, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "mistral-small-2603", + "name": "Mistral Small 4", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 256000 + }, + { + "id": "mistral-small-latest", + "name": "Mistral Small (latest)", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 256000 + }, + { + "id": "open-mistral-nemo", + "name": "Open Mistral Nemo", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.15, + "output": 0.15, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 128000 + }, + { + "id": "pixtral-12b", + "name": "Pixtral 12B", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.15, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 128000 + }, + { + "id": "voxtral-small-2507", + "name": "Voxtral Small", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.1, + "output": 0.4, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 32768, + "maxTokens": 32000 + }, + { + "id": "voxtral-small-latest", + "name": "Voxtral Small (latest)", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.1, + "output": 0.4, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 32768, + "maxTokens": 32000 + }, + { + "id": "zai-glm-5-2", + "name": "GLM-5.2", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 1.4, + "output": 4.4, + "cacheRead": 0.14, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "zai-glm-5-3", + "name": "GLM-5.3", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 1.4, + "output": 4.4, + "cacheRead": 0.14, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "zai-glm-5-3-flash", + "name": "GLM-5.3-Flash", + "api": "mistral-conversations", + "provider": "mistral", + "baseUrl": "https://api.mistral.ai", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.5, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "kimi-k2.6", + "name": "Kimi K2.6", + "api": "openai-completions", + "provider": "moonshotai", + "baseUrl": "https://api.moonshot.ai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.95, + "output": 4, + "cacheRead": 0.16, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "kimi-k2.7-code", + "name": "Kimi K2.7 Code", + "api": "openai-completions", + "provider": "moonshotai", + "baseUrl": "https://api.moonshot.ai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.95, + "output": 4, + "cacheRead": 0.19, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "kimi-k2.7-code-highspeed", + "name": "Kimi K2.7 Code HighSpeed", + "api": "openai-completions", + "provider": "moonshotai", + "baseUrl": "https://api.moonshot.ai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.9, + "output": 8, + "cacheRead": 0.38, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "kimi-k3", + "name": "Kimi K3", + "api": "openai-completions", + "provider": "moonshotai", + "baseUrl": "https://api.moonshot.ai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "kimi-k3.1-pro", + "name": "Kimi K3.1 Pro", + "api": "openai-completions", + "provider": "moonshotai", + "baseUrl": "https://api.moonshot.ai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "kimi-k3.1-pro-highspeed", + "name": "Kimi K3.1 Pro Highspeed", + "api": "openai-completions", + "provider": "moonshotai", + "baseUrl": "https://api.moonshot.ai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.2, + "cacheWrite": 4 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "kimi-k2.6", + "name": "Kimi K2.6", + "api": "openai-completions", + "provider": "moonshotai-cn", + "baseUrl": "https://api.moonshot.cn/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.9711, + "output": 4.0337, + "cacheRead": 0.1643, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "kimi-k2.7-code", + "name": "Kimi K2.7 Code", + "api": "openai-completions", + "provider": "moonshotai-cn", + "baseUrl": "https://api.moonshot.cn/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.9711, + "output": 4.0337, + "cacheRead": 0.1942, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "kimi-k2.7-code-highspeed", + "name": "Kimi K2.7 Code HighSpeed", + "api": "openai-completions", + "provider": "moonshotai-cn", + "baseUrl": "https://api.moonshot.cn/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.9421, + "output": 8.0673, + "cacheRead": 0.3884, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "kimi-k3", + "name": "Kimi K3", + "api": "openai-completions", + "provider": "moonshotai-cn", + "baseUrl": "https://api.moonshot.cn/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.9879, + "output": 14.9395, + "cacheRead": 0.2988, + "cacheWrite": 2.9879 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "kimi-k3.1-pro", + "name": "Kimi K3.1 Pro", + "api": "openai-completions", + "provider": "moonshotai-cn", + "baseUrl": "https://api.moonshot.cn/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.9437, + "output": 10.1671, + "cacheRead": 0.1944, + "cacheWrite": 1.9437 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "kimi-k3.1-pro-highspeed", + "name": "Kimi K3.1 Pro Highspeed", + "api": "openai-completions", + "provider": "moonshotai-cn", + "baseUrl": "https://api.moonshot.cn/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3.8874, + "output": 20.3342, + "cacheRead": 0.1944, + "cacheWrite": 3.8874 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "deepseek-ai/deepseek-v4.1-flash", + "name": "DeepSeek V4.1 Flash", + "api": "openai-completions", + "provider": "nvidia", + "baseUrl": "https://integrate.api.nvidia.com/v1", + "headers": { + "NVCF-POLL-SECONDS": "3600" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false, + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 384000 + }, + { + "id": "google/diffusiongemma-26b-a4b-it", + "name": "DiffusionGemma 26B A4B IT", + "api": "openai-completions", + "provider": "nvidia", + "baseUrl": "https://integrate.api.nvidia.com/v1", + "headers": { + "NVCF-POLL-SECONDS": "3600" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 250000, + "maxTokens": 32768 + }, + { + "id": "google/gemma-3-12b-it", + "name": "Gemma 3 12B IT", + "api": "openai-completions", + "provider": "nvidia", + "baseUrl": "https://integrate.api.nvidia.com/v1", + "headers": { + "NVCF-POLL-SECONDS": "3600" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 16384 + }, + { + "id": "google/gemma-3-4b-it", + "name": "Gemma 3 4B IT", + "api": "openai-completions", + "provider": "nvidia", + "baseUrl": "https://integrate.api.nvidia.com/v1", + "headers": { + "NVCF-POLL-SECONDS": "3600" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 16384 + }, + { + "id": "meta/llama-3.2-11b-vision-instruct", + "name": "Llama 3.2 11b Vision Instruct", + "api": "openai-completions", + "provider": "nvidia", + "baseUrl": "https://integrate.api.nvidia.com/v1", + "headers": { + "NVCF-POLL-SECONDS": "3600" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 4096 + }, + { + "id": "meta/llama-3.2-90b-vision-instruct", + "name": "Llama-3.2-90B-Vision-Instruct", + "api": "openai-completions", + "provider": "nvidia", + "baseUrl": "https://integrate.api.nvidia.com/v1", + "headers": { + "NVCF-POLL-SECONDS": "3600" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false + }, + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 8192 + }, + { + "id": "meta/muse-glimmer-30b", + "name": "Muse Glimmer 30B", + "api": "openai-completions", + "provider": "nvidia", + "baseUrl": "https://integrate.api.nvidia.com/v1", + "headers": { + "NVCF-POLL-SECONDS": "3600" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 131072 + }, + { + "id": "minimaxai/minimax-m3.1-flash", + "name": "MiniMax-M3.1-Flash", + "api": "openai-completions", + "provider": "nvidia", + "baseUrl": "https://integrate.api.nvidia.com/v1", + "headers": { + "NVCF-POLL-SECONDS": "3600" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "mistralai/mistral-7b-instruct-v0.3", + "name": "Mistral-7B-Instruct-v0.3", + "api": "openai-completions", + "provider": "nvidia", + "baseUrl": "https://integrate.api.nvidia.com/v1", + "headers": { + "NVCF-POLL-SECONDS": "3600" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 65536, + "maxTokens": 65536 + }, + { + "id": "moonshotai/kimi-k2.6", + "name": "Kimi K2.6", + "api": "openai-completions", + "provider": "nvidia", + "baseUrl": "https://integrate.api.nvidia.com/v1", + "headers": { + "NVCF-POLL-SECONDS": "3600" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "nvidia/cosmos-reason2-8b", + "name": "Cosmos Reason2 8B", + "api": "openai-completions", + "provider": "nvidia", + "baseUrl": "https://integrate.api.nvidia.com/v1", + "headers": { + "NVCF-POLL-SECONDS": "3600" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 16384 + }, + { + "id": "nvidia/llama-3.1-nemotron-70b-instruct", + "name": "Llama 3.1 Nemotron 70B Instruct", + "api": "openai-completions", + "provider": "nvidia", + "baseUrl": "https://integrate.api.nvidia.com/v1", + "headers": { + "NVCF-POLL-SECONDS": "3600" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false + }, + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 8192 + }, + { + "id": "nvidia/llama-3.1-nemotron-ultra-253b-v1", + "name": "Llama 3.1 Nemotron Ultra 253B", + "api": "openai-completions", + "provider": "nvidia", + "baseUrl": "https://integrate.api.nvidia.com/v1", + "headers": { + "NVCF-POLL-SECONDS": "3600" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "nvidia/nemotron-3-nano-omni-30b-a3b-reasoning", + "name": "Nemotron 3 Nano Omni", + "api": "openai-completions", + "provider": "nvidia", + "baseUrl": "https://integrate.api.nvidia.com/v1", + "headers": { + "NVCF-POLL-SECONDS": "3600" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 65536 + }, + { + "id": "nvidia/nemotron-3-ultra-550b-a55b", + "name": "Nemotron 3 Ultra 550B A55B", + "api": "openai-completions", + "provider": "nvidia", + "baseUrl": "https://integrate.api.nvidia.com/v1", + "headers": { + "NVCF-POLL-SECONDS": "3600" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 65536 + }, + { + "id": "nvidia/nemotron-3.5-lightning-30b-a3b", + "name": "Nemotron 3.5 Lightning 30B A3B", + "api": "openai-completions", + "provider": "nvidia", + "baseUrl": "https://integrate.api.nvidia.com/v1", + "headers": { + "NVCF-POLL-SECONDS": "3600" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "nvidia/nemotron-3.5-super-vl-120b-a12b", + "name": "Nemotron 3.5 Super VL 120B A12B", + "api": "openai-completions", + "provider": "nvidia", + "baseUrl": "https://integrate.api.nvidia.com/v1", + "headers": { + "NVCF-POLL-SECONDS": "3600" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 8192 + }, + { + "id": "openai/gpt-oss-20b", + "name": "GPT OSS 20B", + "api": "openai-completions", + "provider": "nvidia", + "baseUrl": "https://integrate.api.nvidia.com/v1", + "headers": { + "NVCF-POLL-SECONDS": "3600" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 32768 + }, + { + "id": "poolside/laguna-xs-2.1", + "name": "Laguna XS 2.1", + "api": "openai-completions", + "provider": "nvidia", + "baseUrl": "https://integrate.api.nvidia.com/v1", + "headers": { + "NVCF-POLL-SECONDS": "3600" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 16384 + }, + { + "id": "z-ai/glm-5.3-flash", + "name": "GLM-5.3-Flash", + "api": "openai-completions", + "provider": "nvidia", + "baseUrl": "https://integrate.api.nvidia.com/v1", + "headers": { + "NVCF-POLL-SECONDS": "3600" + }, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": true, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "gpt-4", + "name": "GPT-4", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 30, + "output": 60, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 8192, + "maxTokens": 8192 + }, + { + "id": "gpt-4-turbo", + "name": "GPT-4 Turbo", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 30, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 4096 + }, + { + "id": "gpt-4.1", + "name": "GPT-4.1", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 8, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 1047576, + "maxTokens": 32768 + }, + { + "id": "gpt-4.1-mini", + "name": "GPT-4.1 mini", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.4, + "output": 1.6, + "cacheRead": 0.1, + "cacheWrite": 0 + }, + "contextWindow": 1047576, + "maxTokens": 32768 + }, + { + "id": "gpt-4.1-nano", + "name": "GPT-4.1 nano", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.4, + "cacheRead": 0.025, + "cacheWrite": 0 + }, + "contextWindow": 1047576, + "maxTokens": 32768 + }, + { + "id": "gpt-4o", + "name": "GPT-4o", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 10, + "cacheRead": 1.25, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "gpt-4o-2024-05-13", + "name": "GPT-4o (2024-05-13)", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 15, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 4096 + }, + { + "id": "gpt-4o-2024-08-06", + "name": "GPT-4o (2024-08-06)", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 10, + "cacheRead": 1.25, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "gpt-4o-2024-11-20", + "name": "GPT-4o (2024-11-20)", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 10, + "cacheRead": 1.25, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "gpt-4o-mini", + "name": "GPT-4o mini", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "gpt-5", + "name": "GPT-5", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.125, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-chat-latest", + "name": "GPT-5 Chat Latest", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": false, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.125, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "gpt-5-mini", + "name": "GPT-5 Mini", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 2, + "cacheRead": 0.025, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-nano", + "name": "GPT-5 Nano", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.05, + "output": 0.4, + "cacheRead": 0.005, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-pro", + "name": "GPT-5 Pro", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 15, + "output": 120, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 272000 + }, + { + "id": "gpt-5.1", + "name": "GPT-5.1", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.125, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.1-codex", + "name": "GPT-5.1 Codex", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 5, + "cacheRead": 0.125, + "cacheWrite": 1.25 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.1-codex-max", + "name": "GPT-5.1 Codex Max", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.125, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.2", + "name": "GPT-5.2", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.75, + "output": 14, + "cacheRead": 0.175, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.2-chat-latest", + "name": "GPT-5.2 Chat", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.75, + "output": 14, + "cacheRead": 0.175, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "gpt-5.2-pro", + "name": "GPT-5.2 Pro", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 21, + "output": 168, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.3-chat-latest", + "name": "GPT-5.3 Chat (latest)", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": false, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.75, + "output": 14, + "cacheRead": 0.175, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "gpt-5.3-codex", + "name": "GPT-5.3 Codex", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.75, + "output": 14, + "cacheRead": 0.175, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.3-codex-spark", + "name": "GPT-5.3 Codex Spark", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.75, + "output": 14, + "cacheRead": 0.175, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 32000 + }, + { + "id": "gpt-5.4", + "name": "GPT-5.4", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 15, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.4-mini", + "name": "GPT-5.4 mini", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 4.5, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.4-nano", + "name": "GPT-5.4 nano", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.2, + "output": 1.25, + "cacheRead": 0.02, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.4-pro", + "name": "GPT-5.4 Pro", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 30, + "output": 180, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.5", + "name": "GPT-5.5", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "xhigh": "xhigh", + "minimal": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 30, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.5-pro", + "name": "GPT-5.5 Pro", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh", + "minimal": null, + "low": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 30, + "output": 180, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.6", + "name": "GPT-5.6", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "xhigh": "xhigh", + "minimal": null, + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.4, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.6-luna", + "name": "GPT-5.6 Luna", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "xhigh": "xhigh", + "minimal": null, + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.2, + "output": 1.2, + "cacheRead": 0.02, + "cacheWrite": 0.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.6-sol", + "name": "GPT-5.6 Sol", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "xhigh": "xhigh", + "minimal": null, + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.4, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.6-terra", + "name": "GPT-5.6 Terra", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "xhigh": "xhigh", + "minimal": null, + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 12, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-astra", + "name": "GPT-6 Astra", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-luna", + "name": "GPT-6 Luna", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.5, + "cacheRead": 0.01, + "cacheWrite": 0.125 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-sol", + "name": "GPT-6 Sol", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-6.1-sol", + "name": "GPT-6.1 Sol", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.1, + "cacheWrite": 2.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-6.1-terra", + "name": "GPT-6.1 Terra", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.05, + "cacheWrite": 1.25 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-daybreak-blue-latest", + "name": "Daybreak Blue", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.4, + "cacheWrite": 5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-daybreak-red-latest", + "name": "Daybreak Red", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 12.5, + "output": 75, + "cacheRead": 1.25, + "cacheWrite": 15.625 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-realtime-2.1", + "name": "GPT-Realtime-2.1", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 24, + "cacheRead": 0.4, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 32000 + }, + { + "id": "o1", + "name": "o1", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 15, + "output": 60, + "cacheRead": 7.5, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "o1-pro", + "name": "o1-pro", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 150, + "output": 600, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "o3", + "name": "o3", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 8, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "o3-mini", + "name": "o3-mini", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 1.1, + "output": 4.4, + "cacheRead": 0.55, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "o3-pro", + "name": "o3-pro", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 20, + "output": 80, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "o4-mini", + "name": "o4-mini", + "api": "openai-responses", + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.1, + "output": 4.4, + "cacheRead": 0.275, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "gpt-5.3-codex-spark", + "name": "GPT-5.3 Codex Spark", + "api": "openai-codex-responses", + "provider": "openai-codex", + "baseUrl": "https://chatgpt.com/backend-api", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "minimal": "low" + }, + "input": [ + "text" + ], + "cost": { + "input": 1.75, + "output": 14, + "cacheRead": 0.175, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.4", + "name": "GPT-5.4", + "api": "openai-codex-responses", + "provider": "openai-codex", + "baseUrl": "https://chatgpt.com/backend-api", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "minimal": "low" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 15, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.4-mini", + "name": "GPT-5.4 mini", + "api": "openai-codex-responses", + "provider": "openai-codex", + "baseUrl": "https://chatgpt.com/backend-api", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "minimal": "low" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 4.5, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.5", + "name": "GPT-5.5", + "api": "openai-codex-responses", + "provider": "openai-codex", + "baseUrl": "https://chatgpt.com/backend-api", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "minimal": "low" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 30, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.6-luna", + "name": "GPT-5.6 Luna", + "api": "openai-codex-responses", + "provider": "openai-codex", + "baseUrl": "https://chatgpt.com/backend-api", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "xhigh", + "minimal": "low" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 6, + "cacheRead": 0.1, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.6-moa", + "name": "GPT-5.6 MoA (Sol + Terra)", + "api": "openai-codex-responses", + "provider": "openai-codex", + "baseUrl": "https://chatgpt.com/backend-api", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "xhigh", + "minimal": "low", + "ultra": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.6-sol", + "name": "GPT-5.6 Sol", + "api": "openai-codex-responses", + "provider": "openai-codex", + "baseUrl": "https://chatgpt.com/backend-api", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "xhigh", + "minimal": "low", + "ultra": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 30, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.6-terra", + "name": "GPT-5.6 Terra", + "api": "openai-codex-responses", + "provider": "openai-codex", + "baseUrl": "https://chatgpt.com/backend-api", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "xhigh", + "minimal": "low", + "ultra": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 15, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-astra", + "name": "GPT-6 Astra", + "api": "openai-codex-responses", + "provider": "openai-codex", + "baseUrl": "https://chatgpt.com/backend-api", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 872000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-luna", + "name": "GPT-6 Luna", + "api": "openai-codex-responses", + "provider": "openai-codex", + "baseUrl": "https://chatgpt.com/backend-api", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.5, + "cacheRead": 0.01, + "cacheWrite": 0.125 + }, + "contextWindow": 872000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-sol", + "name": "GPT-6 Sol", + "api": "openai-codex-responses", + "provider": "openai-codex", + "baseUrl": "https://chatgpt.com/backend-api", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 872000, + "maxTokens": 128000 + }, + { + "id": "gpt-6.1-sol", + "name": "GPT-6.1 Sol", + "api": "openai-codex-responses", + "provider": "openai-codex", + "baseUrl": "https://chatgpt.com/backend-api", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.1, + "cacheWrite": 2.5 + }, + "contextWindow": 872000, + "maxTokens": 128000 + }, + { + "id": "gpt-6.1-terra", + "name": "GPT-6.1 Terra", + "api": "openai-codex-responses", + "provider": "openai-codex", + "baseUrl": "https://chatgpt.com/backend-api", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.05, + "cacheWrite": 1.25 + }, + "contextWindow": 872000, + "maxTokens": 128000 + }, + { + "id": "beam-free", + "name": "Beam Free", + "api": "openai-completions", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "big-pickle", + "name": "Big Pickle", + "api": "openai-completions", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 32000 + }, + { + "id": "claude-fable-5", + "name": "Claude Fable 5", + "api": "anthropic-messages", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-1", + "name": "Claude Fable 5.1", + "api": "anthropic-messages", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 0.25, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-2", + "name": "Claude Fable 5.2", + "api": "anthropic-messages", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 8, + "output": 40, + "cacheRead": 0.2, + "cacheWrite": 10 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-haiku-4-5", + "name": "Claude Haiku 4.5", + "api": "anthropic-messages", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5", + "name": "Claude Opus 4.5", + "api": "anthropic-messages", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-6", + "name": "Claude Opus 4.6", + "api": "anthropic-messages", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-7", + "name": "Claude Opus 4.7", + "api": "anthropic-messages", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-8", + "name": "Claude Opus 4.8", + "api": "anthropic-messages", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5", + "name": "Claude Opus 5", + "api": "anthropic-messages", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-5", + "name": "Claude Opus 5.5", + "api": "anthropic-messages", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen", + "compat": { + "forceAdaptiveThinking": true, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.2, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-4-5", + "name": "Claude Sonnet 4.5", + "api": "anthropic-messages", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "api": "anthropic-messages", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-5", + "name": "Claude Sonnet 5", + "api": "anthropic-messages", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "deepseek-v4-flash", + "name": "DeepSeek V4 Flash", + "api": "openai-completions", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 0.14, + "output": 0.28, + "cacheRead": 0.028, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 384000 + }, + { + "id": "deepseek-v4-pro", + "name": "DeepSeek V4 Pro", + "api": "openai-completions", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 1.74, + "output": 3.48, + "cacheRead": 0.145, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 384000 + }, + { + "id": "deepseek-v4.1-flash", + "name": "DeepSeek V4.1 Flash", + "api": "openai-completions", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek", + "supportsReasoningEffort": true, + "maxTokensField": "max_tokens" + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.006, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 384000 + }, + { + "id": "deepseek-v4.1-flash-free", + "name": "DeepSeek V4.1 Flash Free", + "api": "openai-completions", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 32000 + }, + { + "id": "flint-40b-free", + "name": "Flint 40B Free", + "api": "openai-completions", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "gemini-3-flash", + "name": "Gemini 3 Flash", + "api": "google-generative-ai", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.5, + "output": 3, + "cacheRead": 0.05, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3.1-pro", + "name": "Gemini 3.1 Pro Preview", + "api": "google-generative-ai", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "LOW", + "medium": null, + "high": "HIGH" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 12, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3.5-flash", + "name": "Gemini 3.5 Flash", + "api": "google-generative-ai", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.5, + "output": 9, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3.5-flash-lite", + "name": "Gemini 3.5 Flash Lite", + "api": "google-generative-ai", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 2.5, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3.6-flash", + "name": "Gemini 3.6 Flash", + "api": "google-generative-ai", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.5, + "output": 7.5, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3.7-flash", + "name": "Gemini 3.7 Flash", + "api": "google-generative-ai", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "LOW", + "medium": "MEDIUM", + "high": "HIGH" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.5, + "output": 7.5, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-3.8-flash", + "name": "Gemini 3.8 Flash", + "api": "google-generative-ai", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "LOW", + "medium": "MEDIUM", + "high": "HIGH" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.5, + "output": 7.5, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "gemini-4-argon", + "name": "Gemini 4 Argon", + "api": "google-generative-ai", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "LOW", + "medium": "MEDIUM", + "high": "HIGH" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.1, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "glm-5", + "name": "GLM-5", + "api": "openai-completions", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 1, + "output": 3.2, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 204800, + "maxTokens": 131072 + }, + { + "id": "glm-5.1", + "name": "GLM-5.1", + "api": "openai-completions", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 1.4, + "output": 4.4, + "cacheRead": 0.26, + "cacheWrite": 0 + }, + "contextWindow": 204800, + "maxTokens": 131072 + }, + { + "id": "glm-5.2", + "name": "GLM-5.2", + "api": "openai-completions", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 1.4, + "output": 4.4, + "cacheRead": 0.26, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "glm-5.3", + "name": "GLM-5.3", + "api": "openai-completions", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 1.4, + "output": 4.4, + "cacheRead": 0.26, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "glm-5.3-flash", + "name": "GLM-5.3-Flash", + "api": "openai-completions", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.5, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "glm-5.3-flash-free", + "name": "GLM-5.3-Flash Free", + "api": "openai-completions", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 32000 + }, + { + "id": "gpt-5", + "name": "GPT-5", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.07, + "output": 8.5, + "cacheRead": 0.107, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-codex", + "name": "GPT-5 Codex", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.07, + "output": 8.5, + "cacheRead": 0.107, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5-nano", + "name": "GPT-5 Nano", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.05, + "output": 0.4, + "cacheRead": 0.005, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.1", + "name": "GPT-5.1", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.07, + "output": 8.5, + "cacheRead": 0.107, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.1-codex", + "name": "GPT-5.1 Codex", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.07, + "output": 8.5, + "cacheRead": 0.107, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.1-codex-max", + "name": "GPT-5.1 Codex Max", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.125, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.1-codex-mini", + "name": "GPT-5.1 Codex Mini", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 2, + "cacheRead": 0.025, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.2", + "name": "GPT-5.2", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.75, + "output": 14, + "cacheRead": 0.175, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.2-codex", + "name": "GPT-5.2 Codex", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.75, + "output": 14, + "cacheRead": 0.175, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.3-codex", + "name": "GPT-5.3 Codex", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.75, + "output": 14, + "cacheRead": 0.175, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.4", + "name": "GPT-5.4", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 15, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.4-mini", + "name": "GPT-5.4 Mini", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 4.5, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.4-nano", + "name": "GPT-5.4 Nano", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.2, + "output": 1.25, + "cacheRead": 0.02, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.4-pro", + "name": "GPT-5.4 Pro", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 30, + "output": 180, + "cacheRead": 30, + "cacheWrite": 0 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.5", + "name": "GPT-5.5", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 30, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.5-pro", + "name": "GPT-5.5 Pro", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh", + "minimal": null, + "low": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 30, + "output": 180, + "cacheRead": 30, + "cacheWrite": 0 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.6-luna", + "name": "GPT-5.6 Luna", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.2, + "output": 1.2, + "cacheRead": 0.02, + "cacheWrite": 0.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.6-sol", + "name": "GPT-5.6 Sol", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.4, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.6-terra", + "name": "GPT-5.6 Terra", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 12, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-astra", + "name": "GPT-6 Astra", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-luna", + "name": "GPT-6 Luna", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.5, + "cacheRead": 0.01, + "cacheWrite": 0.125 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-sol", + "name": "GPT-6 Sol", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-6.1-sol", + "name": "GPT-6.1 Sol", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.1, + "cacheWrite": 2.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "grok-4.5", + "name": "Grok 4.5", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.3, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 500000 + }, + { + "id": "grok-4.6", + "name": "Grok 4.6", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 500000 + }, + { + "id": "grok-4.7", + "name": "Grok 4.7", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 500000 + }, + { + "id": "grok-build-0.1", + "name": "Grok Build 0.1", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 2, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 256000 + }, + { + "id": "kimi-k2.5", + "name": "Kimi K2.5", + "api": "openai-completions", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.6, + "output": 3, + "cacheRead": 0.1, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "kimi-k2.6", + "name": "Kimi K2.6", + "api": "openai-completions", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "compat": { + "thinkingFormat": "deepseek", + "supportsReasoningEffort": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.95, + "output": 4, + "cacheRead": 0.16, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "kimi-k2.7-code", + "name": "Kimi K2.7 Code", + "api": "openai-completions", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.95, + "output": 4, + "cacheRead": 0.19, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "kimi-k3", + "name": "Kimi K3", + "api": "openai-completions", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.6-flash-free", + "name": "MiMo-V2.6-Flash Free", + "api": "openai-completions", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 32000 + }, + { + "id": "minimax-m2.5", + "name": "MiniMax-M2.5", + "api": "openai-completions", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.06, + "cacheWrite": 0 + }, + "contextWindow": 204800, + "maxTokens": 131072 + }, + { + "id": "minimax-m2.7", + "name": "MiniMax-M2.7", + "api": "openai-completions", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.06, + "cacheWrite": 0 + }, + "contextWindow": 204800, + "maxTokens": 131072 + }, + { + "id": "minimax-m3", + "name": "MiniMax-M3", + "api": "openai-completions", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.06, + "cacheWrite": 0 + }, + "contextWindow": 512000, + "maxTokens": 128000 + }, + { + "id": "mistral-large-4", + "name": "Mistral Large 4", + "api": "openai-completions", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.68, + "output": 2.09, + "cacheRead": 0.07, + "cacheWrite": 0 + }, + "contextWindow": 524288, + "maxTokens": 262144 + }, + { + "id": "muse-spark-1.2", + "name": "Muse Spark 1.2", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 4.25, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "muse-spark-1.3", + "name": "Muse Spark 1.3", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 4.25, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "muse-wonder-1.0", + "name": "Muse Wonder", + "api": "openai-responses", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "nemotron-3.5-lightning-free", + "name": "Nemotron 3.5 Lightning Free", + "api": "openai-completions", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "nemotron-3.5-super-vl-free", + "name": "Nemotron 3.5 Super VL Free", + "api": "openai-completions", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "qwen3.5-plus", + "name": "Qwen3.5 Plus", + "api": "anthropic-messages", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.2, + "output": 1.2, + "cacheRead": 0.02, + "cacheWrite": 0.25 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "qwen3.6-plus", + "name": "Qwen3.6 Plus", + "api": "anthropic-messages", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.5, + "output": 3, + "cacheRead": 0.05, + "cacheWrite": 0.625 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "qwen3.8-flash", + "name": "Qwen3.8 Flash", + "api": "anthropic-messages", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.47, + "cacheRead": 0.016, + "cacheWrite": 0.2 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "qwen3.8-max", + "name": "Qwen3.8 Max", + "api": "openai-completions", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.25, + "cacheWrite": 2.5 + }, + "contextWindow": 262144, + "maxTokens": 131072 + }, + { + "id": "space-bunny-free", + "name": "Space Bunny Free", + "api": "openai-completions", + "provider": "opencode", + "baseUrl": "https://opencode.ai/zen/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 524288 + }, + { + "id": "beam-free", + "name": "Beam Free", + "api": "openai-completions", + "provider": "opencode-go", + "baseUrl": "https://opencode.ai/inference/go/openai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsLongCacheRetention": false, + "supportsStrictMode": false, + "maxTokensField": "max_tokens", + "requiresReasoningContentOnAssistantMessages": true, + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "claude-haiku-5-5", + "name": "Claude Haiku 5.5", + "api": "anthropic-messages", + "provider": "opencode-go", + "baseUrl": "https://opencode.ai/inference/go/anthropic", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.5, + "cacheRead": 0.01, + "cacheWrite": 0.125 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "deepseek-v4-pro", + "name": "DeepSeek V4 Pro (New)", + "api": "openai-completions", + "provider": "opencode-go", + "baseUrl": "https://opencode.ai/inference/go/openai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsLongCacheRetention": false, + "supportsStrictMode": false, + "maxTokensField": "max_tokens", + "requiresReasoningContentOnAssistantMessages": true, + "supportsReasoningEffort": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.66, + "output": 1.98, + "cacheRead": 0.022, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 384000 + }, + { + "id": "deepseek-v4.1-flash", + "name": "DeepSeek V4.1 Flash", + "api": "openai-completions", + "provider": "opencode-go", + "baseUrl": "https://opencode.ai/inference/go/openai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsLongCacheRetention": false, + "supportsStrictMode": false, + "maxTokensField": "max_tokens", + "requiresReasoningContentOnAssistantMessages": true, + "supportsReasoningEffort": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0.003, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 384000 + }, + { + "id": "gemini-4-argon", + "name": "Gemini 4 Argon", + "api": "google-generative-ai", + "provider": "opencode-go", + "baseUrl": "https://opencode.ai/inference/go/google/v1beta", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "LOW", + "medium": "MEDIUM", + "high": "HIGH", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.1, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "glm-5.2", + "name": "GLM-5.2", + "api": "openai-completions", + "provider": "opencode-go", + "baseUrl": "https://opencode.ai/inference/go/openai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsLongCacheRetention": false, + "supportsStrictMode": false, + "maxTokensField": "max_tokens", + "requiresReasoningContentOnAssistantMessages": true, + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 1.4, + "output": 4.4, + "cacheRead": 0.26, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "glm-5.3", + "name": "GLM-5.3", + "api": "openai-completions", + "provider": "opencode-go", + "baseUrl": "https://opencode.ai/inference/go/openai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsLongCacheRetention": false, + "supportsStrictMode": false, + "maxTokensField": "max_tokens", + "requiresReasoningContentOnAssistantMessages": true, + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 1.4, + "output": 4.4, + "cacheRead": 0.26, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "glm-5.3-flash", + "name": "GLM-5.3-Flash", + "api": "openai-completions", + "provider": "opencode-go", + "baseUrl": "https://opencode.ai/inference/go/openai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsLongCacheRetention": false, + "supportsStrictMode": false, + "maxTokensField": "max_tokens", + "requiresReasoningContentOnAssistantMessages": true, + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.5, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "gpt-5.6-luna", + "name": "GPT-5.6 Luna", + "api": "openai-responses", + "provider": "opencode-go", + "baseUrl": "https://opencode.ai/inference/go/openai/v1", + "compat": { + "sendSessionIdHeader": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.2, + "output": 1.2, + "cacheRead": 0.02, + "cacheWrite": 0.25 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-luna", + "name": "GPT-6 Luna", + "api": "openai-responses", + "provider": "opencode-go", + "baseUrl": "https://opencode.ai/inference/go/openai/v1", + "compat": { + "sendSessionIdHeader": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.5, + "cacheRead": 0.01, + "cacheWrite": 0.125 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "grok-4.7", + "name": "Grok 4.7", + "api": "openai-responses", + "provider": "opencode-go", + "baseUrl": "https://opencode.ai/inference/go/openai/v1", + "compat": { + "sendSessionIdHeader": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 500000 + }, + { + "id": "hy3", + "name": "Hy3", + "api": "openai-completions", + "provider": "opencode-go", + "baseUrl": "https://opencode.ai/inference/go/openai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsLongCacheRetention": false, + "supportsStrictMode": false, + "maxTokensField": "max_tokens", + "requiresReasoningContentOnAssistantMessages": true, + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.14, + "output": 0.58, + "cacheRead": 0.035, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 128000 + }, + { + "id": "hy4-preview", + "name": "Hy4 preview", + "api": "openai-completions", + "provider": "opencode-go", + "baseUrl": "https://opencode.ai/inference/go/openai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsLongCacheRetention": false, + "supportsStrictMode": false, + "maxTokensField": "max_tokens", + "requiresReasoningContentOnAssistantMessages": true, + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.834, + "output": 2.501, + "cacheRead": 0.042, + "cacheWrite": 0 + }, + "contextWindow": 1024000, + "maxTokens": 64000 + }, + { + "id": "iceman-contributor-free", + "name": "Iceman Contributor Free", + "api": "openai-completions", + "provider": "opencode-go", + "baseUrl": "https://opencode.ai/inference/go/openai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsLongCacheRetention": false, + "supportsStrictMode": false, + "maxTokensField": "max_tokens", + "requiresReasoningContentOnAssistantMessages": true, + "supportsReasoningEffort": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 131072 + }, + { + "id": "kimi-k2.7-code", + "name": "Kimi K2.7 Code", + "api": "openai-completions", + "provider": "opencode-go", + "baseUrl": "https://opencode.ai/inference/go/openai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsLongCacheRetention": false, + "supportsStrictMode": false, + "maxTokensField": "max_tokens", + "requiresReasoningContentOnAssistantMessages": true, + "supportsReasoningEffort": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.95, + "output": 4, + "cacheRead": 0.19, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "kimi-k3", + "name": "Kimi K3", + "api": "openai-completions", + "provider": "opencode-go", + "baseUrl": "https://opencode.ai/inference/go/openai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsLongCacheRetention": false, + "supportsStrictMode": false, + "maxTokensField": "max_tokens", + "requiresReasoningContentOnAssistantMessages": true, + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "kimi-k3.1-pro", + "name": "Kimi K3.1 Pro", + "api": "openai-completions", + "provider": "opencode-go", + "baseUrl": "https://opencode.ai/inference/go/openai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsLongCacheRetention": false, + "supportsStrictMode": false, + "maxTokensField": "max_tokens", + "requiresReasoningContentOnAssistantMessages": true, + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "longcat-2.0", + "name": "LongCat-2.0", + "api": "openai-completions", + "provider": "opencode-go", + "baseUrl": "https://opencode.ai/inference/go/openai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsLongCacheRetention": false, + "supportsStrictMode": false, + "maxTokensField": "max_tokens", + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek", + "supportsReasoningEffort": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.006, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.6-flash", + "name": "MiMo-V2.6-Flash", + "api": "openai-completions", + "provider": "opencode-go", + "baseUrl": "https://opencode.ai/inference/go/openai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsLongCacheRetention": false, + "supportsStrictMode": false, + "maxTokensField": "max_tokens", + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek", + "supportsReasoningEffort": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.14, + "output": 0.28, + "cacheRead": 0.0028, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.6-pro", + "name": "MiMo-V2.6-Pro", + "api": "openai-completions", + "provider": "opencode-go", + "baseUrl": "https://opencode.ai/inference/go/openai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsLongCacheRetention": false, + "supportsStrictMode": false, + "maxTokensField": "max_tokens", + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek", + "supportsReasoningEffort": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.435, + "output": 0.87, + "cacheRead": 0.003625, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "minimax-m3", + "name": "MiniMax-M3", + "api": "anthropic-messages", + "provider": "opencode-go", + "baseUrl": "https://opencode.ai/inference/go/anthropic", + "compat": { + "allowEmptySignature": true, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.06, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "minimax-m3.1-flash", + "name": "MiniMax M3.1 Flash", + "api": "openai-completions", + "provider": "opencode-go", + "baseUrl": "https://opencode.ai/inference/go/openai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsLongCacheRetention": false, + "supportsStrictMode": false, + "maxTokensField": "max_tokens", + "requiresReasoningContentOnAssistantMessages": true, + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 512000 + }, + { + "id": "muse-spark-1.2-contributor", + "name": "Muse Spark 1.2 Contributor", + "api": "openai-responses", + "provider": "opencode-go", + "baseUrl": "https://opencode.ai/inference/go/openai/v1", + "compat": { + "sendSessionIdHeader": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "xhigh", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.2, + "cacheRead": 0.002, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "muse-spark-1.3-contributor", + "name": "Muse Spark 1.3 Contributor", + "api": "openai-responses", + "provider": "opencode-go", + "baseUrl": "https://opencode.ai/inference/go/openai/v1", + "compat": { + "sendSessionIdHeader": false, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "xhigh", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1, + "output": 0.2, + "cacheRead": 0.002, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "qwen3.7-plus", + "name": "Qwen3.7 Plus", + "api": "anthropic-messages", + "provider": "opencode-go", + "baseUrl": "https://opencode.ai/inference/go/anthropic", + "compat": { + "allowEmptySignature": true, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.4, + "output": 1.6, + "cacheRead": 0.04, + "cacheWrite": 0.5 + }, + "contextWindow": 1000000, + "maxTokens": 65536 + }, + { + "id": "qwen3.8-flash", + "name": "Qwen3.8 Flash", + "api": "anthropic-messages", + "provider": "opencode-go", + "baseUrl": "https://opencode.ai/inference/go/anthropic", + "compat": { + "allowEmptySignature": true, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.47, + "cacheRead": 0.016, + "cacheWrite": 0.2 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "qwen3.8-max", + "name": "Qwen3.8 Max", + "api": "anthropic-messages", + "provider": "opencode-go", + "baseUrl": "https://opencode.ai/inference/go/anthropic", + "compat": { + "allowEmptySignature": true, + "supportsLongCacheRetention": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.25, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "space-bunny", + "name": "Space Bunny", + "api": "openai-completions", + "provider": "opencode-go", + "baseUrl": "https://opencode.ai/inference/go/openai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsLongCacheRetention": false, + "supportsStrictMode": false, + "maxTokensField": "max_tokens", + "requiresReasoningContentOnAssistantMessages": true, + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 524288 + }, + { + "id": "step-5-preview", + "name": "Step 5 Preview", + "api": "openai-completions", + "provider": "opencode-go", + "baseUrl": "https://opencode.ai/inference/go/openai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsLongCacheRetention": false, + "supportsStrictMode": false, + "maxTokensField": "max_tokens", + "requiresReasoningContentOnAssistantMessages": true, + "supportsReasoningEffort": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 2.7, + "cacheRead": 0.1, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 65536 + }, + { + "id": "aion-labs/aion-2.0", + "name": "AionLabs: Aion-2.0", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.7999999999999999, + "output": 1.5999999999999999, + "cacheRead": 0.19999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 32768 + }, + { + "id": "aion-labs/aion-3.0", + "name": "AionLabs: Aion-3.0", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text" + ], + "cost": { + "input": 3, + "output": 6, + "cacheRead": 0.75, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 32768 + }, + { + "id": "aion-labs/aion-3.0-mini", + "name": "AionLabs: Aion-3.0-Mini", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.7, + "output": 1.4, + "cacheRead": 0.18, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 32768 + }, + { + "id": "aion-labs/aion-3.5", + "name": "AionLabs: Aion 3.5", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 3, + "output": 6, + "cacheRead": 0.75, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "aion-labs/aion-3.5-mini", + "name": "AionLabs: Aion 3.5 Mini", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.7, + "output": 1.4, + "cacheRead": 0.18, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "amazon/nova-2-lite-v1", + "name": "Amazon: Nova 2 Lite", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 2.5, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 65535 + }, + { + "id": "amazon/nova-lite-v1", + "name": "Amazon: Nova Lite 1.0", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.06, + "output": 0.24, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 300000, + "maxTokens": 5120 + }, + { + "id": "amazon/nova-micro-v1", + "name": "Amazon: Nova Micro 1.0", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.035, + "output": 0.14, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 5120 + }, + { + "id": "amazon/nova-premier-v1", + "name": "Amazon: Nova Premier 1.0", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 12.5, + "cacheRead": 0.625, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 32000 + }, + { + "id": "amazon/nova-pro-v1", + "name": "Amazon: Nova Pro 1.0", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.7999999999999999, + "output": 3.1999999999999997, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 300000, + "maxTokens": 5120 + }, + { + "id": "anthropic/claude-fable-5", + "name": "Anthropic: Claude Fable 5", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-fable-5.1", + "name": "Anthropic: Claude Fable 5.1", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 0.25, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-fable-5.1:batch", + "name": "Anthropic: Claude Fable 5.1 (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.125, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-fable-5.2", + "name": "Anthropic: Claude Fable 5.2", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 8, + "output": 40, + "cacheRead": 0.19999999999999998, + "cacheWrite": 10 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-fable-5.2:batch", + "name": "Anthropic: Claude Fable 5.2 (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.09999999999999999, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-fable-5:batch", + "name": "Anthropic: Claude Fable 5 (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-haiku-4.5", + "name": "Anthropic: Claude Haiku 4.5", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.09999999999999999, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "anthropic/claude-haiku-4.5:batch", + "name": "Anthropic: Claude Haiku 4.5 (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.5, + "output": 2.5, + "cacheRead": 0.049999999999999996, + "cacheWrite": 0.625 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "anthropic/claude-haiku-5.5", + "name": "Anthropic: Claude Haiku 5.5", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.5, + "cacheRead": 0.01, + "cacheWrite": 0.125 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-haiku-5.5:batch", + "name": "Anthropic: Claude Haiku 5.5 (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.049999999999999996, + "output": 0.25, + "cacheRead": 0.005, + "cacheWrite": 0.0625 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-opus-4.1", + "name": "Anthropic: Claude Opus 4.1", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 15, + "output": 75, + "cacheRead": 1.5, + "cacheWrite": 18.75 + }, + "contextWindow": 200000, + "maxTokens": 32000 + }, + { + "id": "anthropic/claude-opus-4.1:batch", + "name": "Anthropic: Claude Opus 4.1 (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 7.5, + "output": 37.5, + "cacheRead": 0.75, + "cacheWrite": 9.375 + }, + "contextWindow": 200000, + "maxTokens": 32000 + }, + { + "id": "anthropic/claude-opus-4.5", + "name": "Anthropic: Claude Opus 4.5", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "anthropic/claude-opus-4.5:batch", + "name": "Anthropic: Claude Opus 4.5 (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 12.5, + "cacheRead": 0.25, + "cacheWrite": 3.125 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "anthropic/claude-opus-4.6", + "name": "Anthropic: Claude Opus 4.6", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": null, + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-opus-4.6:batch", + "name": "Anthropic: Claude Opus 4.6 (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": null, + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 12.5, + "cacheRead": 0.25, + "cacheWrite": 3.125 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-opus-4.7", + "name": "Anthropic: Claude Opus 4.7", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max", + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-opus-4.7:batch", + "name": "Anthropic: Claude Opus 4.7 (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max", + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 12.5, + "cacheRead": 0.25, + "cacheWrite": 3.125 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-opus-4.8", + "name": "Anthropic: Claude Opus 4.8", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max", + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-opus-4.8:batch", + "name": "Anthropic: Claude Opus 4.8 (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max", + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 12.5, + "cacheRead": 0.25, + "cacheWrite": 3.125 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-opus-5", + "name": "Anthropic: Claude Opus 5", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-opus-5.5", + "name": "Anthropic: Claude Opus 5.5", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.19999999999999998, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-opus-5.5:batch", + "name": "Anthropic: Claude Opus 5.5 (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.09999999999999999, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-opus-5:batch", + "name": "Anthropic: Claude Opus 5 (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 12.5, + "cacheRead": 0.25, + "cacheWrite": 3.125 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-sonnet-4.5", + "name": "Anthropic: Claude Sonnet 4.5", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "anthropic/claude-sonnet-4.5:batch", + "name": "Anthropic: Claude Sonnet 4.5 (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.5, + "output": 7.5, + "cacheRead": 0.15, + "cacheWrite": 1.875 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "anthropic/claude-sonnet-4.6", + "name": "Anthropic: Claude Sonnet 4.6", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": null, + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-sonnet-4.6:batch", + "name": "Anthropic: Claude Sonnet 4.6 (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": null, + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.5, + "output": 7.5, + "cacheRead": 0.15, + "cacheWrite": 1.875 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-sonnet-5", + "name": "Anthropic: Claude Sonnet 5", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.19999999999999998, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-sonnet-5.5", + "name": "Anthropic: Claude Sonnet 5.5", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.09999999999999999, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-sonnet-5.5:batch", + "name": "Anthropic: Claude Sonnet 5.5 (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.049999999999999996, + "cacheWrite": 1.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-sonnet-5:batch", + "name": "Anthropic: Claude Sonnet 5 (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.09999999999999999, + "cacheWrite": 1.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "arcee-ai/trinity-large-thinking", + "name": "Arcee AI: Trinity Large Thinking", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.25, + "output": 0.7999999999999999, + "cacheRead": 0.06, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 80000 + }, + { + "id": "auto", + "name": "Auto", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 2000000, + "maxTokens": 30000 + }, + { + "id": "bytedance-seed/seed-1.6", + "name": "ByteDance Seed: Seed 1.6", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "bytedance-seed/seed-1.6-flash", + "name": "ByteDance Seed: Seed 1.6 Flash", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.075, + "output": 0.3, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "bytedance-seed/seed-2-1-turbo", + "name": "ByteDance Seed: Seed 2.1 Turbo", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.5, + "output": 2.5, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 235929 + }, + { + "id": "bytedance-seed/seed-2.0-code", + "name": "ByteDance Seed: Seed-2.0-Code", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.5, + "output": 3, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 131072 + }, + { + "id": "bytedance-seed/seed-2.0-lite", + "name": "ByteDance Seed: Seed-2.0-Lite", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 131072 + }, + { + "id": "bytedance-seed/seed-2.0-mini", + "name": "ByteDance Seed: Seed-2.0-Mini", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.39999999999999997, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 131072 + }, + { + "id": "cohere/command-a-plus", + "name": "Cohere: Command A+", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 1.5, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 192000, + "maxTokens": 64000 + }, + { + "id": "cohere/command-r-08-2024", + "name": "Cohere: Command R (08-2024)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 4000 + }, + { + "id": "cohere/command-r-plus-08-2024", + "name": "Cohere: Command R+ (08-2024)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 2.5, + "output": 10, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 4000 + }, + { + "id": "cohere/north-mini-code:free", + "name": "Cohere: North Mini Code (free)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 64000 + }, + { + "id": "deepseek/deepseek-chat", + "name": "DeepSeek: DeepSeek V3", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.2574, + "output": 1.0287, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 163840, + "maxTokens": 16000 + }, + { + "id": "deepseek/deepseek-chat-v3-0324", + "name": "DeepSeek: DeepSeek V3 0324", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.29, + "output": 1.1400000000000001, + "cacheRead": 0.11, + "cacheWrite": 0 + }, + "contextWindow": 163840, + "maxTokens": 115200 + }, + { + "id": "deepseek/deepseek-chat-v3.1", + "name": "DeepSeek: DeepSeek V3.1", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.25, + "output": 0.95, + "cacheRead": 0.13, + "cacheWrite": 0 + }, + "contextWindow": 163840, + "maxTokens": 147456 + }, + { + "id": "deepseek/deepseek-r1", + "name": "DeepSeek: R1", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.7, + "output": 2.5, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 64000, + "maxTokens": 16000 + }, + { + "id": "deepseek/deepseek-r1-0528", + "name": "DeepSeek: R1 0528", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.5, + "output": 2.1500000000000004, + "cacheRead": 0.35, + "cacheWrite": 0 + }, + "contextWindow": 163840, + "maxTokens": 32768 + }, + { + "id": "deepseek/deepseek-v3.1-terminus", + "name": "DeepSeek: DeepSeek V3.1 Terminus", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.27, + "output": 1, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 163840, + "maxTokens": 147456 + }, + { + "id": "deepseek/deepseek-v3.2", + "name": "DeepSeek: DeepSeek V3.2", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.28, + "output": 0.42, + "cacheRead": 0.028, + "cacheWrite": 0 + }, + "contextWindow": 163840, + "maxTokens": 65536 + }, + { + "id": "deepseek/deepseek-v3.2-exp", + "name": "DeepSeek: DeepSeek V3.2 Exp", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.27, + "output": 0.41, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 163840, + "maxTokens": 147456 + }, + { + "id": "deepseek/deepseek-v4-flash", + "name": "DeepSeek: DeepSeek V4 Flash 0423", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": "xhigh", + "off": "none", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.091, + "output": 0.182, + "cacheRead": 0.0182, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 943717 + }, + { + "id": "deepseek/deepseek-v4-flash-0731", + "name": "DeepSeek: DeepSeek V4 Flash 0731", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "off": "none", + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.119, + "output": 0.238, + "cacheRead": 0.0238, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 943718 + }, + { + "id": "deepseek/deepseek-v4-flash-vision-exp", + "name": "DeepSeek: DeepSeek V4 Flash Vision Exp", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "off": "none", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.21559999999999999, + "output": 0.6468, + "cacheRead": 0.00686, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 262144 + }, + { + "id": "deepseek/deepseek-v4-pro", + "name": "DeepSeek: DeepSeek V4 Pro 0423", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": "xhigh", + "off": "none", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.9552599999999999, + "output": 1.9105199999999998, + "cacheRead": 0.07960500000000001, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 384000 + }, + { + "id": "deepseek/deepseek-v4-pro-0813", + "name": "DeepSeek: DeepSeek V4 Pro 0813", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "off": "none", + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.66, + "output": 1.9800000000000002, + "cacheRead": 0.022, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 393216 + }, + { + "id": "deepseek/deepseek-v4.1-flash", + "name": "DeepSeek: DeepSeek V4.1 Flash", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "off": "none", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.045, + "output": 0.5, + "cacheRead": 0.006, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 943718 + }, + { + "id": "deepseek/deepseek-v4.1-flash-1017", + "name": "DeepSeek: DeepSeek V4.1 Flash 1017", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "off": "none", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0.003, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 393216 + }, + { + "id": "deepseek/deepseek-v4.1-flash:batch", + "name": "DeepSeek: DeepSeek V4.1 Flash (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "off": "none", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.049999999999999996, + "output": 0.15, + "cacheRead": 0.004, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 384000 + }, + { + "id": "dots-studio/dots-3-note-preview:free", + "name": "Dots Studio: Dots3-Note Preview (free)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 512000, + "maxTokens": 460800 + }, + { + "id": "elorian/glimpse", + "name": "Elorian: Glimpse", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.6, + "output": 3, + "cacheRead": 0.06, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 256000 + }, + { + "id": "fireworks/ember-1", + "name": "Fireworks: Ember-1", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 943718 + }, + { + "id": "google/gemini-2.5-flash", + "name": "Google: Gemini 2.5 Flash", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 2.5, + "cacheRead": 0.03, + "cacheWrite": 0.0833333333333333 + }, + "contextWindow": 1048576, + "maxTokens": 65535 + }, + { + "id": "google/gemini-2.5-flash-lite", + "name": "Google: Gemini 2.5 Flash Lite", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.39999999999999997, + "cacheRead": 0.01, + "cacheWrite": 0.0833333333333333 + }, + "contextWindow": 1048576, + "maxTokens": 65535 + }, + { + "id": "google/gemini-2.5-pro", + "name": "Google: Gemini 2.5 Pro", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.125, + "cacheWrite": 0.375 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "google/gemini-2.5-pro-preview", + "name": "Google: Gemini 2.5 Pro Preview 06-05", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.125, + "cacheWrite": 0.375 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "google/gemini-3-flash-preview", + "name": "Google: Gemini 3 Flash Preview", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.5, + "output": 3, + "cacheRead": 0.049999999999999996, + "cacheWrite": 0.0833333333333333 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "google/gemini-3-flash-preview:batch", + "name": "Google: Gemini 3 Flash Preview (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 1.5, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "google/gemini-3-pro-image", + "name": "Google: Nano Banana Pro (Gemini 3 Pro Image)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 12, + "cacheRead": 0.19999999999999998, + "cacheWrite": 0.375 + }, + "contextWindow": 131072, + "maxTokens": 32768 + }, + { + "id": "google/gemini-3.1-flash-lite", + "name": "Google: Gemini 3.1 Flash Lite", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 1.5, + "cacheRead": 0.024999999999999998, + "cacheWrite": 0.0833333333333333 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "google/gemini-3.1-flash-lite-preview", + "name": "Google: Gemini 3.1 Flash Lite Preview", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 1.5, + "cacheRead": 0.024999999999999998, + "cacheWrite": 0.0833333333333333 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "google/gemini-3.1-flash-lite:batch", + "name": "Google: Gemini 3.1 Flash Lite (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.125, + "output": 0.75, + "cacheRead": 0.012499999999999999, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "google/gemini-3.1-pro-preview", + "name": "Google: Gemini 3.1 Pro Preview", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 12, + "cacheRead": 0.19999999999999998, + "cacheWrite": 0.375 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "google/gemini-3.1-pro-preview-customtools", + "name": "Google: Gemini 3.1 Pro Preview Custom Tools", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 12, + "cacheRead": 0.19999999999999998, + "cacheWrite": 0.375 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "google/gemini-3.1-pro-preview:batch", + "name": "Google: Gemini 3.1 Pro Preview (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 6, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "google/gemini-3.5-flash", + "name": "Google: Gemini 3.5 Flash", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.5, + "output": 9, + "cacheRead": 0.15, + "cacheWrite": 0.0833333333333333 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "google/gemini-3.5-flash-lite", + "name": "Google: Gemini 3.5 Flash Lite", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 2.5, + "cacheRead": 0.03, + "cacheWrite": 0.0833333333333333 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "google/gemini-3.5-flash-lite:batch", + "name": "Google: Gemini 3.5 Flash Lite (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 1.25, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "google/gemini-3.5-flash:batch", + "name": "Google: Gemini 3.5 Flash (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 4.5, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "google/gemini-3.6-flash", + "name": "Google: Gemini 3.6 Flash", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 3.75, + "cacheRead": 0.075, + "cacheWrite": 0.0416666666666667 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "google/gemini-3.6-flash:batch", + "name": "Google: Gemini 3.6 Flash (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.375, + "output": 1.875, + "cacheRead": 0.0375, + "cacheWrite": 0.0416666666666667 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "google/gemini-3.7-flash", + "name": "Google: Gemini 3.7 Flash", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 3.75, + "cacheRead": 0.075, + "cacheWrite": 0.0416666666666667 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "google/gemini-3.7-flash:batch", + "name": "Google: Gemini 3.7 Flash (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.375, + "output": 1.875, + "cacheRead": 0.0375, + "cacheWrite": 0.0416666666666667 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "google/gemini-3.8-flash", + "name": "Google: Gemini 3.8 Flash", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.8250000000000001, + "output": 4.125, + "cacheRead": 0.0825, + "cacheWrite": 0.0416666666666667 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "google/gemini-3.8-flash:batch", + "name": "Google: Gemini 3.8 Flash (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.375, + "output": 1.875, + "cacheRead": 0.0375, + "cacheWrite": 0.0416666666666667 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "google/gemini-4-argon", + "name": "Google: Gemini 4 Argon", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.09999999999999999, + "cacheWrite": 0.1875 + }, + "contextWindow": 1048576, + "maxTokens": 943718 + }, + { + "id": "google/gemini-4-argon:batch", + "name": "Google: Gemini 4 Argon (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.049999999999999996, + "cacheWrite": 0.1875 + }, + "contextWindow": 1048576, + "maxTokens": 943718 + }, + { + "id": "google/gemini-nano-banana-2.1", + "name": "Google: Nano Banana 2.1", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.5, + "output": 7.5, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 65536, + "maxTokens": 58982 + }, + { + "id": "google/gemma-3-12b-it", + "name": "Google: Gemma 3 12B", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.049999999999999996, + "output": 0.15, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 16384 + }, + { + "id": "google/gemma-3-27b-it", + "name": "Google: Gemma 3 27B", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.08, + "output": 0.35, + "cacheRead": 0.04, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 117964 + }, + { + "id": "google/gemma-4-26b-a4b-it", + "name": "Google: Gemma 4 26B A4B ", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.09, + "output": 0.3, + "cacheRead": 0.049999999999999996, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 235929 + }, + { + "id": "google/gemma-4-26b-a4b-it:free", + "name": "Google: Gemma 4 26B A4B (free)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "google/gemma-4-31b-it", + "name": "Google: Gemma 4 31B", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.19999999999999998, + "output": 0.39999999999999997, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 16384 + }, + { + "id": "google/gemma-4-31b-it:free", + "name": "Google: Gemma 4 31B (free)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "ibm-granite/granite-4.2-8b", + "name": "IBM: Granite 4.2 8B", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.06, + "output": 0.15, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 117964 + }, + { + "id": "inception/mercury-2", + "name": "Inception: Mercury 2", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.25, + "output": 0.75, + "cacheRead": 0.024999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 50000 + }, + { + "id": "inception/mercury-2.5", + "name": "Inception: Mercury 2.5", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.04, + "output": 0.15, + "cacheRead": 0.004, + "cacheWrite": 0 + }, + "contextWindow": 260000, + "maxTokens": 65536 + }, + { + "id": "inception/mercury-3", + "name": "Inception: Mercury 3", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.35, + "cacheRead": 0.01, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "inclusionai/ling-3.0-flash", + "name": "inclusionAI: Ling 3.0 Flash", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.020999999999999998, + "output": 0.063, + "cacheRead": 0.004200000000000001, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "inclusionai/ling-3.0-flash-vl", + "name": "inclusionAI: Ling 3.0 Flash VL", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.06, + "output": 0.18, + "cacheRead": 0.012, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 32768 + }, + { + "id": "inclusionai/ling-3.1-flash", + "name": "inclusionAI: Ling 3.1 Flash", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.075, + "output": 0.22499999999999998, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 262144 + }, + { + "id": "liquid/lfm-2.5-2.6b", + "name": "LiquidAI: LFM2.5-2.6B", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.35, + "output": 0.5, + "cacheRead": 0.04, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 8192 + }, + { + "id": "liquid/lfm-2.5-2.6b:free", + "name": "LiquidAI: LFM2.5-2.6B (free)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 65536, + "maxTokens": 8192 + }, + { + "id": "liquid/lfm-2.5-24b-a2b", + "name": "LiquidAI: LFM2.5-24B-A2B", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.049999999999999996, + "output": 0.7, + "cacheRead": 0.024999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 8192 + }, + { + "id": "meituan/longcat-2.0", + "name": "Meituan: LongCat 2.0", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.006, + "cacheWrite": 0 + }, + "contextWindow": 1048756, + "maxTokens": 262144 + }, + { + "id": "meta-llama/llama-3.1-70b-instruct", + "name": "Meta: Llama 3.1 70B Instruct", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.39999999999999997, + "output": 0.39999999999999997, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 16384 + }, + { + "id": "meta-llama/llama-3.1-8b-instruct", + "name": "Meta: Llama 3.1 8B Instruct", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.049999999999999996, + "output": 0.08, + "cacheRead": 0.024999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 117964 + }, + { + "id": "meta-llama/llama-3.3-70b-instruct", + "name": "Meta: Llama 3.3 70B Instruct", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.32, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 16384 + }, + { + "id": "meta-llama/llama-4-maverick", + "name": "Meta: Llama 4 Maverick", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1875, + "output": 0.6525, + "cacheRead": 0.049999999999999996, + "cacheWrite": 0 + }, + "contextWindow": 524288, + "maxTokens": 16384 + }, + { + "id": "meta-llama/llama-4-scout", + "name": "Meta: Llama 4 Scout", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.3, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1310720, + "maxTokens": 16384 + }, + { + "id": "meta/muse-glimmer-30b", + "name": "Meta: Muse Glimmer 30B", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.04, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 16384 + }, + { + "id": "meta/muse-spark-1.1", + "name": "Meta: Muse Spark 1.1", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 4.25, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 943718 + }, + { + "id": "meta/muse-spark-1.2", + "name": "Meta: Muse Spark 1.2", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 4.25, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 943718 + }, + { + "id": "meta/muse-spark-1.2-contributor", + "name": "Meta: Muse Spark 1.2 Contributor", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.19999999999999998, + "cacheRead": 0.002, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 943718 + }, + { + "id": "meta/muse-spark-1.3", + "name": "Meta: Muse Spark 1.3", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 4.25, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 943718 + }, + { + "id": "meta/muse-spark-1.3-contributor", + "name": "Meta: Muse Spark 1.3 Contributor", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.19999999999999998, + "cacheRead": 0.002, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 943718 + }, + { + "id": "meta/muse-spark-open", + "name": "Meta: Muse Spark Open", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 4.25, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "meta/muse-wonder", + "name": "Meta: Muse Wonder", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.19999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 943718 + }, + { + "id": "minimax/minimax-m1", + "name": "MiniMax: MiniMax M1", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.55, + "output": 2.2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 40000 + }, + { + "id": "minimax/minimax-m2", + "name": "MiniMax: MiniMax M2", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.255, + "output": 1.02, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 204800, + "maxTokens": 131072 + }, + { + "id": "minimax/minimax-m2.1", + "name": "MiniMax: MiniMax M2.1", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 204800, + "maxTokens": 131072 + }, + { + "id": "minimax/minimax-m2.5", + "name": "MiniMax: MiniMax M2.5", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 204800, + "maxTokens": 131072 + }, + { + "id": "minimax/minimax-m2.7", + "name": "MiniMax: MiniMax M2.7", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.06, + "cacheWrite": 0 + }, + "contextWindow": 204800, + "maxTokens": 131072 + }, + { + "id": "minimax/minimax-m3", + "name": "MiniMax: MiniMax M3", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.06, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 512000 + }, + { + "id": "minimax/minimax-m3.1-flash", + "name": "MiniMax: MiniMax M3.1 Flash", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 524288 + }, + { + "id": "mistralai/codestral-2508", + "name": "Mistral: Codestral 2508", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 0.8999999999999999, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 204800 + }, + { + "id": "mistralai/devstral-2512", + "name": "Mistral: Devstral 2 2512", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.39999999999999997, + "output": 2, + "cacheRead": 0.04, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 209715 + }, + { + "id": "mistralai/ministral-14b-2512", + "name": "Mistral: Ministral 3 14B 2512", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.19999999999999998, + "output": 0.19999999999999998, + "cacheRead": 0.02, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 209715 + }, + { + "id": "mistralai/ministral-3b-2512", + "name": "Mistral: Ministral 3 3B 2512", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.09999999999999999, + "cacheRead": 0.01, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 104857 + }, + { + "id": "mistralai/ministral-8b-2512", + "name": "Mistral: Ministral 3 8B 2512", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.15, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 209715 + }, + { + "id": "mistralai/mistral-large", + "name": "Mistral Large", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.19999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 102400 + }, + { + "id": "mistralai/mistral-large-2407", + "name": "Mistral Large 2407", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.19999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 104857 + }, + { + "id": "mistralai/mistral-large-2512", + "name": "Mistral: Mistral Large 3 2512", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.5, + "output": 1.5, + "cacheRead": 0.049999999999999996, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 209715 + }, + { + "id": "mistralai/mistral-large-4-0", + "name": "Mistral: Mistral Large 4", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.3599999999999999, + "output": 4.18, + "cacheRead": 0.14, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 262144 + }, + { + "id": "mistralai/mistral-medium-3", + "name": "Mistral: Mistral Medium 3", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.39999999999999997, + "output": 2, + "cacheRead": 0.04, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 104857 + }, + { + "id": "mistralai/mistral-medium-3-5", + "name": "Mistral: Mistral Medium 3.5", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.5, + "output": 7.5, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 209715 + }, + { + "id": "mistralai/mistral-medium-3-5:batch", + "name": "Mistral: Mistral Medium 3.5 (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 3.75, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 209715 + }, + { + "id": "mistralai/mistral-medium-3.1", + "name": "Mistral: Mistral Medium 3.1", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.39999999999999997, + "output": 2, + "cacheRead": 0.04, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 104857 + }, + { + "id": "mistralai/mistral-nemo", + "name": "Mistral: Mistral Nemo", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.029, + "output": 0.03, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 16384 + }, + { + "id": "mistralai/mistral-saba", + "name": "Mistral: Saba", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.19999999999999998, + "output": 0.6, + "cacheRead": 0.02, + "cacheWrite": 0 + }, + "contextWindow": 32768, + "maxTokens": 26214 + }, + { + "id": "mistralai/mistral-small-2603", + "name": "Mistral: Mistral Small 4", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 209715 + }, + { + "id": "mistralai/mistral-small-3.1-24b-instruct", + "name": "Mistral: Mistral Small 3.1 24B", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.351, + "output": 0.5549999999999999, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 102400 + }, + { + "id": "mistralai/mistral-small-3.2-24b-instruct", + "name": "Mistral: Mistral Small 3.2 24B", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.075, + "output": 0.19999999999999998, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 16384 + }, + { + "id": "mistralai/mixtral-8x22b-instruct", + "name": "Mistral: Mixtral 8x22B Instruct", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.19999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 65536, + "maxTokens": 52428 + }, + { + "id": "mistralai/voxtral-small-24b-2507", + "name": "Mistral: Voxtral Small 24B 2507", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.3, + "cacheRead": 0.01, + "cacheWrite": 0 + }, + "contextWindow": 32768, + "maxTokens": 26214 + }, + { + "id": "moonshotai/kimi-k2", + "name": "MoonshotAI: Kimi K2 0711", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.5700000000000001, + "output": 2.3, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 98304 + }, + { + "id": "moonshotai/kimi-k2-0905", + "name": "MoonshotAI: Kimi K2 0905", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.6, + "output": 2.5, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 98304 + }, + { + "id": "moonshotai/kimi-k2-thinking", + "name": "MoonshotAI: Kimi K2 Thinking", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.6, + "output": 2.5, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 98304 + }, + { + "id": "moonshotai/kimi-k2.5", + "name": "MoonshotAI: Kimi K2.5", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.41, + "output": 2.06, + "cacheRead": 0.07, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 4096 + }, + { + "id": "moonshotai/kimi-k2.6", + "name": "MoonshotAI: Kimi K2.6", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "compat": { + "supportsDeveloperRole": false, + "requiresReasoningContentOnAssistantMessages": true + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.65, + "output": 3.41, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 235929 + }, + { + "id": "moonshotai/kimi-k2.7-code", + "name": "MoonshotAI: Kimi K2.7 Code", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.56, + "output": 3.1, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 235929 + }, + { + "id": "moonshotai/kimi-k3", + "name": "MoonshotAI: Kimi K3", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.23900000000000002, + "output": 10.8, + "cacheRead": 0.21, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 943718 + }, + { + "id": "moonshotai/kimi-k3.1-pro", + "name": "MoonshotAI: Kimi K3.1 Pro", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.19999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 943718 + }, + { + "id": "moonshotai/kimi-k3:batch", + "name": "MoonshotAI: Kimi K3 (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.2800000000000002, + "output": 11.399999999999999, + "cacheRead": 0.228, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 16384 + }, + { + "id": "nex-agi/nex-n2.5-pro", + "name": "Nex AGI: Nex-N2.5-Pro", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": null, + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.075, + "output": 0.25, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 235929 + }, + { + "id": "nvidia/nemotron-3-nano-30b-a3b", + "name": "NVIDIA: Nemotron 3 Nano 30B A3B", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.06, + "output": 0.24, + "cacheRead": 0.012, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 235929 + }, + { + "id": "nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free", + "name": "NVIDIA: Nemotron 3 Nano Omni (free)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 65536 + }, + { + "id": "nvidia/nemotron-3-super-120b-a12b", + "name": "NVIDIA: Nemotron 3 Super", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 2.4, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 262144 + }, + { + "id": "nvidia/nemotron-3-ultra-550b-a55b", + "name": "NVIDIA: Nemotron 3 Ultra", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": null, + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.6, + "output": 2.4, + "cacheRead": 0.12, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 182520 + }, + { + "id": "nvidia/nemotron-3-ultra-550b-a55b:free", + "name": "NVIDIA: Nemotron 3 Ultra (free)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": null, + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 65536 + }, + { + "id": "nvidia/nemotron-3.5-lightning", + "name": "NVIDIA: Nemotron 3.5 Lightning", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.07, + "output": 0.19999999999999998, + "cacheRead": 0.04, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 235929 + }, + { + "id": "nvidia/nemotron-3.5-lightning:free", + "name": "NVIDIA: Nemotron 3.5 Lightning (free)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 65536 + }, + { + "id": "nvidia/nemotron-3.5-super-vl", + "name": "NVIDIA: Nemotron 3.5 Super VL", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.5, + "cacheRead": 0.02, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 235929 + }, + { + "id": "nvidia/nemotron-3.5-super-vl:free", + "name": "NVIDIA: Nemotron 3.5 Super VL (free)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "openai/gpt-3.5-turbo-0613", + "name": "OpenAI: GPT-3.5 Turbo (older v0613)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 1, + "output": 2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 4095, + "maxTokens": 3685 + }, + { + "id": "openai/gpt-3.5-turbo-16k", + "name": "OpenAI: GPT-3.5 Turbo 16k", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 3, + "output": 4, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 16385, + "maxTokens": 4096 + }, + { + "id": "openai/gpt-4", + "name": "OpenAI: GPT-4", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 30, + "output": 60, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 8191, + "maxTokens": 4096 + }, + { + "id": "openai/gpt-4-turbo:batch", + "name": "OpenAI: GPT-4 Turbo (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 15, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 4096 + }, + { + "id": "openai/gpt-4.1", + "name": "OpenAI: GPT-4.1", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 8, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 1047576, + "maxTokens": 32768 + }, + { + "id": "openai/gpt-4.1-mini", + "name": "OpenAI: GPT-4.1 Mini", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.39999999999999997, + "output": 1.5999999999999999, + "cacheRead": 0.09999999999999999, + "cacheWrite": 0 + }, + "contextWindow": 1047576, + "maxTokens": 32768 + }, + { + "id": "openai/gpt-4.1-mini:batch", + "name": "OpenAI: GPT-4.1 Mini (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.19999999999999998, + "output": 0.7999999999999999, + "cacheRead": 0.049999999999999996, + "cacheWrite": 0 + }, + "contextWindow": 1047576, + "maxTokens": 32768 + }, + { + "id": "openai/gpt-4.1-nano", + "name": "OpenAI: GPT-4.1 Nano", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.39999999999999997, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 1047576, + "maxTokens": 32768 + }, + { + "id": "openai/gpt-4.1-nano:batch", + "name": "OpenAI: GPT-4.1 Nano (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.049999999999999996, + "output": 0.19999999999999998, + "cacheRead": 0.012499999999999999, + "cacheWrite": 0 + }, + "contextWindow": 1047576, + "maxTokens": 32768 + }, + { + "id": "openai/gpt-4.1:batch", + "name": "OpenAI: GPT-4.1 (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 4, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 1047576, + "maxTokens": 32768 + }, + { + "id": "openai/gpt-4o", + "name": "OpenAI: GPT-4o", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 10, + "cacheRead": 1.25, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "openai/gpt-4o-2024-05-13", + "name": "OpenAI: GPT-4o (2024-05-13)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 15, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 4096 + }, + { + "id": "openai/gpt-4o-2024-08-06", + "name": "OpenAI: GPT-4o (2024-08-06)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 10, + "cacheRead": 1.25, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "openai/gpt-4o-2024-11-20", + "name": "OpenAI: GPT-4o (2024-11-20)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 10, + "cacheRead": 1.25, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "openai/gpt-4o-mini", + "name": "OpenAI: GPT-4o-mini", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "openai/gpt-4o-mini-2024-07-18", + "name": "OpenAI: GPT-4o-mini (2024-07-18)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "openai/gpt-4o-mini:batch", + "name": "OpenAI: GPT-4o-mini (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.075, + "output": 0.3, + "cacheRead": 0.0375, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "openai/gpt-4o:batch", + "name": "OpenAI: GPT-4o (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 5, + "cacheRead": 0.625, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "openai/gpt-5", + "name": "OpenAI: GPT-5", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.125, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5-mini", + "name": "OpenAI: GPT-5 Mini", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 2, + "cacheRead": 0.024999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5-mini:batch", + "name": "OpenAI: GPT-5 Mini (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.125, + "output": 1, + "cacheRead": 0.012499999999999999, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5-nano", + "name": "OpenAI: GPT-5 Nano", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.049999999999999996, + "output": 0.39999999999999997, + "cacheRead": 0.005, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5-nano:batch", + "name": "OpenAI: GPT-5 Nano (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.024999999999999998, + "output": 0.19999999999999998, + "cacheRead": 0.0025, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5-pro", + "name": "OpenAI: GPT-5 Pro", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 15, + "output": 120, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5-pro:batch", + "name": "OpenAI: GPT-5 Pro (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 7.5, + "output": 60, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.1", + "name": "OpenAI: GPT-5.1", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.125, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.1-codex", + "name": "OpenAI: GPT-5.1-Codex", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.13, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.1-codex-max", + "name": "OpenAI: GPT-5.1-Codex-Max", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.125, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.1-codex-mini", + "name": "OpenAI: GPT-5.1-Codex-Mini", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 2, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.1:batch", + "name": "OpenAI: GPT-5.1 (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.625, + "output": 5, + "cacheRead": 0.0625, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.2", + "name": "OpenAI: GPT-5.2", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.75, + "output": 14, + "cacheRead": 0.175, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.2-chat", + "name": "OpenAI: GPT-5.2 Chat", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.75, + "output": 14, + "cacheRead": 0.175, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 32000 + }, + { + "id": "openai/gpt-5.2-codex", + "name": "OpenAI: GPT-5.2-Codex", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.75, + "output": 14, + "cacheRead": 0.175, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.2-pro", + "name": "OpenAI: GPT-5.2 Pro", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": "high", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 21, + "output": 168, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.2-pro:batch", + "name": "OpenAI: GPT-5.2 Pro (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": "high", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10.5, + "output": 84, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.2:batch", + "name": "OpenAI: GPT-5.2 (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.875, + "output": 7, + "cacheRead": 0.0875, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.3-codex", + "name": "OpenAI: GPT-5.3-Codex", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.75, + "output": 14, + "cacheRead": 0.175, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.4", + "name": "OpenAI: GPT-5.4", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 15, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.4-mini", + "name": "OpenAI: GPT-5.4 Mini", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 4.5, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.4-mini:batch", + "name": "OpenAI: GPT-5.4 Mini (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.375, + "output": 2.25, + "cacheRead": 0.0375, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.4-nano", + "name": "OpenAI: GPT-5.4 Nano", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.19999999999999998, + "output": 1.25, + "cacheRead": 0.02, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.4-nano:batch", + "name": "OpenAI: GPT-5.4 Nano (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.625, + "cacheRead": 0.01, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.4-pro", + "name": "OpenAI: GPT-5.4 Pro", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": "high", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 30, + "output": 180, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.4-pro:batch", + "name": "OpenAI: GPT-5.4 Pro (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": "high", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 15, + "output": 90, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.4:batch", + "name": "OpenAI: GPT-5.4 (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 7.5, + "cacheRead": 0.125, + "cacheWrite": 0 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.5", + "name": "OpenAI: GPT-5.5", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 30, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.5-pro", + "name": "OpenAI: GPT-5.5 Pro", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": "high", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 30, + "output": 180, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.5-pro:batch", + "name": "OpenAI: GPT-5.5 Pro (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": "high", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 15, + "output": 90, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.5:batch", + "name": "OpenAI: GPT-5.5 (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 15, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.6-luna", + "name": "OpenAI: GPT-5.6 Luna", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max", + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.19999999999999998, + "output": 1.2, + "cacheRead": 0.02, + "cacheWrite": 0.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.6-luna-pro", + "name": "OpenAI: GPT-5.6 Luna Pro", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max", + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.19999999999999998, + "output": 1.2, + "cacheRead": 0.02, + "cacheWrite": 0.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.6-luna-pro:batch", + "name": "OpenAI: GPT-5.6 Luna Pro (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max", + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.6, + "cacheRead": 0.01, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.6-luna:batch", + "name": "OpenAI: GPT-5.6 Luna (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max", + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.6, + "cacheRead": 0.01, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.6-sol", + "name": "OpenAI: GPT-5.6 Sol", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max", + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.39999999999999997, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.6-sol-pro", + "name": "OpenAI: GPT-5.6 Sol Pro", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max", + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.39999999999999997, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.6-sol-pro:batch", + "name": "OpenAI: GPT-5.6 Sol Pro (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max", + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.19999999999999998, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.6-sol:batch", + "name": "OpenAI: GPT-5.6 Sol (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max", + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.19999999999999998, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.6-terra", + "name": "OpenAI: GPT-5.6 Terra", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max", + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 12, + "cacheRead": 0.19999999999999998, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.6-terra-pro", + "name": "OpenAI: GPT-5.6 Terra Pro", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max", + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 12, + "cacheRead": 0.19999999999999998, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.6-terra-pro:batch", + "name": "OpenAI: GPT-5.6 Terra Pro (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max", + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 6, + "cacheRead": 0.09999999999999999, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.6-terra:batch", + "name": "OpenAI: GPT-5.6 Terra (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max", + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 6, + "cacheRead": 0.09999999999999999, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5:batch", + "name": "OpenAI: GPT-5 (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.625, + "output": 5, + "cacheRead": 0.0625, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6-astra", + "name": "OpenAI: GPT-6 Astra", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6-astra-pro", + "name": "OpenAI: GPT-6 Astra Pro", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6-astra-pro:batch", + "name": "OpenAI: GPT-6 Astra Pro (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6-astra:batch", + "name": "OpenAI: GPT-6 Astra (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6-luna", + "name": "OpenAI: GPT-6 Luna", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.5, + "cacheRead": 0.01, + "cacheWrite": 0.125 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6-luna-pro", + "name": "OpenAI: GPT-6 Luna Pro", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.5, + "cacheRead": 0.01, + "cacheWrite": 0.125 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6-luna-pro:batch", + "name": "OpenAI: GPT-6 Luna Pro (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.049999999999999996, + "output": 0.25, + "cacheRead": 0.005, + "cacheWrite": 0.0625 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6-luna:batch", + "name": "OpenAI: GPT-6 Luna (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.049999999999999996, + "output": 0.25, + "cacheRead": 0.005, + "cacheWrite": 0.0625 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6-sol", + "name": "OpenAI: GPT-6 Sol", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.19999999999999998, + "cacheWrite": 2.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6-sol-pro", + "name": "OpenAI: GPT-6 Sol Pro", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.19999999999999998, + "cacheWrite": 2.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6-sol-pro:batch", + "name": "OpenAI: GPT-6 Sol Pro (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.09999999999999999, + "cacheWrite": 1.25 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6-sol:batch", + "name": "OpenAI: GPT-6 Sol (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.09999999999999999, + "cacheWrite": 1.25 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6.1-sol", + "name": "OpenAI: GPT-6.1 Sol", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.09999999999999999, + "cacheWrite": 2.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6.1-sol-pro", + "name": "OpenAI: GPT-6.1 Sol Pro", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.09999999999999999, + "cacheWrite": 2.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6.1-sol-pro:batch", + "name": "OpenAI: GPT-6.1 Sol Pro (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.049999999999999996, + "cacheWrite": 1.25 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6.1-sol:batch", + "name": "OpenAI: GPT-6.1 Sol (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.049999999999999996, + "cacheWrite": 1.25 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6.1-terra", + "name": "OpenAI: GPT-6.1 Terra", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.049999999999999996, + "cacheWrite": 1.25 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6.1-terra-pro", + "name": "OpenAI: GPT-6.1 Terra Pro", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.049999999999999996, + "cacheWrite": 1.25 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6.1-terra-pro:batch", + "name": "OpenAI: GPT-6.1 Terra Pro (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.5, + "output": 2.5, + "cacheRead": 0.024999999999999998, + "cacheWrite": 0.625 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-audio", + "name": "OpenAI: GPT Audio", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 2.5, + "output": 10, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "openai/gpt-audio-mini", + "name": "OpenAI: GPT Audio Mini", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.6, + "output": 2.4, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "openai/gpt-chat-latest", + "name": "OpenAI: GPT Chat Latest", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 30, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-oss-120b", + "name": "OpenAI: gpt-oss-120b", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 65536 + }, + { + "id": "openai/gpt-oss-120b:batch", + "name": "OpenAI: gpt-oss-120b (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.0296, + "output": 0.136, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 117964 + }, + { + "id": "openai/gpt-oss-20b", + "name": "OpenAI: gpt-oss-20b", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.018, + "output": 0.09, + "cacheRead": 0.009, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 32768 + }, + { + "id": "openai/gpt-oss-20b:batch", + "name": "OpenAI: gpt-oss-20b (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.024, + "output": 0.112, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 117964 + }, + { + "id": "openai/gpt-oss-safeguard-20b", + "name": "OpenAI: gpt-oss-safeguard-20b", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.075, + "output": 0.3, + "cacheRead": 0.0375, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 65536 + }, + { + "id": "openai/o3", + "name": "OpenAI: o3", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 8, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "openai/o3-mini:batch", + "name": "OpenAI: o3 Mini (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.55, + "output": 2.2, + "cacheRead": 0.275, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "openai/o3-pro", + "name": "OpenAI: o3 Pro", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 20, + "output": 80, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "openai/o3:batch", + "name": "OpenAI: o3 (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 4, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "openai/o4-mini:batch", + "name": "OpenAI: o4 Mini (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.55, + "output": 2.2, + "cacheRead": 0.1375, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "openrouter/auto", + "name": "Auto Router", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 2000000, + "maxTokens": 4096 + }, + { + "id": "openrouter/auto-beta", + "name": "Auto Router (Beta)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 2000000, + "maxTokens": 4096 + }, + { + "id": "openrouter/free", + "name": "Free Models Router", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 4096 + }, + { + "id": "openrouter/pareto-code", + "name": "Pareto Code Router", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 2000000, + "maxTokens": 4096 + }, + { + "id": "particle-ai/particle-1", + "name": "Particle AI: Particle-1", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 1, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "perceptron/perceptron-mk1.5", + "name": "Perceptron: Perceptron Mk1.5", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 1.5, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 36864, + "maxTokens": 8192 + }, + { + "id": "poolside/laguna-s-2.1", + "name": "Poolside: Laguna S 2.1", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.09, + "output": 0.18, + "cacheRead": 0.009, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "poolside/laguna-s-2.1:free", + "name": "Poolside: Laguna S 2.1 (free)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "poolside/laguna-xs-2.1", + "name": "Poolside: Laguna XS 2.1", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.06, + "output": 0.12, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "poolside/laguna-xs-2.1:free", + "name": "Poolside: Laguna XS 2.1 (free)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "prism-ml/ternary-bonsai-2-27b", + "name": "PrismML: Ternary Bonsai 2 27B", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.075, + "output": 0.5, + "cacheRead": 0.0375, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "prism-ml/ternary-bonsai-2-9b", + "name": "PrismML: Ternary Bonsai 2 9B", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.08, + "output": 0.13, + "cacheRead": 0.04, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "qwen/qwen-2.5-72b-instruct", + "name": "Qwen2.5 72B Instruct", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.36, + "output": 0.39999999999999997, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 32768, + "maxTokens": 16384 + }, + { + "id": "qwen/qwen-2.5-7b-instruct", + "name": "Qwen: Qwen2.5 7B Instruct", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.19999999999999998, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 32768, + "maxTokens": 29491 + }, + { + "id": "qwen/qwen-plus", + "name": "Qwen: Qwen-Plus", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.26, + "output": 0.78, + "cacheRead": 0.052000000000000005, + "cacheWrite": 0.325 + }, + "contextWindow": 1000000, + "maxTokens": 32768 + }, + { + "id": "qwen/qwen3-14b", + "name": "Qwen: Qwen3 14B", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 0.12, + "output": 0.24, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 40960, + "maxTokens": 16384 + }, + { + "id": "qwen/qwen3-235b-a22b-2507", + "name": "Qwen: Qwen3 235B A22B Instruct 2507", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.09, + "output": 0.55, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 16384 + }, + { + "id": "qwen/qwen3-235b-a22b-thinking-2507", + "name": "Qwen: Qwen3 235B A22B Thinking 2507", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max", + "off": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.44999999999999996, + "output": 3.5, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "qwen/qwen3-30b-a3b", + "name": "Qwen: Qwen3 30B A3B", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 0.12, + "output": 0.5, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 40960, + "maxTokens": 16384 + }, + { + "id": "qwen/qwen3-30b-a3b-instruct-2507", + "name": "Qwen: Qwen3 30B A3B Instruct 2507", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.3, + "cacheRead": 0.09999999999999999, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 235929 + }, + { + "id": "qwen/qwen3-32b", + "name": "Qwen: Qwen3 32B", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 0.08, + "output": 0.28, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 16384 + }, + { + "id": "qwen/qwen3-coder", + "name": "Qwen: Qwen3 Coder 480B A35B", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 1, + "cacheRead": 0.09999999999999999, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "qwen/qwen3-coder-30b-a3b-instruct", + "name": "Qwen: Qwen3 Coder 30B A3B Instruct", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.07, + "output": 0.28, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 235929 + }, + { + "id": "qwen/qwen3-coder-flash", + "name": "Qwen: Qwen3 Coder Flash", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.195, + "output": 0.975, + "cacheRead": 0.039, + "cacheWrite": 0.24375 + }, + "contextWindow": 1000000, + "maxTokens": 65536 + }, + { + "id": "qwen/qwen3-coder-next", + "name": "Qwen: Qwen3 Coder Next", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.12, + "output": 0.7999999999999999, + "cacheRead": 0.07, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 235929 + }, + { + "id": "qwen/qwen3-next-80b-a3b-instruct", + "name": "Qwen: Qwen3 Next 80B A3B Instruct", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.09, + "output": 1.1, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 16384 + }, + { + "id": "qwen/qwen3-vl-235b-a22b-instruct", + "name": "Qwen: Qwen3 VL 235B A22B Instruct", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.21, + "output": 1.9, + "cacheRead": 0.09999999999999999, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "qwen/qwen3-vl-30b-a3b-instruct", + "name": "Qwen: Qwen3 VL 30B A3B Instruct", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 16384 + }, + { + "id": "qwen/qwen3-vl-30b-a3b-thinking", + "name": "Qwen: Qwen3 VL 30B A3B Thinking", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max", + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.29, + "output": 1, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 235929 + }, + { + "id": "qwen/qwen3-vl-8b-instruct", + "name": "Qwen: Qwen3 VL 8B Instruct", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 0.75, + "cacheRead": 0.12, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 235929 + }, + { + "id": "qwen/qwen3.5-122b-a10b", + "name": "Qwen: Qwen3.5-122B-A10B", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.26, + "output": 2.08, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "qwen/qwen3.5-27b", + "name": "Qwen: Qwen3.5-27B", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.26, + "output": 2.6, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 81920 + }, + { + "id": "qwen/qwen3.5-35b-a3b", + "name": "Qwen: Qwen3.5-35B-A3B", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.14, + "output": 1, + "cacheRead": 0.049999999999999996, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 81920 + }, + { + "id": "qwen/qwen3.5-397b-a17b", + "name": "Qwen: Qwen3.5 397B A17B", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.5, + "output": 3.5999999999999996, + "cacheRead": 0.3, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 235929 + }, + { + "id": "qwen/qwen3.5-9b", + "name": "Qwen: Qwen3.5-9B", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.16999999999999998, + "output": 0.25, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 235929 + }, + { + "id": "qwen/qwen3.5-flash-02-23", + "name": "Qwen: Qwen3.5-Flash", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.065, + "output": 0.26, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 65536 + }, + { + "id": "qwen/qwen3.5-plus-02-15", + "name": "Qwen: Qwen3.5 Plus 2026-02-15", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.26, + "output": 1.56, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 65536 + }, + { + "id": "qwen/qwen3.5-plus-20260420", + "name": "Qwen: Qwen3.5 Plus 2026-04-20", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 1.7999999999999998, + "cacheRead": 0, + "cacheWrite": 0.375 + }, + "contextWindow": 1000000, + "maxTokens": 65536 + }, + { + "id": "qwen/qwen3.6-27b", + "name": "Qwen: Qwen3.6 27B", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.44999999999999996, + "output": 2.7, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "qwen/qwen3.6-35b-a3b", + "name": "Qwen: Qwen3.6 35B A3B", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.8999999999999999, + "cacheRead": 0.024999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 235929 + }, + { + "id": "qwen/qwen3.6-flash", + "name": "Qwen: Qwen3.6 Flash", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.1875, + "output": 1.125, + "cacheRead": 0, + "cacheWrite": 0.234375 + }, + "contextWindow": 1000000, + "maxTokens": 65536 + }, + { + "id": "qwen/qwen3.6-plus", + "name": "Qwen: Qwen3.6 Plus", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.325, + "output": 1.95, + "cacheRead": 0, + "cacheWrite": 0.40625 + }, + "contextWindow": 1000000, + "maxTokens": 65536 + }, + { + "id": "qwen/qwen3.7-flash", + "name": "Qwen: Qwen3.7 Flash", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.03, + "output": 0.13, + "cacheRead": 0.006, + "cacheWrite": 0.038000000000000006 + }, + "contextWindow": 1000000, + "maxTokens": 65536 + }, + { + "id": "qwen/qwen3.7-max", + "name": "Qwen: Qwen3.7 Max", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 1.475, + "output": 4.425, + "cacheRead": 0.295, + "cacheWrite": 1.84375 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "qwen/qwen3.7-plus", + "name": "Qwen: Qwen3.7 Plus", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.32, + "output": 1.28, + "cacheRead": 0.064, + "cacheWrite": 0.39999999999999997 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "qwen/qwen3.7-plus:batch", + "name": "Qwen: Qwen3.7 Plus (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.22999999999999998, + "output": 0.9199999999999999, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 131072 + }, + { + "id": "qwen/qwen3.8-2.4t-a95b", + "name": "Qwen: Qwen3.8 2.4T A95B", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": null, + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 909000 + }, + { + "id": "qwen/qwen3.8-27b", + "name": "Qwen: Qwen3.8 27B", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": null, + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.039, + "output": 1.25, + "cacheRead": 0.0039000000000000003, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 65536 + }, + { + "id": "qwen/qwen3.8-flash", + "name": "Qwen: Qwen3.8 Flash", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.47, + "cacheRead": 0.016, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "qwen/qwen3.8-max-0902", + "name": "Qwen: Qwen3.8 Max (0902)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": null, + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "qwen/qwen3.8-max-prime", + "name": "Qwen: Qwen3.8 Max Prime", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": null, + "off": null, + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 12, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "qwen/qwen3.8-omni-flash", + "name": "Qwen: Qwen3.8 Omni Flash", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.47, + "cacheRead": 0.016, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "recursive/flint-v1.0:free", + "name": "Recursive: Flint (free)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 235929 + }, + { + "id": "reflection/beam-1.0-501b-a23b", + "name": "Reflection: Beam 1.0 501B A23B", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.25, + "output": 1, + "cacheRead": 0.049999999999999996, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "rekaai/reka-edge", + "name": "Reka Edge", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.09999999999999999, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 16384, + "maxTokens": 14745 + }, + { + "id": "relace/relace-search", + "name": "Relace: Relace Search", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 1, + "output": 3, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 128000 + }, + { + "id": "sakana/fugu-max", + "name": "Sakana: Fugu Max", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "sakana/fugu-ultra", + "name": "Sakana: Fugu Ultra", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 30, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "sakana/fugu-ultra-v2", + "name": "Sakana: Fugu Ultra v2", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 30, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "sakana/sakana-namazu", + "name": "Sakana: Sakana Namazu", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.95, + "output": 4, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "stepfun/step-3.5-flash", + "name": "StepFun: Step 3.5 Flash", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.3, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "stepfun/step-3.7-flash", + "name": "StepFun: Step 3.7 Flash", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.19999999999999998, + "output": 1.15, + "cacheRead": 0.04, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 230400 + }, + { + "id": "stepfun/step-5-preview", + "name": "StepFun: Step 5 Preview", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 2.7, + "cacheRead": 0.09999999999999999, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "tencent/hy3", + "name": "Tencent: Hy3", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.13199999999999998, + "output": 0.5279999999999999, + "cacheRead": 0.032999999999999995, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 128000 + }, + { + "id": "tencent/hy3-preview", + "name": "Tencent: Hy3 preview", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.18, + "output": 0.6, + "cacheRead": 0.06, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 235929 + }, + { + "id": "tencent/hy4-preview", + "name": "Tencent: Hy4 preview", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.834, + "output": 2.501, + "cacheRead": 0.041999999999999996, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 64000 + }, + { + "id": "thinkingmachines/inkling", + "name": "Thinking Machines: Inkling", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 4.05, + "cacheRead": 0.16999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 524288, + "maxTokens": 471859 + }, + { + "id": "thinkingmachines/inkling-small", + "name": "Thinking Machines: Inkling Small", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.44999999999999996, + "output": 1.2, + "cacheRead": 0.09999999999999999, + "cacheWrite": 0 + }, + "contextWindow": 524288, + "maxTokens": 262144 + }, + { + "id": "thinkingmachines/inkling-small:free", + "name": "Thinking Machines: Inkling Small (free)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 262144 + }, + { + "id": "thinkingmachines/inkling:free", + "name": "Thinking Machines: Inkling (free)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 262144 + }, + { + "id": "typesafe/jev-router", + "name": "TypeSafe: Jev Router", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "unbiased/pareto-26.10", + "name": "Pareto 26.10", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.7999999999999999, + "output": 3.1999999999999997, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "unbiased/pareto-26.9", + "name": "Pareto 26.9", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 7.5, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 131072 + }, + { + "id": "upstage/solar-mini4", + "name": "Upstage: Solar Mini 4", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.049999999999999996, + "output": 0.19999999999999998, + "cacheRead": 0.005, + "cacheWrite": 0 + }, + "contextWindow": 524288, + "maxTokens": 131072 + }, + { + "id": "upstage/solar-pro-3", + "name": "Upstage: Solar Pro 3", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 117964 + }, + { + "id": "upstage/solar-pro4", + "name": "Upstage: Solar Pro 4", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": "minimal", + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 524288, + "maxTokens": 131072 + }, + { + "id": "x-ai/grok-4.20", + "name": "SpaceXAI: Grok 4.20", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 2.5, + "cacheRead": 0.19999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 2000000, + "maxTokens": 1800000 + }, + { + "id": "x-ai/grok-4.3", + "name": "SpaceXAI: Grok 4.3", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 2.5, + "cacheRead": 0.19999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 900000 + }, + { + "id": "x-ai/grok-4.3:batch", + "name": "SpaceXAI: Grok 4.3 (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 2, + "cacheRead": 0.16, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 900000 + }, + { + "id": "x-ai/grok-4.5", + "name": "SpaceXAI: Grok 4.5", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.3, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 450000 + }, + { + "id": "x-ai/grok-4.6", + "name": "SpaceXAI: Grok 4.6", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 450000 + }, + { + "id": "x-ai/grok-4.7", + "name": "SpaceXAI: Grok 4.7", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 450000 + }, + { + "id": "x-ai/grok-build-0.1", + "name": "SpaceXAI: Grok Build 0.1", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 2, + "cacheRead": 0.19999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 230400 + }, + { + "id": "xiaomi/mimo-v2.5", + "name": "Xiaomi: MiMo-V2.5", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.39999999999999997, + "output": 2, + "cacheRead": 0.08, + "cacheWrite": 0 + }, + "contextWindow": 1050000, + "maxTokens": 65536 + }, + { + "id": "xiaomi/mimo-v2.5-pro", + "name": "Xiaomi: MiMo-V2.5-Pro", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.48, + "output": 1.7999999999999998, + "cacheRead": 0.096, + "cacheWrite": 0 + }, + "contextWindow": 1050000, + "maxTokens": 235929 + }, + { + "id": "xiaomi/mimo-v2.6-flash", + "name": "Xiaomi: MiMo-V2.6-Flash", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.14, + "output": 0.28, + "cacheRead": 0.0028, + "cacheWrite": 0 + }, + "contextWindow": 1050000, + "maxTokens": 131072 + }, + { + "id": "xiaomi/mimo-v2.6-pro", + "name": "Xiaomi: MiMo-V2.6-Pro", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.435, + "output": 0.87, + "cacheRead": 0.0036, + "cacheWrite": 0 + }, + "contextWindow": 1050000, + "maxTokens": 131072 + }, + { + "id": "xiaomi/mimo-v2.6-pro-ultraspeed", + "name": "Xiaomi: MiMo-V2.6-Pro-UltraSpeed", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4.35, + "output": 8.7, + "cacheRead": 0.036, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "xingchen-agi/xing4.0-29b-a4b:free", + "name": "XingChen: Xing4.0 29B A4B (free)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 235929 + }, + { + "id": "z-ai/glm-4.5", + "name": "Z.ai: GLM 4.5", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.6, + "output": 2.2, + "cacheRead": 0.11, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 98304 + }, + { + "id": "z-ai/glm-4.5-air", + "name": "Z.ai: GLM 4.5 Air", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.13, + "output": 0.85, + "cacheRead": 0.024999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 98304 + }, + { + "id": "z-ai/glm-4.5v", + "name": "Z.ai: GLM 4.5V", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.6, + "output": 1.7999999999999998, + "cacheRead": 0.11, + "cacheWrite": 0 + }, + "contextWindow": 65536, + "maxTokens": 16384 + }, + { + "id": "z-ai/glm-4.6", + "name": "Z.ai: GLM 4.6", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.5, + "output": 2, + "cacheRead": 0.09999999999999999, + "cacheWrite": 0 + }, + "contextWindow": 204800, + "maxTokens": 131072 + }, + { + "id": "z-ai/glm-4.6v", + "name": "Z.ai: GLM 4.6V", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 0.8999999999999999, + "cacheRead": 0.049999999999999996, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 32768 + }, + { + "id": "z-ai/glm-4.7", + "name": "Z.ai: GLM 4.7", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.54, + "output": 1.9800000000000002, + "cacheRead": 0.099, + "cacheWrite": 0 + }, + "contextWindow": 204800, + "maxTokens": 131072 + }, + { + "id": "z-ai/glm-4.7-flash", + "name": "Z.ai: GLM 4.7 Flash", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.060500000000000005, + "output": 0.39999999999999997, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 117964 + }, + { + "id": "z-ai/glm-5", + "name": "Z.ai: GLM 5", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.6, + "output": 1.9, + "cacheRead": 0.119, + "cacheWrite": 0 + }, + "contextWindow": 204800, + "maxTokens": 131072 + }, + { + "id": "z-ai/glm-5-turbo", + "name": "Z.ai: GLM 5 Turbo", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 1.2, + "output": 4, + "cacheRead": 0.24, + "cacheWrite": 0 + }, + "contextWindow": 202752, + "maxTokens": 131072 + }, + { + "id": "z-ai/glm-5.1", + "name": "Z.ai: GLM 5.1", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 1.4, + "output": 4.4, + "cacheRead": 0.26, + "cacheWrite": 0 + }, + "contextWindow": 204800, + "maxTokens": 131072 + }, + { + "id": "z-ai/glm-5.2", + "name": "Z.ai: GLM 5.2", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.006, + "output": 7, + "cacheRead": 0.005, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 943718 + }, + { + "id": "z-ai/glm-5.3", + "name": "Z.ai: GLM 5.3", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.0699, + "output": 1.4, + "cacheRead": 0.0689, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 943718 + }, + { + "id": "z-ai/glm-5.3-flash", + "name": "Z.ai: GLM 5.3 Flash", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.0457, + "output": 0.0742, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "z-ai/glm-5.3-flash:batch", + "name": "Z.ai: GLM 5.3 Flash (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.049999999999999996, + "output": 0.18, + "cacheRead": 0.01, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "z-ai/glm-5.3-flashx", + "name": "Z.ai: GLM 5.3 FlashX", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.37, + "output": 1.25, + "cacheRead": 0.09, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "z-ai/glm-5.3-prime", + "name": "Z.ai: GLM 5.3 Prime", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 2.8, + "output": 8.8, + "cacheRead": 0.56, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "z-ai/glm-5.3:batch", + "name": "Z.ai: GLM 5.3 (batch)", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.44999999999999996, + "output": 2, + "cacheRead": 0.09999999999999999, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "z-ai/glm-5v-turbo", + "name": "Z.ai: GLM 5V Turbo", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.2, + "output": 4, + "cacheRead": 0.24, + "cacheWrite": 0 + }, + "contextWindow": 202752, + "maxTokens": 131072 + }, + { + "id": "~anthropic/claude-fable-latest", + "name": "Anthropic: Claude Fable Latest", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 8, + "output": 40, + "cacheRead": 0.19999999999999998, + "cacheWrite": 10 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "~anthropic/claude-haiku-latest", + "name": "Anthropic: Claude Haiku Latest", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.5, + "cacheRead": 0.01, + "cacheWrite": 0.125 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "~anthropic/claude-opus-latest", + "name": "Anthropic: Claude Opus Latest", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.19999999999999998, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "~anthropic/claude-sonnet-latest", + "name": "Anthropic: Claude Sonnet Latest", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.09999999999999999, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "~deepseek/deepseek-flash-latest", + "name": "DeepSeek: DeepSeek Flash Latest", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.017599999999999998, + "output": 1.76, + "cacheRead": 0.0174, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 943718 + }, + { + "id": "~deepseek/deepseek-pro-latest", + "name": "DeepSeek: DeepSeek Pro Latest", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.1035, + "output": 8, + "cacheRead": 0.09999999999999999, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 393216 + }, + { + "id": "~deepseek/deepseek-v4-flash-latest", + "name": "DeepSeek: DeepSeek V4 Flash Latest", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "off": "none", + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.057, + "output": 0.1341, + "cacheRead": 0.028, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 943718 + }, + { + "id": "~google/gemini-flash-latest", + "name": "Google: Gemini Flash Latest", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 3.75, + "cacheRead": 0.075, + "cacheWrite": 0.0416666666666667 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "~google/gemini-pro-latest", + "name": "Google: Gemini Pro Latest", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.09999999999999999, + "cacheWrite": 0.1875 + }, + "contextWindow": 1048576, + "maxTokens": 943718 + }, + { + "id": "~moonshotai/kimi-latest", + "name": "MoonshotAI: Kimi Latest", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.18239999999999998, + "output": 9.338799999999999, + "cacheRead": 0.18, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 943718 + }, + { + "id": "~openai/gpt-astra-latest", + "name": "OpenAI: GPT Astra Latest", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "~openai/gpt-luna-latest", + "name": "OpenAI: GPT Luna Latest", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.5, + "cacheRead": 0.01, + "cacheWrite": 0.125 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "~openai/gpt-mini-latest", + "name": "OpenAI: GPT Mini Latest", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 4.5, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "~openai/gpt-sol-latest", + "name": "OpenAI: GPT Sol Latest", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.09999999999999999, + "cacheWrite": 2.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "~openai/gpt-terra-latest", + "name": "OpenAI: GPT Terra Latest", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.049999999999999996, + "cacheWrite": 1.25 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "~unbiased/pareto-latest", + "name": "Pareto Latest", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.7999999999999999, + "output": 3.1999999999999997, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "~x-ai/grok-latest", + "name": "xAI: Grok Latest", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 450000 + }, + { + "id": "~z-ai/glm-flash-latest", + "name": "Z.ai: GLM Flash Latest", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.0457, + "output": 0.0742, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "~z-ai/glm-latest", + "name": "Z.ai: GLM Latest", + "api": "openai-completions", + "provider": "openrouter", + "baseUrl": "https://openrouter.ai/api/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.0699, + "output": 1.4, + "cacheRead": 0.0689, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 943718 + }, + { + "id": "MiniMaxAI/MiniMax-M3", + "name": "MiniMax-M3", + "api": "openai-completions", + "provider": "together", + "baseUrl": "https://api.together.ai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false, + "thinkingFormat": "together" + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": null, + "medium": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.06, + "cacheWrite": 0 + }, + "contextWindow": 524288, + "maxTokens": 524288 + }, + { + "id": "Qwen/Qwen3.5-9B", + "name": "Qwen3.5 9B", + "api": "openai-completions", + "provider": "together", + "baseUrl": "https://api.together.ai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false, + "thinkingFormat": "together" + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": null, + "medium": null, + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.17, + "output": 0.25, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 65536 + }, + { + "id": "Qwen/Qwen3.6-Plus", + "name": "Qwen3.6 Plus", + "api": "openai-completions", + "provider": "together", + "baseUrl": "https://api.together.ai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false, + "thinkingFormat": "together" + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": null, + "medium": null, + "xhigh": "high", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 0.5, + "output": 3, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 500000 + }, + { + "id": "Qwen/Qwen3.7-Max", + "name": "Qwen3.7 Max", + "api": "openai-completions", + "provider": "together", + "baseUrl": "https://api.together.ai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false, + "thinkingFormat": "together" + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": null, + "medium": null, + "xhigh": "high", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 2.5, + "output": 7.5, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 500000 + }, + { + "id": "deepseek-ai/DeepSeek-V4-Pro-0813", + "name": "DeepSeek V4 Pro 0813", + "api": "openai-completions", + "provider": "together", + "baseUrl": "https://api.together.ai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": true, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false, + "thinkingFormat": "together" + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null + }, + "input": [ + "text" + ], + "cost": { + "input": 1.32, + "output": 3.96, + "cacheRead": 0.13, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 384000 + }, + { + "id": "deepseek-ai/DeepSeek-V4.1-Flash", + "name": "DeepSeek V4.1 Flash", + "api": "openai-completions", + "provider": "together", + "baseUrl": "https://api.together.ai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false, + "thinkingFormat": "together" + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": null, + "medium": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.006, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 384000 + }, + { + "id": "moonshotai/Kimi-K3", + "name": "Kimi K3", + "api": "openai-completions", + "provider": "together", + "baseUrl": "https://api.together.ai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false, + "thinkingFormat": "together" + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": null, + "medium": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "openai/gpt-oss-120b", + "name": "GPT OSS 120B", + "api": "openai-completions", + "provider": "together", + "baseUrl": "https://api.together.ai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": true, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false, + "thinkingFormat": "openai" + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 131072 + }, + { + "id": "thinkingmachines/Inkling", + "name": "Inkling", + "api": "openai-completions", + "provider": "together", + "baseUrl": "https://api.together.ai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false, + "thinkingFormat": "together" + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": null, + "medium": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 4.05, + "cacheRead": 0.17, + "cacheWrite": 0 + }, + "contextWindow": 524288, + "maxTokens": 131072 + }, + { + "id": "zai-org/GLM-5.2", + "name": "GLM-5.2", + "api": "openai-completions", + "provider": "together", + "baseUrl": "https://api.together.ai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false, + "thinkingFormat": "together" + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "off": null, + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 1.4, + "output": 4.4, + "cacheRead": 0.26, + "cacheWrite": 0 + }, + "contextWindow": 1048575, + "maxTokens": 164000 + }, + { + "id": "zai-org/GLM-5.3", + "name": "GLM-5.3", + "api": "openai-completions", + "provider": "together", + "baseUrl": "https://api.together.ai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false, + "thinkingFormat": "together" + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "off": null, + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 1.4, + "output": 4.4, + "cacheRead": 0.26, + "cacheWrite": 0 + }, + "contextWindow": 1048575, + "maxTokens": 262144 + }, + { + "id": "zai-org/GLM-5.3-Flash", + "name": "GLM-5.3-Flash", + "api": "openai-completions", + "provider": "together", + "baseUrl": "https://api.together.ai/v1", + "compat": { + "supportsStore": false, + "supportsDeveloperRole": false, + "supportsReasoningEffort": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": false, + "supportsLongCacheRetention": false, + "thinkingFormat": "together" + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "off": null, + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.5, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 1048575, + "maxTokens": 400000 + }, + { + "id": "alibaba/qwen-3-14b", + "name": "Qwen3-14B", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 0.12, + "output": 0.24, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 40960, + "maxTokens": 16384 + }, + { + "id": "alibaba/qwen-3-235b", + "name": "Qwen3 235B A22B", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.22, + "output": 0.88, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 16384 + }, + { + "id": "alibaba/qwen-3-30b", + "name": "Qwen3-30B-A3B", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 0.12, + "output": 0.5, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 40960, + "maxTokens": 16384 + }, + { + "id": "alibaba/qwen-3-32b", + "name": "Qwen 3 32B", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 8192 + }, + { + "id": "alibaba/qwen3-coder", + "name": "Qwen3 Coder 480B A35B Instruct", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.22, + "output": 1.7999999999999998, + "cacheRead": 0.022, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "alibaba/qwen3-coder-30b-a3b", + "name": "Qwen 3 Coder 30B A3B Instruct", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 8192 + }, + { + "id": "alibaba/qwen3-coder-next", + "name": "Qwen3 Coder Next", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.5, + "output": 1.2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 256000 + }, + { + "id": "alibaba/qwen3-max-thinking", + "name": "Qwen 3 Max Thinking", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 1.2, + "output": 6, + "cacheRead": 0.24, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 65536 + }, + { + "id": "alibaba/qwen3-next-80b-a3b-instruct", + "name": "Qwen3 Next 80B A3B Instruct", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.15, + "output": 1.2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262114, + "maxTokens": 262114 + }, + { + "id": "alibaba/qwen3-next-80b-a3b-thinking", + "name": "Qwen3 Next 80B A3B Thinking", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 0.15, + "output": 1.2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "alibaba/qwen3-vl-instruct", + "name": "Qwen3 VL 235B A22B Instruct", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.19999999999999998, + "output": 0.88, + "cacheRead": 0.11, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "alibaba/qwen3.5-flash", + "name": "Qwen 3.5 Flash", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.39999999999999997, + "cacheRead": 0.01, + "cacheWrite": 0.125 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "alibaba/qwen3.5-plus", + "name": "Qwen 3.5 Plus", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.39999999999999997, + "output": 2.4, + "cacheRead": 0.04, + "cacheWrite": 0.5 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "alibaba/qwen3.6-27b", + "name": "Qwen 3.6 27B", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.6, + "output": 3.5999999999999996, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 256000 + }, + { + "id": "alibaba/qwen3.6-plus", + "name": "Qwen 3.6 Plus", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.5, + "output": 3, + "cacheRead": 0.049999999999999996, + "cacheWrite": 0.625 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "alibaba/qwen3.7-flash", + "name": "Qwen 3.7 Flash", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.03, + "output": 0.13, + "cacheRead": 0.006, + "cacheWrite": 0.038000000000000006 + }, + "contextWindow": 991000, + "maxTokens": 64000 + }, + { + "id": "alibaba/qwen3.7-max", + "name": "Qwen 3.7 Max", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 2.5, + "output": 7.5, + "cacheRead": 0.5, + "cacheWrite": 3.125 + }, + "contextWindow": 991000, + "maxTokens": 64000 + }, + { + "id": "alibaba/qwen3.7-plus", + "name": "Qwen 3.7 Plus", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.39999999999999997, + "output": 1.5999999999999999, + "cacheRead": 0.08, + "cacheWrite": 0.5 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "alibaba/qwen3.8-2.4t-a95b", + "name": "Qwen3.8 2.4T A95B", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 128000 + }, + { + "id": "alibaba/qwen3.8-27b", + "name": "Qwen3.8 27B", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.5, + "output": 3, + "cacheRead": 0.09999999999999999, + "cacheWrite": 0.625 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "alibaba/qwen3.8-flash", + "name": "Qwen 3.8 Flash", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.47, + "cacheRead": 0.016, + "cacheWrite": 0.19999999999999998 + }, + "contextWindow": 991000, + "maxTokens": 128000 + }, + { + "id": "alibaba/qwen3.8-max", + "name": "Qwen 3.8 Max", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 128000 + }, + { + "id": "alibaba/qwen3.8-max-0902", + "name": "Qwen3.8 Max 0902", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.25, + "cacheWrite": 2.5 + }, + "contextWindow": 991000, + "maxTokens": 128000 + }, + { + "id": "alibaba/qwen3.8-max-prime", + "name": "Qwen 3.8 Max Prime", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 12, + "cacheRead": 0.5, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "alibaba/qwen3.8-omni-flash", + "name": "Qwen 3.8 Omni Flash", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "high", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.47, + "cacheRead": 0.016, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "amazon/nova-2-lite", + "name": "Nova 2 Lite", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.33, + "output": 2.75, + "cacheRead": 0.0825, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 1000000 + }, + { + "id": "amazon/nova-lite", + "name": "Nova Lite", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.06, + "output": 0.24, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 300000, + "maxTokens": 8192 + }, + { + "id": "amazon/nova-micro", + "name": "Nova Micro", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.035, + "output": 0.14, + "cacheRead": 0.0087, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 8192 + }, + { + "id": "amazon/nova-pro", + "name": "Nova Pro", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.7999999999999999, + "output": 3.1999999999999997, + "cacheRead": 0.19999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 300000, + "maxTokens": 8192 + }, + { + "id": "anthropic/claude-fable-5", + "name": "Claude Fable 5", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-fable-5-batch", + "name": "Claude Fable 5 (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-fable-5.1", + "name": "Claude Fable 5.1", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 0.25, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-fable-5.1-batch", + "name": "Claude Fable 5.1 (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.125, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-fable-5.2", + "name": "Claude Fable 5.2", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 8, + "output": 40, + "cacheRead": 0.19999999999999998, + "cacheWrite": 10 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-fable-5.2-batch", + "name": "Claude Fable 5.2 (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.09999999999999999, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-fable-5.2-fast", + "name": "Claude Fable 5.2 (Fast)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 16, + "output": 80, + "cacheRead": 0.39999999999999997, + "cacheWrite": 20 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-haiku-4.5", + "name": "Claude Haiku 4.5", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.09999999999999999, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "anthropic/claude-haiku-4.5-batch", + "name": "Claude Haiku 4.5 (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.5, + "output": 2.5, + "cacheRead": 0.049999999999999996, + "cacheWrite": 0.625 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "anthropic/claude-opus-4.5", + "name": "Claude Opus 4.5", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "anthropic/claude-opus-4.5-batch", + "name": "Claude Opus 4.5 (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 12.5, + "cacheRead": 0.25, + "cacheWrite": 3.125 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "anthropic/claude-opus-4.6", + "name": "Claude Opus 4.6", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-opus-4.6-batch", + "name": "Claude Opus 4.6 (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 12.5, + "cacheRead": 0.25, + "cacheWrite": 3.125 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-opus-4.7", + "name": "Claude Opus 4.7", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-opus-4.7-batch", + "name": "Claude Opus 4.7 (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 12.5, + "cacheRead": 0.25, + "cacheWrite": 3.125 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-opus-4.8", + "name": "Claude Opus 4.8", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-opus-4.8-batch", + "name": "Claude Opus 4.8 (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 12.5, + "cacheRead": 0.25, + "cacheWrite": 3.125 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-opus-4.8-fast", + "name": "Claude Opus 4.8 (Fast)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-opus-5", + "name": "Claude Opus 5", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-opus-5-batch", + "name": "Claude Opus 5 (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 12.5, + "cacheRead": 0.25, + "cacheWrite": 3.125 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-opus-5-fast", + "name": "Claude Opus 5 (Fast)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-opus-5.5", + "name": "Claude Opus 5.5", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "compat": { + "forceAdaptiveThinking": true, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.19999999999999998, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-opus-5.5-batch", + "name": "Claude Opus 5.5 (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "compat": { + "forceAdaptiveThinking": true, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.09999999999999999, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-opus-5.5-fast", + "name": "Claude Opus 5.5 (Fast)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "compat": { + "forceAdaptiveThinking": true, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 8, + "output": 40, + "cacheRead": 0.39999999999999997, + "cacheWrite": 10 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-sonnet-4.5", + "name": "Claude Sonnet 4.5", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "anthropic/claude-sonnet-4.5-batch", + "name": "Claude Sonnet 4.5 (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.5, + "output": 7.5, + "cacheRead": 0.15, + "cacheWrite": 1.875 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "anthropic/claude-sonnet-4.6", + "name": "Claude Sonnet 4.6", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-sonnet-4.6-batch", + "name": "Claude Sonnet 4.6 (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.5, + "output": 7.5, + "cacheRead": 0.15, + "cacheWrite": 1.875 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-sonnet-5", + "name": "Claude Sonnet 5", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.19999999999999998, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "anthropic/claude-sonnet-5-batch", + "name": "Claude Sonnet 5 (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.09999999999999999, + "cacheWrite": 1.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "arcee-ai/trinity-large-thinking", + "name": "Trinity Large Thinking", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.25, + "output": 0.7999999999999999, + "cacheRead": 0.06, + "cacheWrite": 0 + }, + "contextWindow": 262100, + "maxTokens": 80000 + }, + { + "id": "bytedance/seed-1.6", + "name": "Seed 1.6", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 2, + "cacheRead": 0.049999999999999996, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 32000 + }, + { + "id": "bytedance/seed-1.8", + "name": "Bytedance Seed 1.8", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 2, + "cacheRead": 0.049999999999999996, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 64000 + }, + { + "id": "bytedance/seed-2.1-turbo", + "name": "Seed 2.1 Turbo", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.5, + "output": 2.5, + "cacheRead": 0.09999999999999999, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "callstack/apex", + "name": "Apex", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.5, + "output": 3, + "cacheRead": 0.19999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 131072 + }, + { + "id": "cohere/command-a", + "name": "Command A", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 2.5, + "output": 10, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 8000 + }, + { + "id": "deepseek/deepseek-r1", + "name": "DeepSeek-R1", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 1.35, + "output": 5.4, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 8192 + }, + { + "id": "deepseek/deepseek-v3.1", + "name": "DeepSeek V3.1", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.25, + "output": 0.95, + "cacheRead": 0.13, + "cacheWrite": 0 + }, + "contextWindow": 163840, + "maxTokens": 128000 + }, + { + "id": "deepseek/deepseek-v3.2", + "name": "DeepSeek V3.2", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.62, + "output": 1.85, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 8000 + }, + { + "id": "deepseek/deepseek-v3.2-thinking", + "name": "DeepSeek V3.2 Thinking", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.62, + "output": 1.85, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 8000 + }, + { + "id": "deepseek/deepseek-v4-flash", + "name": "DeepSeek V4 Flash", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.13, + "output": 0.26, + "cacheRead": 0.028, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 384000 + }, + { + "id": "deepseek/deepseek-v4-flash-0731", + "name": "DeepSeek V4 Flash 0731", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.07600000000000001, + "output": 0.153, + "cacheRead": 0.014, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 384000 + }, + { + "id": "deepseek/deepseek-v4-flash-vision-exp", + "name": "DeepSeek V4 Flash Vision Exp", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.21559999999999999, + "output": 0.6468, + "cacheRead": 0.0068, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "deepseek/deepseek-v4-pro", + "name": "DeepSeek V4 Pro", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.66, + "output": 1.9800000000000002, + "cacheRead": 0.022, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 384000 + }, + { + "id": "deepseek/deepseek-v4-pro-0813", + "name": "DeepSeek V4 Pro 0813", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.66, + "output": 1.9800000000000002, + "cacheRead": 0.06599999999999999, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 384000 + }, + { + "id": "deepseek/deepseek-v4.1-flash", + "name": "DeepSeek V4.1 Flash", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.075, + "output": 0.3, + "cacheRead": 0.0015, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 32768 + }, + { + "id": "deepseek/deepseek-v4.1-flash-1017", + "name": "DeepSeek V4.1 Flash 1017", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.075, + "output": 0.3, + "cacheRead": 0.0015, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "deepseek/deepseek-v4.1-flash-1017-fast", + "name": "DeepSeek V4.1 Flash 1017 Fast", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.6, + "output": 2.4, + "cacheRead": 0.014, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 262144 + }, + { + "id": "deepseek/deepseek-v4.1-flash-fast", + "name": "DeepSeek V4.1 Flash Fast", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.6, + "output": 2.4, + "cacheRead": 0.014, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 32768 + }, + { + "id": "fireworks/ember-1", + "name": "Ember-1", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "google/gemini-2.5-flash", + "name": "Gemini 2.5 Flash", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 2.5, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 65535 + }, + { + "id": "google/gemini-2.5-flash-batch", + "name": "Gemini 2.5 Flash (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 1.25, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "google/gemini-2.5-flash-lite", + "name": "Gemini 2.5 Flash Lite", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.39999999999999997, + "cacheRead": 0.01, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65535 + }, + { + "id": "google/gemini-2.5-flash-lite-batch", + "name": "Gemini 2.5 Flash Lite (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.049999999999999996, + "output": 0.19999999999999998, + "cacheRead": 0.01, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65535 + }, + { + "id": "google/gemini-2.5-pro", + "name": "Gemini 2.5 Pro", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.125, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65535 + }, + { + "id": "google/gemini-2.5-pro-batch", + "name": "Gemini 2.5 Pro (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.625, + "output": 5, + "cacheRead": 0.125, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65535 + }, + { + "id": "google/gemini-3-flash", + "name": "Gemini 3 Flash", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.5, + "output": 3, + "cacheRead": 0.049999999999999996, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 65000 + }, + { + "id": "google/gemini-3-flash-batch", + "name": "Gemini 3 Flash (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 1.5, + "cacheRead": 0.049999999999999996, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "google/gemini-3.1-flash-lite", + "name": "Gemini 3.1 Flash Lite", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 1.5, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 65000 + }, + { + "id": "google/gemini-3.1-flash-lite-batch", + "name": "Gemini 3.1 Flash Lite (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.125, + "output": 0.75, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 65000 + }, + { + "id": "google/gemini-3.1-pro-preview", + "name": "Gemini 3.1 Pro Preview", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 12, + "cacheRead": 0.19999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "google/gemini-3.1-pro-preview-batch", + "name": "Gemini 3.1 Pro Preview (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 6, + "cacheRead": 0.19999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "google/gemini-3.5-flash", + "name": "Gemini 3.5 Flash", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.5, + "output": 9, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "google/gemini-3.5-flash-batch", + "name": "Gemini 3.5 Flash (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 4.5, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "google/gemini-3.5-flash-lite", + "name": "Gemini 3.5 Flash Lite", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 2.5, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 65000 + }, + { + "id": "google/gemini-3.5-flash-lite-batch", + "name": "Gemini 3.5 Flash Lite (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 1.25, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 65000 + }, + { + "id": "google/gemini-3.6-flash", + "name": "Gemini 3.6 Flash", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 3.75, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "google/gemini-3.6-flash-batch", + "name": "Gemini 3.6 Flash (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.375, + "output": 1.875, + "cacheRead": 0.0375, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 64000 + }, + { + "id": "google/gemini-3.7-flash", + "name": "Gemini 3.7 Flash", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 3.75, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 65535 + }, + { + "id": "google/gemini-3.7-flash-batch", + "name": "Gemini 3.7 Flash (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.375, + "output": 1.875, + "cacheRead": 0.0375, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 65535 + }, + { + "id": "google/gemini-3.8-flash", + "name": "Gemini 3.8 Flash", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 3.75, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 65535 + }, + { + "id": "google/gemini-4-argon", + "name": "Gemini 4 Argon", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.09999999999999999, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 1000000 + }, + { + "id": "google/gemma-4-26b-a4b-it", + "name": "Google Gemma 4 26B A4B", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 131072 + }, + { + "id": "google/gemma-4-31b-it", + "name": "Gemma 4 31B IT", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.14, + "output": 0.39999999999999997, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 131072 + }, + { + "id": "inception/mercury-2", + "name": "Mercury 2", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.25, + "output": 0.75, + "cacheRead": 0.024999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 128000 + }, + { + "id": "inception/mercury-2.5", + "name": "Mercury 2.5", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.04, + "output": 0.15, + "cacheRead": 0.004, + "cacheWrite": 0 + }, + "contextWindow": 260000, + "maxTokens": 65536 + }, + { + "id": "inception/mercury-3", + "name": "Mercury 3", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.35, + "cacheRead": 0.01, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "inception/mercury-coder-small", + "name": "Mercury Coder Small Beta", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.25, + "output": 1, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 32000, + "maxTokens": 16384 + }, + { + "id": "inclusionai/ling-3.0-flash", + "name": "Ling 3.0 Flash", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.020999999999999998, + "output": 0.063, + "cacheRead": 0.004200000000000001, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 32000 + }, + { + "id": "inclusionai/ling-3.0-flash-fin", + "name": "Ling 3.0 Flash Fin", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.075, + "output": 0.22, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 32000 + }, + { + "id": "inclusionai/ling-3.0-flash-sante", + "name": "Ling 3.0 Flash Sante", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.075, + "output": 0.22, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 32000 + }, + { + "id": "inclusionai/ling-3.0-flash-vl", + "name": "Ling 3.0 Flash VL", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.075, + "output": 0.22, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 32000 + }, + { + "id": "inclusionai/ling-3.1-flash", + "name": "Ling 3.1 Flash", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 0.8999999999999999, + "cacheRead": 0.06, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "interfaze/interfaze-beta", + "name": "Interfaze Beta", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.5, + "output": 3.5, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 32000 + }, + { + "id": "liquid/lfm2.5-24b-a2b", + "name": "LFM2.5-24B-A2B", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.049999999999999996, + "output": 0.7, + "cacheRead": 0.024999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 8200 + }, + { + "id": "meituan/longcat-2.5-preview", + "name": "LongCat 2.5 Preview", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.006, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "meta/llama-3.1-70b", + "name": "Llama 3.1 70B Instruct", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.72, + "output": 0.72, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 8192 + }, + { + "id": "meta/llama-3.1-8b", + "name": "Llama 3.1 8B Instruct", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.22, + "output": 0.22, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 8192 + }, + { + "id": "meta/llama-3.3-70b", + "name": "Llama 3.3 70B Instruct", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.72, + "output": 0.72, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 8192 + }, + { + "id": "meta/llama-4-maverick", + "name": "Llama 4 Maverick 17B Instruct", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.24, + "output": 0.9700000000000001, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 8192 + }, + { + "id": "meta/llama-4-scout", + "name": "Llama 4 Scout 17B Instruct", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.16999999999999998, + "output": 0.66, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 8192 + }, + { + "id": "meta/muse-glimmer-30b", + "name": "Muse Glimmer 30B", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.35, + "output": 1.5, + "cacheRead": 0.04, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 131072 + }, + { + "id": "meta/muse-spark-1.1", + "name": "Muse Spark 1.1", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 4.25, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "meta/muse-spark-1.2", + "name": "Muse Spark 1.2", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 4.25, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "meta/muse-spark-1.2-contributor", + "name": "Muse Spark 1.2 Contributor", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.19999999999999998, + "cacheRead": 0.002, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "meta/muse-spark-1.3", + "name": "Muse Spark 1.3", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 4.25, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "meta/muse-spark-1.3-contributor", + "name": "Muse Spark 1.3 Contributor", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.19999999999999998, + "cacheRead": 0.002, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "meta/muse-spark-open", + "name": "Muse Spark Open", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 4.25, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "meta/muse-wonder-1.0", + "name": "Muse Wonder", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.19999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "minimax/minimax-m2", + "name": "MiniMax M2", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.03, + "cacheWrite": 0.375 + }, + "contextWindow": 205000, + "maxTokens": 205000 + }, + { + "id": "minimax/minimax-m2.1", + "name": "MiniMax M2.1", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.03, + "cacheWrite": 0.375 + }, + "contextWindow": 204800, + "maxTokens": 131072 + }, + { + "id": "minimax/minimax-m2.1-lightning", + "name": "MiniMax M2.1 Lightning", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 2.4, + "cacheRead": 0.03, + "cacheWrite": 0.375 + }, + "contextWindow": 204800, + "maxTokens": 131072 + }, + { + "id": "minimax/minimax-m2.5", + "name": "MiniMax M2.5", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.03, + "cacheWrite": 0.375 + }, + "contextWindow": 204800, + "maxTokens": 131000 + }, + { + "id": "minimax/minimax-m2.5-highspeed", + "name": "MiniMax M2.5 High Speed", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.6, + "output": 2.4, + "cacheRead": 0.03, + "cacheWrite": 0.375 + }, + "contextWindow": 204800, + "maxTokens": 131000 + }, + { + "id": "minimax/minimax-m2.7", + "name": "MiniMax M2.7", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.06, + "cacheWrite": 0.375 + }, + "contextWindow": 204800, + "maxTokens": 131000 + }, + { + "id": "minimax/minimax-m2.7-highspeed", + "name": "MiniMax M2.7 High Speed", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.6, + "output": 2.4, + "cacheRead": 0.06, + "cacheWrite": 0.375 + }, + "contextWindow": 204800, + "maxTokens": 131100 + }, + { + "id": "minimax/minimax-m3", + "name": "MiniMax M3", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.3, + "output": 1.2, + "cacheRead": 0.06, + "cacheWrite": 0 + }, + "contextWindow": 512000, + "maxTokens": 512000 + }, + { + "id": "minimax/minimax-m3.1-flash", + "name": "MiniMax-M3.1-Flash", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "mistral/codestral", + "name": "Mistral Codestral", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 0.8999999999999999, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 4000 + }, + { + "id": "mistral/ministral-14b", + "name": "Ministral 14B", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.19999999999999998, + "output": 0.19999999999999998, + "cacheRead": 0.02, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 256000 + }, + { + "id": "mistral/ministral-3b", + "name": "Ministral 3B", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.09999999999999999, + "cacheRead": 0.01, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 4000 + }, + { + "id": "mistral/ministral-8b", + "name": "Ministral 8B", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.15, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 4000 + }, + { + "id": "mistral/mistral-large-3", + "name": "Mistral Large 3", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.5, + "output": 1.5, + "cacheRead": 0.049999999999999996, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 256000 + }, + { + "id": "mistral/mistral-large-4", + "name": "Mistral Large 4", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.3599999999999999, + "output": 4.18, + "cacheRead": 0.14, + "cacheWrite": 0 + }, + "contextWindow": 524288, + "maxTokens": 262144 + }, + { + "id": "mistral/mistral-medium-3.5", + "name": "Mistral Medium Latest", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.5, + "output": 7.5, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 256000 + }, + { + "id": "mistral/mistral-nemo", + "name": "Mistral Nemo 12B", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.029, + "output": 0.03, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 131072 + }, + { + "id": "mistral/mistral-small", + "name": "Mistral Small", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 4000 + }, + { + "id": "mixedbread/toast-1", + "name": "Toast 1", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.3, + "output": 0.72, + "cacheRead": 0.036, + "cacheWrite": 0 + }, + "contextWindow": 131000, + "maxTokens": 4000 + }, + { + "id": "moonshotai/kimi-k2", + "name": "Kimi K2 Instruct", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.5700000000000001, + "output": 2.3, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 131072 + }, + { + "id": "moonshotai/kimi-k2.5", + "name": "Kimi K2.5", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.6, + "output": 3, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 256000 + }, + { + "id": "moonshotai/kimi-k2.6", + "name": "Kimi K2.6", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.95, + "output": 4, + "cacheRead": 0.16, + "cacheWrite": 0 + }, + "contextWindow": 262000, + "maxTokens": 262000 + }, + { + "id": "moonshotai/kimi-k2.7-code", + "name": "Kimi K2.7 Code", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.95, + "output": 4, + "cacheRead": 0.19, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 32768 + }, + { + "id": "moonshotai/kimi-k2.7-code-highspeed", + "name": "Kimi K2.7 Code High Speed", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.9, + "output": 8, + "cacheRead": 0.38, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 32768 + }, + { + "id": "moonshotai/kimi-k3", + "name": "Kimi K3", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "moonshotai/kimi-k3-fast", + "name": "Kimi K3 Fast", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4.5, + "output": 22.5, + "cacheRead": 0.44999999999999996, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "moonshotai/kimi-k3.1-pro", + "name": "Kimi K3.1 Pro", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.19999999999999998, + "cacheWrite": 2 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "moonshotai/kimi-k3.1-pro-highspeed", + "name": "Kimi K3.1 Pro Highspeed", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.19999999999999998, + "cacheWrite": 4 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "nvidia/nemotron-3-nano-30b-a3b", + "name": "Nemotron 3 Nano 30B A3B", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.049999999999999996, + "output": 0.19999999999999998, + "cacheRead": 0.024999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "nvidia/nemotron-3-super-120b-a12b", + "name": "NVIDIA Nemotron 3 Super 120B A12B", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.15, + "output": 0.65, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 32000 + }, + { + "id": "nvidia/nemotron-3-ultra-550b-a55b", + "name": "Nemotron 3 Ultra", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.6, + "output": 2.4, + "cacheRead": 0.12, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 65000 + }, + { + "id": "nvidia/nemotron-3.5-lightning", + "name": "Nemotron 3.5 Lightning 30B", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.049999999999999996, + "output": 0.19999999999999998, + "cacheRead": 0.01, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 131072 + }, + { + "id": "nvidia/nemotron-3.5-lightning-free", + "name": "Nemotron 3.5 Lightning Free", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 65000 + }, + { + "id": "nvidia/nemotron-3.5-super-vl", + "name": "NVIDIA Nemotron 3.5 Super VL", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.19999999999999998, + "output": 0.5, + "cacheRead": 0.04, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "nvidia/nemotron-nano-12b-v2-vl", + "name": "Nvidia Nemotron Nano 12B V2 VL", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.19999999999999998, + "output": 0.6, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 131072 + }, + { + "id": "nvidia/nemotron-nano-9b-v2", + "name": "Nvidia Nemotron Nano 9B V2", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.06, + "output": 0.22999999999999998, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 131072 + }, + { + "id": "openai/gpt-4.1", + "name": "GPT-4.1", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 8, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 1047576, + "maxTokens": 32768 + }, + { + "id": "openai/gpt-4.1-batch", + "name": "GPT-4.1 (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 4, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 1047576, + "maxTokens": 32768 + }, + { + "id": "openai/gpt-4.1-fast", + "name": "GPT-4.1 (Fast)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3.5, + "output": 14, + "cacheRead": 0.875, + "cacheWrite": 0 + }, + "contextWindow": 1047576, + "maxTokens": 32768 + }, + { + "id": "openai/gpt-4.1-mini", + "name": "GPT-4.1 mini", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.39999999999999997, + "output": 1.5999999999999999, + "cacheRead": 0.09999999999999999, + "cacheWrite": 0 + }, + "contextWindow": 1047576, + "maxTokens": 32768 + }, + { + "id": "openai/gpt-4.1-mini-batch", + "name": "GPT-4.1 mini (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.19999999999999998, + "output": 0.7999999999999999, + "cacheRead": 0.049999999999999996, + "cacheWrite": 0 + }, + "contextWindow": 1047576, + "maxTokens": 32768 + }, + { + "id": "openai/gpt-4.1-mini-fast", + "name": "GPT-4.1 mini (Fast)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.7, + "output": 2.8, + "cacheRead": 0.175, + "cacheWrite": 0 + }, + "contextWindow": 1047576, + "maxTokens": 32768 + }, + { + "id": "openai/gpt-4.1-nano", + "name": "GPT-4.1 nano", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.39999999999999997, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 1047576, + "maxTokens": 32768 + }, + { + "id": "openai/gpt-4o", + "name": "GPT-4o", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 10, + "cacheRead": 1.25, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "openai/gpt-4o-batch", + "name": "GPT-4o (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 5, + "cacheRead": 0.625, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "openai/gpt-4o-fast", + "name": "GPT-4o (Fast)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4.25, + "output": 17, + "cacheRead": 2.125, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "openai/gpt-4o-mini", + "name": "GPT-4o mini", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "openai/gpt-4o-mini-batch", + "name": "GPT-4o mini (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.075, + "output": 0.3, + "cacheRead": 0.0375, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "openai/gpt-4o-mini-fast", + "name": "GPT-4o mini (Fast)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 1, + "cacheRead": 0.125, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "openai/gpt-5", + "name": "GPT-5", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.125, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5-batch", + "name": "GPT-5 (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.625, + "output": 5, + "cacheRead": 0.0625, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5-codex", + "name": "GPT-5-Codex", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.13, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5-fast", + "name": "GPT-5 (Fast)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 20, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5-mini", + "name": "GPT-5 mini", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 2, + "cacheRead": 0.024999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5-mini-batch", + "name": "GPT-5 mini (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.125, + "output": 1, + "cacheRead": 0.012499999999999999, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5-mini-fast", + "name": "GPT-5 mini (Fast)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.44999999999999996, + "output": 3.5999999999999996, + "cacheRead": 0.045, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5-nano", + "name": "GPT-5 nano", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.049999999999999996, + "output": 0.39999999999999997, + "cacheRead": 0.005, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5-nano-batch", + "name": "GPT-5 nano (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.024999999999999998, + "output": 0.19999999999999998, + "cacheRead": 0.0025, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5-pro", + "name": "GPT-5 pro", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 15, + "output": 120, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 272000 + }, + { + "id": "openai/gpt-5-pro-batch", + "name": "GPT-5 pro (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 7.5, + "output": 60, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 272000 + }, + { + "id": "openai/gpt-5.1-codex", + "name": "GPT-5.1-Codex", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.13, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.1-codex-max", + "name": "GPT 5.1 Codex Max", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.125, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.1-codex-mini", + "name": "GPT 5.1 Codex Mini", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.25, + "output": 2, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.1-thinking", + "name": "GPT 5.1 Thinking", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 10, + "cacheRead": 0.125, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.1-thinking-fast", + "name": "GPT 5.1 Thinking (Fast)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 20, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.2", + "name": "GPT 5.2", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.75, + "output": 14, + "cacheRead": 0.175, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.2-batch", + "name": "GPT 5.2 (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.875, + "output": 7, + "cacheRead": 0.0875, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.2-codex", + "name": "GPT 5.2 Codex", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.75, + "output": 14, + "cacheRead": 0.175, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.2-fast", + "name": "GPT 5.2 (Fast)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3.5, + "output": 28, + "cacheRead": 0.35, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.2-pro", + "name": "GPT 5.2 ", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 21, + "output": 168, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.3-codex", + "name": "GPT 5.3 Codex", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.75, + "output": 14, + "cacheRead": 0.175, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.3-codex-fast", + "name": "GPT 5.3 Codex (Fast)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3.5, + "output": 28, + "cacheRead": 0.35, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.4", + "name": "GPT 5.4", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 15, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.4-batch", + "name": "GPT 5.4 (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 7.5, + "cacheRead": 0.125, + "cacheWrite": 0 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.4-fast", + "name": "GPT 5.4 (Fast)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 30, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.4-mini", + "name": "GPT 5.4 Mini", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.75, + "output": 4.5, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.4-mini-batch", + "name": "GPT 5.4 Mini (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.375, + "output": 2.25, + "cacheRead": 0.0375, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.4-mini-fast", + "name": "GPT 5.4 Mini (Fast)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.5, + "output": 9, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.4-nano", + "name": "GPT 5.4 Nano", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.19999999999999998, + "output": 1.25, + "cacheRead": 0.02, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.4-nano-batch", + "name": "GPT 5.4 Nano (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.625, + "cacheRead": 0.01, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.4-pro", + "name": "GPT 5.4 Pro", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 30, + "output": 180, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.5", + "name": "GPT 5.5", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 30, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.5-batch", + "name": "GPT 5.5 (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2.5, + "output": 15, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.5-fast", + "name": "GPT 5.5 (Fast)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 12.5, + "output": 75, + "cacheRead": 1.25, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.5-pro", + "name": "GPT 5.5 Pro", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "off": null, + "minimal": null, + "low": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 30, + "output": 180, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.5-pro-batch", + "name": "GPT 5.5 Pro (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 15, + "output": 90, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.6-luna", + "name": "GPT 5.6 Luna", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.19999999999999998, + "output": 1.2, + "cacheRead": 0.02, + "cacheWrite": 0.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.6-luna-batch", + "name": "GPT 5.6 Luna (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.6, + "cacheRead": 0.01, + "cacheWrite": 0.125 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.6-luna-fast", + "name": "GPT 5.6 Luna (Fast)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.39999999999999997, + "output": 2.4, + "cacheRead": 0.04, + "cacheWrite": 0.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.6-sol", + "name": "GPT 5.6 Sol", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.39999999999999997, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.6-sol-batch", + "name": "GPT 5.6 Sol (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.19999999999999998, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.6-sol-fast", + "name": "GPT 5.6 Sol (Fast)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 8, + "output": 40, + "cacheRead": 0.7999999999999999, + "cacheWrite": 10 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.6-terra", + "name": "GPT 5.6 Terra", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 12, + "cacheRead": 0.19999999999999998, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.6-terra-batch", + "name": "GPT 5.6 Terra (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 6, + "cacheRead": 0.09999999999999999, + "cacheWrite": 1.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-5.6-terra-fast", + "name": "GPT 5.6 Terra (Fast)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 24, + "cacheRead": 0.39999999999999997, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6-astra", + "name": "GPT-6 Astra", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6-astra-batch", + "name": "GPT-6 Astra (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6-astra-fast", + "name": "GPT-6 Astra (Fast)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 20, + "output": 100, + "cacheRead": 2, + "cacheWrite": 25 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6-luna", + "name": "GPT-6 Luna", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.5, + "cacheRead": 0.01, + "cacheWrite": 0.125 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6-luna-batch", + "name": "GPT-6 Luna (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.049999999999999996, + "output": 0.25, + "cacheRead": 0.005, + "cacheWrite": 0.0625 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6-luna-fast", + "name": "GPT-6 Luna (Fast)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.19999999999999998, + "output": 1, + "cacheRead": 0.02, + "cacheWrite": 0.25 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6-sol", + "name": "GPT-6 Sol", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.19999999999999998, + "cacheWrite": 2.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6-sol-batch", + "name": "GPT-6 Sol (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.09999999999999999, + "cacheWrite": 1.25 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6-sol-fast", + "name": "GPT-6 Sol (Fast)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.39999999999999997, + "cacheWrite": 5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6.1-sol", + "name": "GPT-6.1 Sol", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.09999999999999999, + "cacheWrite": 2.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6.1-sol-batch", + "name": "GPT-6.1 Sol (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.049999999999999996, + "cacheWrite": 1.25 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6.1-sol-fast", + "name": "GPT-6.1 Sol (Fast)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.19999999999999998, + "cacheWrite": 5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6.1-terra", + "name": "GPT-6.1 Terra", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.049999999999999996, + "cacheWrite": 1.25 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-6.1-terra-fast", + "name": "GPT-6.1 Terra (Fast)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.09999999999999999, + "cacheWrite": 2.5 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "openai/gpt-oss-120b", + "name": "GPT OSS 120B", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.09999999999999999, + "output": 0.5, + "cacheRead": 0.09999999999999999, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 131072 + }, + { + "id": "openai/gpt-oss-20b", + "name": "GPT OSS 20B", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.03, + "output": 0.14, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 8192 + }, + { + "id": "openai/gpt-oss-safeguard-120b", + "name": "GPT OSS Safeguard 120B", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.15, + "output": 0.6, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16000 + }, + { + "id": "openai/gpt-oss-safeguard-20b", + "name": "GPT OSS Safeguard 20B", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.07, + "output": 0.19999999999999998, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16000 + }, + { + "id": "openai/o1", + "name": "o1", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 15, + "output": 60, + "cacheRead": 7.5, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "openai/o3", + "name": "o3", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 8, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "openai/o3-fast", + "name": "o3 (Fast)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3.5, + "output": 14, + "cacheRead": 0.875, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "openai/o3-mini", + "name": "o3-mini", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 1.1, + "output": 4.4, + "cacheRead": 0.55, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "openai/o3-pro", + "name": "o3 Pro", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 20, + "output": 80, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "openai/o4-mini", + "name": "o4-mini", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.1, + "output": 4.4, + "cacheRead": 0.275, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 100000 + }, + { + "id": "particle/particle-1", + "name": "Particle-1", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.125, + "output": 0.5, + "cacheRead": 0.015, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "poolside/laguna-s-2.1", + "name": "Laguna S 2.1", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.09, + "output": 0.18, + "cacheRead": 0.009, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "poolside/laguna-s-2.1-free", + "name": "Laguna S 2.1 Free", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 32768 + }, + { + "id": "quiverai/arrow-2", + "name": "Arrow 2", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.39999999999999997, + "cacheWrite": 5 + }, + "contextWindow": 131072, + "maxTokens": 131072 + }, + { + "id": "quiverai/arrow-2-telos", + "name": "Arrow 2 Telos", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 6, + "output": 30, + "cacheRead": 0.6, + "cacheWrite": 7.5 + }, + "contextWindow": 131072, + "maxTokens": 131072 + }, + { + "id": "reflection/beam", + "name": "Beam 1.0", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "reflection/beam-free", + "name": "Beam 1.0 (Free)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "sakana/fugu-max", + "name": "Fugu Max", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.25, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 1000000 + }, + { + "id": "sakana/fugu-ultra", + "name": "Fugu Ultra", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 30, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 1000000 + }, + { + "id": "sakana/fugu-ultra-v2", + "name": "Fugu Ultra v2", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 30, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 1000000 + }, + { + "id": "sakana/namazu", + "name": "Sakana Namazu", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.95, + "output": 4, + "cacheRead": 0.15, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 256000 + }, + { + "id": "spacexai/grok-4.20-multi-agent", + "name": "Grok 4.20 Multi-Agent", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 2.5, + "cacheRead": 0.19999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 2000000, + "maxTokens": 2000000 + }, + { + "id": "spacexai/grok-4.20-multi-agent-batch", + "name": "Grok 4.20 Multi-Agent (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 2, + "cacheRead": 0.16, + "cacheWrite": 0 + }, + "contextWindow": 2000000, + "maxTokens": 2000000 + }, + { + "id": "spacexai/grok-4.20-multi-agent-beta", + "name": "Grok 4.20 Multi Agent Beta", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 2.5, + "cacheRead": 0.19999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 2000000, + "maxTokens": 2000000 + }, + { + "id": "spacexai/grok-4.20-non-reasoning", + "name": "Grok 4.20 Non-Reasoning", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 2.5, + "cacheRead": 0.19999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 2000000, + "maxTokens": 2000000 + }, + { + "id": "spacexai/grok-4.20-non-reasoning-batch", + "name": "Grok 4.20 Non-Reasoning (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 2, + "cacheRead": 0.16, + "cacheWrite": 0 + }, + "contextWindow": 2000000, + "maxTokens": 2000000 + }, + { + "id": "spacexai/grok-4.20-non-reasoning-beta", + "name": "Grok 4.20 Beta Non-Reasoning", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 2.5, + "cacheRead": 0.19999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 2000000, + "maxTokens": 2000000 + }, + { + "id": "spacexai/grok-4.20-reasoning", + "name": "Grok 4.20 Reasoning", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 2.5, + "cacheRead": 0.19999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 2000000, + "maxTokens": 2000000 + }, + { + "id": "spacexai/grok-4.20-reasoning-batch", + "name": "Grok 4.20 Reasoning (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 2, + "cacheRead": 0.16, + "cacheWrite": 0 + }, + "contextWindow": 2000000, + "maxTokens": 2000000 + }, + { + "id": "spacexai/grok-4.20-reasoning-beta", + "name": "Grok 4.20 Beta Reasoning", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 2.5, + "cacheRead": 0.19999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 2000000, + "maxTokens": 2000000 + }, + { + "id": "spacexai/grok-4.3", + "name": "Grok 4.3", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 2.5, + "cacheRead": 0.19999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 1000000 + }, + { + "id": "spacexai/grok-4.3-batch", + "name": "Grok 4.3 (Batch)", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 2, + "cacheRead": 0.16, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 1000000 + }, + { + "id": "spacexai/grok-4.5", + "name": "Grok 4.5", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.3, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 500000 + }, + { + "id": "spacexai/grok-4.6", + "name": "Grok 4.6", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 500000 + }, + { + "id": "spacexai/grok-4.7", + "name": "Grok 4.7", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 500000 + }, + { + "id": "spacexai/grok-build-0.1", + "name": "Grok Build 0.1", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 2, + "cacheRead": 0.19999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 256000 + }, + { + "id": "spacexai/grok-voice-3.0", + "name": "Grok Voice 3.0", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 4096, + "maxTokens": 4096 + }, + { + "id": "stealth/cat-jam", + "name": "Cat Jam", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "stealth/glyph-cluster", + "name": "Glyph Cluster", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 256000 + }, + { + "id": "stepfun/step-3.7-flash", + "name": "Step 3.7 Flash", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.19999999999999998, + "output": 1.15, + "cacheRead": 0.04, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 256000 + }, + { + "id": "stepfun/step-5-preview", + "name": "Step 5 Preview", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 2.7, + "cacheRead": 0.09999999999999999, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 1048576 + }, + { + "id": "tencent/hy3", + "name": "Hy3", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.14, + "output": 0.58, + "cacheRead": 0.035, + "cacheWrite": 0 + }, + "contextWindow": 262144, + "maxTokens": 262144 + }, + { + "id": "tencent/hy4-preview", + "name": "Tencent Hy4 Preview", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.834, + "output": 2.501, + "cacheRead": 0.041999999999999996, + "cacheWrite": 0 + }, + "contextWindow": 1024000, + "maxTokens": 64000 + }, + { + "id": "thinkingmachines/inkling", + "name": "Inkling", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 4.05, + "cacheRead": 0.16999999999999998, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 256000 + }, + { + "id": "thinkingmachines/inkling-small", + "name": "Inkling Small", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.44999999999999996, + "output": 1.2, + "cacheRead": 0.09999999999999999, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 1000000 + }, + { + "id": "xiaomi/mimo-v2.5", + "name": "MiMo M2.5", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.119, + "output": 0.238, + "cacheRead": 0.0025, + "cacheWrite": 0 + }, + "contextWindow": 1050000, + "maxTokens": 131100 + }, + { + "id": "xiaomi/mimo-v2.5-pro", + "name": "MiMo V2.5 Pro", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.3045, + "output": 0.609, + "cacheRead": 0.0028, + "cacheWrite": 0 + }, + "contextWindow": 1050000, + "maxTokens": 131000 + }, + { + "id": "xiaomi/mimo-v2.6-flash", + "name": "MiMo V2.6 Flash", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.14, + "output": 0.28, + "cacheRead": 0.0028, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "xiaomi/mimo-v2.6-pro", + "name": "MiMo V2.6 Pro", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.435, + "output": 0.87, + "cacheRead": 0.0036, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "xiaomi/mimo-v2.6-pro-ultraspeed", + "name": "MiMo V2.6 Pro UltraSpeed", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4.35, + "output": 8.7, + "cacheRead": 0.036, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "zai/glm-4.5", + "name": "GLM 4.5", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.6, + "output": 2.2, + "cacheRead": 0.11, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 96000 + }, + { + "id": "zai/glm-4.5-air", + "name": "GLM 4.5 Air", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.19999999999999998, + "output": 1.1, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 96000 + }, + { + "id": "zai/glm-4.5v", + "name": "GLM 4.5V", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.6, + "output": 1.7999999999999998, + "cacheRead": 0.11, + "cacheWrite": 0 + }, + "contextWindow": 66000, + "maxTokens": 16000 + }, + { + "id": "zai/glm-4.6", + "name": "GLM 4.6", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.6, + "output": 2.2, + "cacheRead": 0.11, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 96000 + }, + { + "id": "zai/glm-4.7", + "name": "GLM 4.7", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.6, + "output": 2.2, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 120000 + }, + { + "id": "zai/glm-4.7-flash", + "name": "GLM 4.7 Flash", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.07, + "output": 0.39999999999999997, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 131000 + }, + { + "id": "zai/glm-4.7-flashx", + "name": "GLM 4.7 FlashX", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.06, + "output": 0.39999999999999997, + "cacheRead": 0.01, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 128000 + }, + { + "id": "zai/glm-5", + "name": "GLM 5", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 1, + "output": 3.1999999999999997, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 202800, + "maxTokens": 131100 + }, + { + "id": "zai/glm-5-turbo", + "name": "GLM 5 Turbo", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 1.2, + "output": 4, + "cacheRead": 0.24, + "cacheWrite": 0 + }, + "contextWindow": 202800, + "maxTokens": 131100 + }, + { + "id": "zai/glm-5.1", + "name": "GLM 5.1", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 1.4, + "output": 4.4, + "cacheRead": 0.26, + "cacheWrite": 0 + }, + "contextWindow": 202800, + "maxTokens": 64000 + }, + { + "id": "zai/glm-5.2", + "name": "GLM 5.2", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 0.7999999999999999, + "output": 2.5500000000000003, + "cacheRead": 0.16, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "zai/glm-5.2-fast", + "name": "GLM 5.2 Fast", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 2.8, + "output": 8.8, + "cacheRead": 0.56, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "zai/glm-5.3", + "name": "GLM 5.3", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 1.4, + "output": 4.4, + "cacheRead": 0.14, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 1000000 + }, + { + "id": "zai/glm-5.3-fast", + "name": "GLM 5.3 Fast", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 2.0999999999999996, + "output": 6.6000000000000005, + "cacheRead": 0.21, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 262144 + }, + { + "id": "zai/glm-5.3-flash", + "name": "GLM 5.3 Flash", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.15, + "output": 0.5, + "cacheRead": 0.03, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131000 + }, + { + "id": "zai/glm-5.3-flashx", + "name": "GLM 5.3 FlashX", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.37, + "output": 1.25, + "cacheRead": 0.075, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "zai/glm-5v-turbo", + "name": "GLM 5V Turbo", + "api": "anthropic-messages", + "provider": "vercel-ai-gateway", + "baseUrl": "https://ai-gateway.vercel.sh", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.2, + "output": 4, + "cacheRead": 0.24, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 128000 + }, + { + "id": "auto", + "name": "Auto (WorkBuddy)", + "api": "openai-completions", + "provider": "workbuddy", + "baseUrl": "https://www.workbuddy.ai/v2", + "compat": { + "supportsDeveloperRole": false, + "maxTokensField": "max_tokens", + "supportsUsageInStreaming": true, + "requiresSystemMessageFirst": true + }, + "reasoning": false, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 168000, + "maxTokens": 32000 + }, + { + "id": "claude-opus-4.6", + "name": "Claude Opus 4.6 (WorkBuddy)", + "api": "openai-completions", + "provider": "workbuddy", + "baseUrl": "https://www.workbuddy.ai/v2", + "compat": { + "supportsDeveloperRole": false, + "maxTokensField": "max_tokens", + "supportsUsageInStreaming": true, + "requiresSystemMessageFirst": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5", + "name": "Claude Opus 5 (WorkBuddy)", + "api": "openai-completions", + "provider": "workbuddy", + "baseUrl": "https://www.workbuddy.ai/v2", + "compat": { + "supportsDeveloperRole": false, + "maxTokensField": "max_tokens", + "supportsUsageInStreaming": true, + "requiresSystemMessageFirst": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-4.6", + "name": "Claude Sonnet 4.6 (WorkBuddy)", + "api": "openai-completions", + "provider": "workbuddy", + "baseUrl": "https://www.workbuddy.ai/v2", + "compat": { + "supportsDeveloperRole": false, + "maxTokensField": "max_tokens", + "supportsUsageInStreaming": true, + "requiresSystemMessageFirst": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "deepseek-v3-0324", + "name": "DeepSeek-V3 0324 (WorkBuddy)", + "api": "openai-completions", + "provider": "workbuddy", + "baseUrl": "https://www.workbuddy.ai/v2", + "compat": { + "supportsDeveloperRole": false, + "maxTokensField": "max_tokens", + "supportsUsageInStreaming": true, + "requiresSystemMessageFirst": true + }, + "reasoning": false, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 8192 + }, + { + "id": "deepseek-v4.1-flash", + "name": "DeepSeek V4.1 Flash 1017 (WorkBuddy)", + "api": "openai-completions", + "provider": "workbuddy", + "baseUrl": "https://www.workbuddy.ai/v2", + "compat": { + "supportsDeveloperRole": false, + "maxTokensField": "max_tokens", + "supportsUsageInStreaming": true, + "requiresSystemMessageFirst": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gemini-3.1-pro", + "name": "Gemini-3.1-Pro (WorkBuddy)", + "api": "openai-completions", + "provider": "workbuddy", + "baseUrl": "https://www.workbuddy.ai/v2", + "compat": { + "supportsDeveloperRole": false, + "maxTokensField": "max_tokens", + "supportsUsageInStreaming": true, + "requiresSystemMessageFirst": true, + "supportsReasoningEffort": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 400000, + "maxTokens": 64000 + }, + { + "id": "gemini-3.5-flash", + "name": "Gemini-3.5-Flash (WorkBuddy)", + "api": "openai-completions", + "provider": "workbuddy", + "baseUrl": "https://www.workbuddy.ai/v2", + "compat": { + "supportsDeveloperRole": false, + "maxTokensField": "max_tokens", + "supportsUsageInStreaming": true, + "requiresSystemMessageFirst": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 65536 + }, + { + "id": "gemini-3.8-flash", + "name": "Gemini-3.8-Flash (WorkBuddy)", + "api": "openai-completions", + "provider": "workbuddy", + "baseUrl": "https://www.workbuddy.ai/v2", + "compat": { + "supportsDeveloperRole": false, + "maxTokensField": "max_tokens", + "supportsUsageInStreaming": true, + "requiresSystemMessageFirst": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 65536 + }, + { + "id": "glm-5.1", + "name": "GLM-5.1 (WorkBuddy)", + "api": "openai-completions", + "provider": "workbuddy", + "baseUrl": "https://www.workbuddy.ai/v2", + "compat": { + "supportsDeveloperRole": false, + "maxTokensField": "max_tokens", + "supportsUsageInStreaming": true, + "requiresSystemMessageFirst": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 48000 + }, + { + "id": "glm-5.2", + "name": "GLM-5.2 (WorkBuddy)", + "api": "openai-completions", + "provider": "workbuddy", + "baseUrl": "https://www.workbuddy.ai/v2", + "compat": { + "supportsDeveloperRole": false, + "maxTokensField": "max_tokens", + "supportsUsageInStreaming": true, + "requiresSystemMessageFirst": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": "xhigh", + "max": "xhigh", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 48000 + }, + { + "id": "glm-5.3", + "name": "GLM-5.3 (WorkBuddy)", + "api": "openai-completions", + "provider": "workbuddy", + "baseUrl": "https://www.workbuddy.ai/v2", + "compat": { + "supportsDeveloperRole": false, + "maxTokensField": "max_tokens", + "supportsUsageInStreaming": true, + "requiresSystemMessageFirst": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 48000 + }, + { + "id": "glm-5v-turbo", + "name": "GLM-5v-Turbo (WorkBuddy)", + "api": "openai-completions", + "provider": "workbuddy", + "baseUrl": "https://www.workbuddy.ai/v2", + "compat": { + "supportsDeveloperRole": false, + "maxTokensField": "max_tokens", + "supportsUsageInStreaming": true, + "requiresSystemMessageFirst": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 38000 + }, + { + "id": "gpt-5.3-codex", + "name": "GPT-5.3-Codex (WorkBuddy)", + "api": "openai-completions", + "provider": "workbuddy", + "baseUrl": "https://www.workbuddy.ai/v2", + "compat": { + "supportsDeveloperRole": false, + "maxTokensField": "max_tokens", + "supportsUsageInStreaming": true, + "requiresSystemMessageFirst": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.4", + "name": "GPT-5.4 (WorkBuddy)", + "api": "openai-completions", + "provider": "workbuddy", + "baseUrl": "https://www.workbuddy.ai/v2", + "compat": { + "supportsDeveloperRole": false, + "maxTokensField": "max_tokens", + "supportsUsageInStreaming": true, + "requiresSystemMessageFirst": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.5", + "name": "GPT-5.5 (WorkBuddy)", + "api": "openai-completions", + "provider": "workbuddy", + "baseUrl": "https://www.workbuddy.ai/v2", + "compat": { + "supportsDeveloperRole": false, + "maxTokensField": "max_tokens", + "supportsUsageInStreaming": true, + "requiresSystemMessageFirst": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 72000 + }, + { + "id": "gpt-5.6-luna", + "name": "GPT-5.6-Luna (WorkBuddy)", + "api": "openai-completions", + "provider": "workbuddy", + "baseUrl": "https://www.workbuddy.ai/v2", + "compat": { + "supportsDeveloperRole": false, + "maxTokensField": "max_tokens", + "supportsUsageInStreaming": true, + "requiresSystemMessageFirst": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "xhigh", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.6-sol", + "name": "GPT-5.6-Sol (WorkBuddy)", + "api": "openai-completions", + "provider": "workbuddy", + "baseUrl": "https://www.workbuddy.ai/v2", + "compat": { + "supportsDeveloperRole": false, + "maxTokensField": "max_tokens", + "supportsUsageInStreaming": true, + "requiresSystemMessageFirst": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "xhigh", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-5.6-terra", + "name": "GPT-5.6-Terra (WorkBuddy)", + "api": "openai-completions", + "provider": "workbuddy", + "baseUrl": "https://www.workbuddy.ai/v2", + "compat": { + "supportsDeveloperRole": false, + "maxTokensField": "max_tokens", + "supportsUsageInStreaming": true, + "requiresSystemMessageFirst": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "xhigh", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gpt-6-astra", + "name": "GPT-6 Astra (WorkBuddy)", + "api": "openai-completions", + "provider": "workbuddy", + "baseUrl": "https://www.workbuddy.ai/v2", + "compat": { + "supportsDeveloperRole": false, + "maxTokensField": "max_tokens", + "supportsUsageInStreaming": true, + "requiresSystemMessageFirst": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1050000, + "maxTokens": 128000 + }, + { + "id": "grok-4.6", + "name": "Grok 4.6 (WorkBuddy)", + "api": "openai-completions", + "provider": "workbuddy", + "baseUrl": "https://www.workbuddy.ai/v2", + "compat": { + "supportsDeveloperRole": false, + "maxTokensField": "max_tokens", + "supportsUsageInStreaming": true, + "requiresSystemMessageFirst": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "xhigh", + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 500000 + }, + { + "id": "hy3", + "name": "Hy3 (WorkBuddy)", + "api": "openai-completions", + "provider": "workbuddy", + "baseUrl": "https://www.workbuddy.ai/v2", + "compat": { + "supportsDeveloperRole": false, + "maxTokensField": "max_tokens", + "supportsUsageInStreaming": true, + "requiresSystemMessageFirst": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 192000, + "maxTokens": 64000 + }, + { + "id": "hy4-preview", + "name": "Hunyuan hy4 Preview (WorkBuddy)", + "api": "openai-completions", + "provider": "workbuddy", + "baseUrl": "https://www.workbuddy.ai/v2", + "compat": { + "supportsDeveloperRole": false, + "maxTokensField": "max_tokens", + "supportsUsageInStreaming": true, + "requiresSystemMessageFirst": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 64000 + }, + { + "id": "kimi-k2.5", + "name": "Kimi-K2.5 (WorkBuddy)", + "api": "openai-completions", + "provider": "workbuddy", + "baseUrl": "https://www.workbuddy.ai/v2", + "compat": { + "supportsDeveloperRole": false, + "maxTokensField": "max_tokens", + "supportsUsageInStreaming": true, + "requiresSystemMessageFirst": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 164000, + "maxTokens": 32000 + }, + { + "id": "kimi-k2.6", + "name": "Kimi-K2.6 (WorkBuddy)", + "api": "openai-completions", + "provider": "workbuddy", + "baseUrl": "https://www.workbuddy.ai/v2", + "compat": { + "supportsDeveloperRole": false, + "maxTokensField": "max_tokens", + "supportsUsageInStreaming": true, + "requiresSystemMessageFirst": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 32000 + }, + { + "id": "kimi-k3", + "name": "Kimi-K3 (WorkBuddy)", + "api": "openai-completions", + "provider": "workbuddy", + "baseUrl": "https://www.workbuddy.ai/v2", + "compat": { + "supportsDeveloperRole": false, + "maxTokensField": "max_tokens", + "supportsUsageInStreaming": true, + "requiresSystemMessageFirst": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 32000 + }, + { + "id": "minimax-m3", + "name": "MiniMax-M3 (WorkBuddy)", + "api": "openai-completions", + "provider": "workbuddy", + "baseUrl": "https://www.workbuddy.ai/v2", + "compat": { + "supportsDeveloperRole": false, + "maxTokensField": "max_tokens", + "supportsUsageInStreaming": true, + "requiresSystemMessageFirst": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": null, + "medium": "medium", + "high": null, + "xhigh": null, + "max": null, + "ultra": null + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 512000, + "maxTokens": 128000 + }, + { + "id": "grok-3", + "name": "Grok 3", + "api": "openai-completions", + "provider": "xai", + "baseUrl": "https://api.x.ai/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.75, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 8192 + }, + { + "id": "grok-3-fast", + "name": "Grok 3 Fast", + "api": "openai-completions", + "provider": "xai", + "baseUrl": "https://api.x.ai/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 1.25, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 8192 + }, + { + "id": "grok-4.20-0309-non-reasoning", + "name": "Grok 4.20 (Non-Reasoning)", + "api": "openai-completions", + "provider": "xai", + "baseUrl": "https://api.x.ai/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 2.5, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 30000 + }, + { + "id": "grok-4.20-0309-reasoning", + "name": "Grok 4.20 (Reasoning)", + "api": "openai-completions", + "provider": "xai", + "baseUrl": "https://api.x.ai/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 2.5, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 30000 + }, + { + "id": "grok-4.3", + "name": "Grok 4.3", + "api": "openai-completions", + "provider": "xai", + "baseUrl": "https://api.x.ai/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1.25, + "output": 2.5, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 30000, + "thinkingLevelMap": { + "off": "none", + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": "high", + "ultra": "high" + }, + "compat": { + "supportsReasoningEffort": true + } + }, + { + "id": "grok-4.5", + "name": "Grok 4.5", + "api": "openai-completions", + "provider": "xai", + "baseUrl": "https://api.x.ai/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.3, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 500000, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": null, + "max": "high", + "ultra": "high" + }, + "compat": { + "supportsReasoningEffort": true + } + }, + { + "id": "grok-4.6", + "name": "Grok 4.6", + "api": "openai-completions", + "provider": "xai", + "baseUrl": "https://api.x.ai/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "xhigh", + "ultra": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 500000, + "compat": { + "supportsReasoningEffort": true + } + }, + { + "id": "grok-4.7", + "name": "Grok 4.7", + "api": "openai-completions", + "provider": "xai", + "baseUrl": "https://api.x.ai/v1", + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "xhigh", + "ultra": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 6, + "cacheRead": 0.5, + "cacheWrite": 0 + }, + "contextWindow": 500000, + "maxTokens": 500000, + "compat": { + "supportsReasoningEffort": true + } + }, + { + "id": "grok-build-0.1", + "name": "Grok Build 0.1", + "api": "openai-completions", + "provider": "xai", + "baseUrl": "https://api.x.ai/v1", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 2, + "cacheRead": 0.2, + "cacheWrite": 0 + }, + "contextWindow": 256000, + "maxTokens": 256000 + }, + { + "id": "grok-code-fast-1", + "name": "Grok Code Fast 1", + "api": "openai-completions", + "provider": "xai", + "baseUrl": "https://api.x.ai/v1", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0.2, + "output": 1.5, + "cacheRead": 0.02, + "cacheWrite": 0 + }, + "contextWindow": 32768, + "maxTokens": 8192 + }, + { + "id": "mimo-v2.5", + "name": "MiMo-V2.5", + "api": "openai-completions", + "provider": "xiaomi", + "baseUrl": "https://api.xiaomimimo.com/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.14, + "output": 0.28, + "cacheRead": 0.0028, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.5-pro", + "name": "MiMo-V2.5-Pro", + "api": "openai-completions", + "provider": "xiaomi", + "baseUrl": "https://api.xiaomimimo.com/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.435, + "output": 0.87, + "cacheRead": 0.0036, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.5-pro-ultraspeed", + "name": "MiMo-V2.5-Pro-UltraSpeed", + "api": "openai-completions", + "provider": "xiaomi", + "baseUrl": "https://api.xiaomimimo.com/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 1.305, + "output": 2.61, + "cacheRead": 0.0108, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.6-flash", + "name": "MiMo-V2.6-Flash", + "api": "openai-completions", + "provider": "xiaomi", + "baseUrl": "https://api.xiaomimimo.com/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.14, + "output": 0.28, + "cacheRead": 0.0028, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.6-pro", + "name": "MiMo-V2.6-Pro", + "api": "openai-completions", + "provider": "xiaomi", + "baseUrl": "https://api.xiaomimimo.com/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.435, + "output": 0.87, + "cacheRead": 0.0036, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.6-pro-ultraspeed", + "name": "MiMo-V2.6-Pro-UltraSpeed", + "api": "openai-completions", + "provider": "xiaomi", + "baseUrl": "https://api.xiaomimimo.com/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4.35, + "output": 8.7, + "cacheRead": 0.036, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.5", + "name": "MiMo-V2.5", + "api": "openai-completions", + "provider": "xiaomi-token-plan-ams", + "baseUrl": "https://token-plan-ams.xiaomimimo.com/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.14, + "output": 0.28, + "cacheRead": 0.0028, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.5-pro", + "name": "MiMo-V2.5-Pro", + "api": "openai-completions", + "provider": "xiaomi-token-plan-ams", + "baseUrl": "https://token-plan-ams.xiaomimimo.com/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.435, + "output": 0.87, + "cacheRead": 0.0036, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.5-pro-ultraspeed", + "name": "MiMo-V2.5-Pro-UltraSpeed", + "api": "openai-completions", + "provider": "xiaomi-token-plan-ams", + "baseUrl": "https://token-plan-ams.xiaomimimo.com/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 1.305, + "output": 2.61, + "cacheRead": 0.0108, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.6-flash", + "name": "MiMo-V2.6-Flash", + "api": "openai-completions", + "provider": "xiaomi-token-plan-ams", + "baseUrl": "https://token-plan-ams.xiaomimimo.com/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.14, + "output": 0.28, + "cacheRead": 0.0028, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.6-pro", + "name": "MiMo-V2.6-Pro", + "api": "openai-completions", + "provider": "xiaomi-token-plan-ams", + "baseUrl": "https://token-plan-ams.xiaomimimo.com/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.435, + "output": 0.87, + "cacheRead": 0.0036, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.6-pro-ultraspeed", + "name": "MiMo-V2.6-Pro-UltraSpeed", + "api": "openai-completions", + "provider": "xiaomi-token-plan-ams", + "baseUrl": "https://token-plan-ams.xiaomimimo.com/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4.35, + "output": 8.7, + "cacheRead": 0.036, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.5", + "name": "MiMo-V2.5", + "api": "openai-completions", + "provider": "xiaomi-token-plan-cn", + "baseUrl": "https://token-plan-cn.xiaomimimo.com/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.14, + "output": 0.28, + "cacheRead": 0.0028, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.5-pro", + "name": "MiMo-V2.5-Pro", + "api": "openai-completions", + "provider": "xiaomi-token-plan-cn", + "baseUrl": "https://token-plan-cn.xiaomimimo.com/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.435, + "output": 0.87, + "cacheRead": 0.0036, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.5-pro-ultraspeed", + "name": "MiMo-V2.5-Pro-UltraSpeed", + "api": "openai-completions", + "provider": "xiaomi-token-plan-cn", + "baseUrl": "https://token-plan-cn.xiaomimimo.com/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 1.305, + "output": 2.61, + "cacheRead": 0.0108, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.6-flash", + "name": "MiMo-V2.6-Flash", + "api": "openai-completions", + "provider": "xiaomi-token-plan-cn", + "baseUrl": "https://token-plan-cn.xiaomimimo.com/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.14, + "output": 0.28, + "cacheRead": 0.0028, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.6-pro", + "name": "MiMo-V2.6-Pro", + "api": "openai-completions", + "provider": "xiaomi-token-plan-cn", + "baseUrl": "https://token-plan-cn.xiaomimimo.com/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.435, + "output": 0.87, + "cacheRead": 0.0036, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.6-pro-ultraspeed", + "name": "MiMo-V2.6-Pro-UltraSpeed", + "api": "openai-completions", + "provider": "xiaomi-token-plan-cn", + "baseUrl": "https://token-plan-cn.xiaomimimo.com/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4.35, + "output": 8.7, + "cacheRead": 0.036, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.5", + "name": "MiMo-V2.5", + "api": "openai-completions", + "provider": "xiaomi-token-plan-sgp", + "baseUrl": "https://token-plan-sgp.xiaomimimo.com/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.14, + "output": 0.28, + "cacheRead": 0.0028, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.5-pro", + "name": "MiMo-V2.5-Pro", + "api": "openai-completions", + "provider": "xiaomi-token-plan-sgp", + "baseUrl": "https://token-plan-sgp.xiaomimimo.com/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0.435, + "output": 0.87, + "cacheRead": 0.0036, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.5-pro-ultraspeed", + "name": "MiMo-V2.5-Pro-UltraSpeed", + "api": "openai-completions", + "provider": "xiaomi-token-plan-sgp", + "baseUrl": "https://token-plan-sgp.xiaomimimo.com/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 1.305, + "output": 2.61, + "cacheRead": 0.0108, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.6-flash", + "name": "MiMo-V2.6-Flash", + "api": "openai-completions", + "provider": "xiaomi-token-plan-sgp", + "baseUrl": "https://token-plan-sgp.xiaomimimo.com/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.14, + "output": 0.28, + "cacheRead": 0.0028, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.6-pro", + "name": "MiMo-V2.6-Pro", + "api": "openai-completions", + "provider": "xiaomi-token-plan-sgp", + "baseUrl": "https://token-plan-sgp.xiaomimimo.com/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0.435, + "output": 0.87, + "cacheRead": 0.0036, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "mimo-v2.6-pro-ultraspeed", + "name": "MiMo-V2.6-Pro-UltraSpeed", + "api": "openai-completions", + "provider": "xiaomi-token-plan-sgp", + "baseUrl": "https://token-plan-sgp.xiaomimimo.com/v1", + "compat": { + "requiresReasoningContentOnAssistantMessages": true, + "thinkingFormat": "deepseek" + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4.35, + "output": 8.7, + "cacheRead": 0.036, + "cacheWrite": 0 + }, + "contextWindow": 1048576, + "maxTokens": 131072 + }, + { + "id": "glm-4.7", + "name": "GLM-4.7", + "api": "openai-completions", + "provider": "zai", + "baseUrl": "https://api.z.ai/api/coding/paas/v4", + "compat": { + "supportsDeveloperRole": false, + "thinkingFormat": "zai", + "zaiToolStream": true + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 204800, + "maxTokens": 131072 + }, + { + "id": "glm-5-turbo", + "name": "GLM-5-Turbo", + "api": "openai-completions", + "provider": "zai", + "baseUrl": "https://api.z.ai/api/coding/paas/v4", + "compat": { + "supportsDeveloperRole": false, + "thinkingFormat": "zai", + "zaiToolStream": true + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 131072 + }, + { + "id": "glm-5.2", + "name": "GLM-5.2", + "api": "openai-completions", + "provider": "zai", + "baseUrl": "https://api.z.ai/api/coding/paas/v4", + "compat": { + "supportsDeveloperRole": false, + "thinkingFormat": "zai", + "supportsReasoningEffort": true, + "zaiToolStream": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "glm-5.2-highspeed", + "name": "GLM-5.2 Highspeed", + "api": "openai-completions", + "provider": "zai", + "baseUrl": "https://api.z.ai/api/coding/paas/v4", + "compat": { + "supportsDeveloperRole": false, + "thinkingFormat": "zai", + "supportsReasoningEffort": true, + "zaiToolStream": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "glm-5.3", + "name": "GLM-5.3", + "api": "openai-completions", + "provider": "zai", + "baseUrl": "https://api.z.ai/api/coding/paas/v4", + "compat": { + "supportsDeveloperRole": false, + "thinkingFormat": "zai", + "supportsReasoningEffort": true, + "zaiToolStream": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "glm-5.3-flash", + "name": "GLM-5.3-Flash", + "api": "openai-completions", + "provider": "zai", + "baseUrl": "https://api.z.ai/api/coding/paas/v4", + "compat": { + "supportsDeveloperRole": false, + "thinkingFormat": "zai", + "supportsReasoningEffort": true, + "zaiToolStream": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "glm-5.3-highspeed", + "name": "GLM-5.3 Highspeed", + "api": "openai-completions", + "provider": "zai", + "baseUrl": "https://api.z.ai/api/coding/paas/v4", + "compat": { + "supportsDeveloperRole": false, + "thinkingFormat": "zai", + "supportsReasoningEffort": true, + "zaiToolStream": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "glm-4.7", + "name": "GLM-4.7", + "api": "openai-completions", + "provider": "zai-coding-cn", + "baseUrl": "https://open.bigmodel.cn/api/coding/paas/v4", + "compat": { + "supportsDeveloperRole": false, + "thinkingFormat": "zai", + "zaiToolStream": true + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 204800, + "maxTokens": 131072 + }, + { + "id": "glm-5-turbo", + "name": "GLM-5-Turbo", + "api": "openai-completions", + "provider": "zai-coding-cn", + "baseUrl": "https://open.bigmodel.cn/api/coding/paas/v4", + "compat": { + "supportsDeveloperRole": false, + "thinkingFormat": "zai", + "zaiToolStream": true + }, + "reasoning": true, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 131072 + }, + { + "id": "glm-5.2", + "name": "GLM-5.2", + "api": "openai-completions", + "provider": "zai-coding-cn", + "baseUrl": "https://open.bigmodel.cn/api/coding/paas/v4", + "compat": { + "supportsDeveloperRole": false, + "thinkingFormat": "zai", + "supportsReasoningEffort": true, + "zaiToolStream": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "glm-5.2-highspeed", + "name": "GLM-5.2 Highspeed", + "api": "openai-completions", + "provider": "zai-coding-cn", + "baseUrl": "https://open.bigmodel.cn/api/coding/paas/v4", + "compat": { + "supportsDeveloperRole": false, + "thinkingFormat": "zai", + "supportsReasoningEffort": true, + "zaiToolStream": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "glm-5.3", + "name": "GLM-5.3", + "api": "openai-completions", + "provider": "zai-coding-cn", + "baseUrl": "https://open.bigmodel.cn/api/coding/paas/v4", + "compat": { + "supportsDeveloperRole": false, + "thinkingFormat": "zai", + "supportsReasoningEffort": true, + "zaiToolStream": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "glm-5.3-flash", + "name": "GLM-5.3-Flash", + "api": "openai-completions", + "provider": "zai-coding-cn", + "baseUrl": "https://open.bigmodel.cn/api/coding/paas/v4", + "compat": { + "supportsDeveloperRole": false, + "thinkingFormat": "zai", + "supportsReasoningEffort": true, + "zaiToolStream": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "glm-5.3-highspeed", + "name": "GLM-5.3 Highspeed", + "api": "openai-completions", + "provider": "zai-coding-cn", + "baseUrl": "https://open.bigmodel.cn/api/coding/paas/v4", + "compat": { + "supportsDeveloperRole": false, + "thinkingFormat": "zai", + "supportsReasoningEffort": true, + "zaiToolStream": true + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 131072 + }, + { + "id": "claude-opus-4-7", + "name": "Zyloo Claude Opus 4.7", + "api": "openai-completions", + "provider": "zyloo", + "baseUrl": "https://api.zyloo.io/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-7-thinking", + "name": "Zyloo Claude Opus 4.7 Thinking", + "api": "openai-completions", + "provider": "zyloo", + "baseUrl": "https://api.zyloo.io/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 200000, + "maxTokens": 128000 + }, + { + "id": "deepseek-v4-pro", + "name": "Zyloo DeepSeek V4 Pro", + "api": "openai-completions", + "provider": "zyloo", + "baseUrl": "https://api.zyloo.io/v1", + "compat": { + "thinkingFormat": "deepseek", + "requiresReasoningContentOnAssistantMessages": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": null, + "medium": null, + "high": "high", + "xhigh": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "gemini-3.5-flash", + "name": "Zyloo Gemini 3.5 Flash", + "api": "openai-completions", + "provider": "zyloo", + "baseUrl": "https://api.zyloo.io/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 1000000, + "maxTokens": 8192 + }, + { + "id": "gpt-5.5", + "name": "Zyloo GPT-5.5", + "api": "openai-completions", + "provider": "zyloo", + "baseUrl": "https://api.zyloo.io/v1", + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 272000, + "maxTokens": 128000 + }, + { + "id": "grok-4.3", + "name": "Zyloo Grok 4.3", + "api": "openai-completions", + "provider": "zyloo", + "baseUrl": "https://api.zyloo.io/v1", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 131072, + "maxTokens": 8192 + } + ] +} diff --git a/native/omk-providers/src/anthropic.rs b/native/omk-providers/src/anthropic.rs index 69d90633d9..71777e7bc3 100644 --- a/native/omk-providers/src/anthropic.rs +++ b/native/omk-providers/src/anthropic.rs @@ -1,46 +1,6 @@ //! First offline Anthropic parity slice; not the full provider/auth surface. -use crate::json_parse::parse_sse_with_repair; +pub use crate::anthropic_stream::{Replay, Stream}; pub use crate::request::{Input, build_request}; -use crate::{ - reducer::Reducer, - sse::{Decoder, Frame}, -}; -use serde_json::{Value, json}; - -pub struct Replay { - pub events: Value, - pub result: Value, - pub tool_arguments: Value, -} -fn consume(reducer: &mut Reducer, frame: Frame) -> Result<(), String> { - if frame.event == "error" { - return Err(frame.data); - } - if ![ - "message_start", - "message_delta", - "message_stop", - "content_block_start", - "content_block_delta", - "content_block_stop", - ] - .contains(&frame.event.as_str()) - { - return Ok(()); - } - let event = parse_sse_with_repair(&frame.data).map_err(|error| { - let detail = error.to_string(); - format!( - "Could not parse Anthropic SSE event {}: {}; data={}; raw={}", - frame.event, - detail, - frame.data, - frame.raw.join("\\n") - ) - })?; - reducer.apply(event) -} - pub fn replay( model: &str, chunks: &[Vec], @@ -64,7 +24,10 @@ fn replay_internal( abort_after: Option, observe: bool, ) -> Result { - if model != "synthetic-anthropic" { + // Vision has a request-only oracle; do not admit unrecorded response/cancellation replay. + if model != "synthetic-anthropic" + && (model != "synthetic-anthropic-vision" || !chunks.is_empty() || abort_after.is_some()) + { return Err("unrecorded model".into()); } if chunks @@ -77,33 +40,16 @@ fn replay_internal( if abort_after.is_some_and(|n| n > chunks.len()) { return Err("invalid cancellation boundary".into()); } - let mut reducer = Reducer::new(model, observe); - let mut decoder = Decoder::default(); - let outcome = (|| { - if abort_after == Some(0) { - return Err("Request was aborted".into()); - } - for (index, chunk) in chunks.iter().enumerate() { - if abort_after == Some(index) { + let mut stream = Stream::recorded(model, observe); + if abort_after != Some(0) { + for chunk in chunks.iter().take(abort_after.unwrap_or(chunks.len())) { + if stream.feed(chunk).is_err() { break; } - for frame in decoder.feed(chunk, false)? { - consume(&mut reducer, frame)?; - } } - for frame in decoder.feed(&[], true)? { - consume(&mut reducer, frame)?; - } - if abort_after.is_some() && !(reducer.started && !reducer.stopped) { - return Err("Request was aborted".into()); - } - Ok(()) - })(); - let tool_arguments = json!(std::mem::take(&mut reducer.tool_arguments)); - let (events, result) = reducer.finish(outcome.err(), abort_after.is_some()); - Ok(Replay { - events, - result, - tool_arguments, - }) + } + Ok(stream.finish( + (abort_after == Some(0)).then(|| "Request was aborted".into()), + abort_after.is_some(), + )) } diff --git a/native/omk-providers/src/anthropic_stream.rs b/native/omk-providers/src/anthropic_stream.rs new file mode 100644 index 0000000000..c0f9ae93ad --- /dev/null +++ b/native/omk-providers/src/anthropic_stream.rs @@ -0,0 +1,110 @@ +// Incremental ownership of the existing Node-derived Anthropic decoder/reducer. +use crate::{ + json_parse::parse_sse_with_repair, + reducer::Reducer, + sse::{Decoder, Frame}, +}; +use serde_json::{Value, json}; + +fn consume(reducer: &mut Reducer, frame: Frame) -> Result<(), String> { + if frame.event == "error" { + return Err(frame.data); + } + if ![ + "message_start", + "message_delta", + "message_stop", + "content_block_start", + "content_block_delta", + "content_block_stop", + ] + .contains(&frame.event.as_str()) + { + return Ok(()); + } + let event = parse_sse_with_repair(&frame.data).map_err(|error| { + let detail = error.to_string(); + format!( + "Could not parse Anthropic SSE event {}: {}; data={}; raw={}", + frame.event, + detail, + frame.data, + frame.raw.join("\\n") + ) + })?; + reducer.apply(event) +} +pub struct Replay { + pub events: Value, + pub result: Value, + pub tool_arguments: Value, +} +/// Incremental semantic events for the recorded text model, without retaining wire chunks. +/// This projection excludes mutable partial snapshots, timestamps and cost. +pub struct Stream { + reducer: Reducer, + decoder: Decoder, + bytes: usize, + failure: Option, +} +impl Stream { + pub fn new(model: &str) -> Result { + if model != "synthetic-anthropic" { + return Err("unrecorded model".into()); + } + Ok(Self::recorded(model, false)) + } + pub(crate) fn recorded(model: &str, observe: bool) -> Self { + Self { + reducer: Reducer::new(model, observe), + decoder: Decoder::default(), + bytes: 0, + failure: None, + } + } + /// Failure is latched; drain prior events even when this call fails. + pub fn feed(&mut self, bytes: &[u8]) -> Result<(), String> { + if let Some(error) = &self.failure { + return Err(error.clone()); + } + let outcome = (|| { + self.bytes = self + .bytes + .checked_add(bytes.len()) + .filter(|n| *n <= 8 * 1024 * 1024) + .ok_or("stream exceeds 8 MiB")?; + self.decode(bytes, false) + })(); + if let Err(error) = &outcome { + self.failure = Some(error.clone()); + } + outcome + } + fn decode(&mut self, bytes: &[u8], eof: bool) -> Result<(), String> { + for frame in self.decoder.feed(bytes, eof)? { + consume(&mut self.reducer, frame)?; + } + Ok(()) + } + /// Move queued events out exactly once. Call after construction and each feed. + pub fn take_events(&mut self) -> Vec { + std::mem::take(&mut self.reducer.events) + } + /// Consumes the stream, appending exactly one terminal event to undrained events. + pub fn finish(mut self, error: Option, aborted: bool) -> Replay { + self.failure = self.failure.or(error); + if self.failure.is_none() { + self.failure = self.decode(&[], true).err(); + } + if self.failure.is_none() && aborted && !(self.reducer.started && !self.reducer.stopped) { + self.failure = Some("Request was aborted".into()); + } + let tool_arguments = json!(std::mem::take(&mut self.reducer.tool_arguments)); + let (events, result) = self.reducer.finish(self.failure, aborted); + Replay { + events, + result, + tool_arguments, + } + } +} diff --git a/native/omk-providers/src/auth.rs b/native/omk-providers/src/auth.rs new file mode 100644 index 0000000000..42be35f543 --- /dev/null +++ b/native/omk-providers/src/auth.rs @@ -0,0 +1,99 @@ +//! Read-only credential snapshots. The host owns file locks, environment selection and refresh. +use serde_json::Value; +use std::{collections::BTreeMap, fmt}; + +#[derive(Debug, PartialEq, Eq)] +pub enum Error { + InvalidInput, + UnavailableStore, + InvalidCredential, + CommandRequiresHost, + OAuthRequiresHost, +} +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str(match self { + Self::InvalidInput => "credential input exceeds its bound", + Self::UnavailableStore => "credential store unavailable", + Self::InvalidCredential => "invalid stored credential", + Self::CommandRequiresHost => "credential command requires host execution", + Self::OAuthRequiresHost => "OAuth credential requires host refresh ownership", + }) + } +} +impl std::error::Error for Error {} +/// Deliberately neither serializable nor printable. Exposure is an explicit caller action. +pub struct Secret(pub(crate) String); +impl Secret { + pub fn expose(&self) -> &str { + &self.0 + } +} +impl fmt::Debug for Secret { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str("[REDACTED]") + } +} +/// `environment` is already selected by the host's provider-specific environment policy. +pub struct KeySources<'a> { + pub runtime: Option<&'a str>, + pub environment: Option<&'a str>, + pub fallback: Option<&'a str>, + pub include_fallback: bool, +} +/// An unreadable/malformed store is retained as failure, never converted to an empty map. +pub struct Snapshot(Result, ()>); +impl Snapshot { + pub fn from_json(raw: Result, ()>) -> Self { + Self(raw.and_then(|text| { + let text = text.filter(|text| !text.is_empty()).unwrap_or("{}"); + if text.len() > 1024 * 1024 { + return Err(()); + } + let mut data: BTreeMap = serde_json::from_str(text).map_err(|_| ())?; + data.remove("grok-oauth-proxy"); + Ok(data) + })) + } + pub fn resolve( + &self, + provider: &str, + sources: KeySources<'_>, + env: impl Fn(&str) -> Option, + ) -> Result, Error> { + if let Some(key) = sources.runtime.filter(|key| !key.is_empty()) { + return bounded_secret(key).map(Some); + } + let data = self.0.as_ref().map_err(|_| Error::UnavailableStore)?; + if let Some(credential) = data.get(provider) { + match credential.get("type").and_then(Value::as_str) { + Some("api_key") => { + let key = credential + .get("key") + .and_then(Value::as_str) + .ok_or(Error::InvalidCredential)?; + // A missing referenced variable must not silently select another account. + return resolve_config(key, env); + } + Some("oauth") => return Err(Error::OAuthRequiresHost), + _ => return Err(Error::InvalidCredential), + } + } + if let Some(key) = sources.environment.filter(|key| !key.is_empty()) { + return bounded_secret(key).map(Some); + } + if sources.include_fallback + && let Some(config) = sources.fallback + { + return resolve_config(config, env); + } + Ok(None) + } +} +pub(crate) fn bounded_secret(value: &str) -> Result { + if value.len() > 65536 { + return Err(Error::InvalidInput); + } + Ok(Secret(value.into())) +} +pub use crate::config_value::resolve_config; diff --git a/native/omk-providers/src/bin/provider.rs b/native/omk-providers/src/bin/provider.rs new file mode 100644 index 0000000000..c2668b0e23 --- /dev/null +++ b/native/omk-providers/src/bin/provider.rs @@ -0,0 +1,127 @@ +use omk_providers::{ + anthropic::Input, + auth::{KeySources, Snapshot}, + catalog::Catalog, + dispatch, + transport::{Cancellation, Limits, Transport}, +}; +use serde::Deserialize; +use serde_json::json; +use std::{ + collections::BTreeMap, + io::{self, Read, Write}, + time::Duration, +}; +#[derive(Deserialize)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +struct CatalogInput { + overlay: Option, + #[serde(default)] + providers: Vec, + #[serde(default)] + authenticated: Vec, +} +#[derive(Deserialize)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +struct StreamInput { + overlay: Option, + provider: String, + input: Input, + store: Option, + runtime: Option, + environment: Option, + #[serde(default)] + env: BTreeMap, + timeout_ms: Option, + max_response_bytes: Option, +} +fn run() -> Result<(), String> { + let args: Vec<_> = std::env::args().skip(1).collect(); + if args.len() != 1 || !matches!(args[0].as_str(), "catalog" | "stream") { + return Err("expected catalog or stream command".into()); + } + let mut raw = String::new(); + io::stdin() + .take(2 * 1024 * 1024 + 1) + .read_to_string(&mut raw) + .map_err(|_| "input read failed")?; + if raw.len() > 2 * 1024 * 1024 { + return Err("input exceeds 2 MiB".into()); + } + if args[0] == "catalog" { + let input: CatalogInput = + serde_json::from_str(&raw).map_err(|_| "invalid catalog input")?; + println!( + "{}", + Catalog::load(input.overlay.as_deref()).view(&input.providers, &input.authenticated) + ); + return Ok(()); + } + let input: StreamInput = serde_json::from_str(&raw).map_err(|_| "invalid stream input")?; + let timeout = input.timeout_ms.unwrap_or(30000); + if timeout == 0 || timeout > 30000 { + return Err("timeoutMs must be 1 through 30000".into()); + } + let bound = input.max_response_bytes.unwrap_or(8 * 1024 * 1024); + if bound > 8 * 1024 * 1024 { + return Err("response bound exceeds 8 MiB".into()); + } + let catalog = Catalog::load(input.overlay.as_deref()); + let snapshot = Snapshot::from_json(Ok(input.store.as_deref())); + let prepared = dispatch::prepare( + &catalog, + &input.provider, + &input.input, + &snapshot, + KeySources { + runtime: input.runtime.as_deref(), + environment: input.environment.as_deref(), + fallback: None, + include_fallback: true, + }, + |key| input.env.get(key).cloned(), + ) + .map_err(|e| e.to_string())?; + let runtime = tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + .map_err(|_| "runtime unavailable")?; + runtime.block_on(async { + let transport = Transport::new().map_err(|_| "transport unavailable")?; + let cancellation = Cancellation::default(); + let mut stdout = io::stdout().lock(); + let mut failed = false; + let result = prepared + .send( + &transport, + Limits { + deadline: tokio::time::Instant::now() + Duration::from_millis(timeout), + max_response_bytes: bound, + }, + &cancellation, + |event| { + if writeln!(stdout, "{}", json!({"event":event})) + .and_then(|()| stdout.flush()) + .is_err() + { + failed = true; + cancellation.cancel(); + } + }, + ) + .await + .map_err(|e| e.to_string())?; + if failed { + return Err("output failed".into()); + } + writeln!(stdout, "{}", json!({"result":result.result})) + .and_then(|()| stdout.flush()) + .map_err(|_| "output failed".into()) + }) +} +fn main() { + if let Err(error) = run() { + eprintln!("provider refused: {error}"); + std::process::exit(1); + } +} diff --git a/native/omk-providers/src/bin/replay-auth.rs b/native/omk-providers/src/bin/replay-auth.rs new file mode 100644 index 0000000000..018223e0f9 --- /dev/null +++ b/native/omk-providers/src/bin/replay-auth.rs @@ -0,0 +1,83 @@ +//! Offline diagnostic: only supplied stdin data is resolved; no files, ambient env or dispatch. +use omk_providers::auth::{KeySources, Snapshot, resolve_config}; +use serde::Deserialize; +use serde_json::json; +use std::{ + collections::BTreeMap, + io::{self, Read}, +}; + +#[derive(Deserialize)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +struct Input { + config: Option, + store: Option, + runtime: Option, + environment: Option, + fallback: Option, + include_fallback: Option, + #[serde(default)] + load_error: bool, + #[serde(default)] + env: BTreeMap, +} +fn run() -> Result<(), &'static str> { + let mut bytes = Vec::new(); + io::stdin() + .take(2 * 1024 * 1024 + 1) + .read_to_end(&mut bytes) + .map_err(|_| "input read failed")?; + if bytes.len() > 2 * 1024 * 1024 { + return Err("input exceeds 2 MiB"); + } + let input: Input = serde_json::from_slice(&bytes).map_err(|_| "invalid replay input")?; + let env = |name: &str| input.env.get(name).cloned(); + let result = if let Some(config) = input.config { + if input.store.is_some() + || input.runtime.is_some() + || input.environment.is_some() + || input.fallback.is_some() + || input.include_fallback.is_some() + || input.load_error + { + return Err("ambiguous replay input"); + } + resolve_config(&config, env) + } else { + Snapshot::from_json(if input.load_error { + Err(()) + } else { + Ok(input.store.as_deref()) + }) + .resolve( + "anthropic", + KeySources { + runtime: input.runtime.as_deref(), + environment: input.environment.as_deref(), + fallback: input.fallback.as_deref(), + include_fallback: input.include_fallback.unwrap_or(true), + }, + env, + ) + }; + match result { + Ok(key) => println!( + "{}", + json!({"key":key.as_ref().map(|key| key.expose()),"blocked":false}) + ), + Err(omk_providers::auth::Error::UnavailableStore) => { + println!("{}", json!({"key":null,"blocked":true})) + } + Err(_) => return Err("unsupported credential policy"), + } + Ok(()) +} +fn main() -> std::process::ExitCode { + match run() { + Ok(()) => std::process::ExitCode::SUCCESS, + Err(error) => { + eprintln!("auth replay refused: {error}"); + std::process::ExitCode::FAILURE + } + } +} diff --git a/native/omk-providers/src/bin/request-openai-completions.rs b/native/omk-providers/src/bin/request-openai-completions.rs new file mode 100644 index 0000000000..b36417dbfc --- /dev/null +++ b/native/omk-providers/src/bin/request-openai-completions.rs @@ -0,0 +1,28 @@ +use omk_providers::openai_completions::{Input, build_request}; +use std::io::{self, Read}; + +const LIMIT: u64 = 2 * 1024 * 1024; + +fn run() -> Result<(), String> { + let mut bytes = Vec::new(); + io::stdin() + .take(LIMIT + 1) + .read_to_end(&mut bytes) + .map_err(|e| e.to_string())?; + if bytes.len() as u64 > LIMIT { + return Err("input exceeds 2 MiB".into()); + } + let input: Input = serde_json::from_slice(&bytes).map_err(|e| e.to_string())?; + // Synthetic replay only: the credential is fixed and never read from the environment. + println!("{}", build_request(&input, "faux-key")?); + Ok(()) +} +fn main() -> std::process::ExitCode { + match run() { + Ok(()) => std::process::ExitCode::SUCCESS, + Err(error) => { + eprintln!("request refused: {error}"); + std::process::ExitCode::FAILURE + } + } +} diff --git a/native/omk-providers/src/bin/request-openai-responses.rs b/native/omk-providers/src/bin/request-openai-responses.rs new file mode 100644 index 0000000000..ad6bcd32d4 --- /dev/null +++ b/native/omk-providers/src/bin/request-openai-responses.rs @@ -0,0 +1,28 @@ +use omk_providers::openai_responses::{Input, build_request}; +use std::io::{self, Read}; + +const LIMIT: u64 = 2 * 1024 * 1024; + +fn run() -> Result<(), String> { + let mut bytes = Vec::new(); + io::stdin() + .take(LIMIT + 1) + .read_to_end(&mut bytes) + .map_err(|e| e.to_string())?; + if bytes.len() as u64 > LIMIT { + return Err("input exceeds 2 MiB".into()); + } + let input: Input = serde_json::from_slice(&bytes).map_err(|e| e.to_string())?; + // Synthetic replay only: the credential is fixed and never read from the environment. + println!("{}", build_request(&input, "faux-key")?); + Ok(()) +} +fn main() -> std::process::ExitCode { + match run() { + Ok(()) => std::process::ExitCode::SUCCESS, + Err(error) => { + eprintln!("request refused: {error}"); + std::process::ExitCode::FAILURE + } + } +} diff --git a/native/omk-providers/src/catalog.rs b/native/omk-providers/src/catalog.rs new file mode 100644 index 0000000000..dff06067c6 --- /dev/null +++ b/native/omk-providers/src/catalog.rs @@ -0,0 +1,259 @@ +//! Frozen public Node catalog plus explicit host-supplied models.json overlay. +use crate::catalog_overlay::{apply, merge, normalize, parse, strings}; +use serde_json::{Value, json}; +pub struct Catalog { + models: Vec, + config: Value, + invalid: bool, +} +impl Catalog { + /// No ambient files, OAuth mutation or network refresh. Invalid overlays retain builtins. + pub fn load(overlay: Option<&str>) -> Self { + let data: Value = + serde_json::from_str(include_str!("../catalog.json")).expect("bundled catalog"); + let mut models = data["models"].as_array().expect("bundled models").clone(); + for model in &mut models { + normalize(model); + } + let parsed = overlay.map(parse).transpose(); + let (config, order, mut invalid) = match parsed { + Ok(Some((config, order))) => (config, order, false), + Ok(None) => (json!({}), vec![], false), + Err(()) => (json!({"visibility":{"providers":[]}}), vec![], true), + }; + // Validate inheritance before applying anything: a bad provider invalidates the entire overlay. + for name in &order { + if name == "grok-oauth-proxy" { + continue; + } + let p = &config["providers"][name]; + let defs = p["models"].as_array().map(Vec::as_slice).unwrap_or(&[]); + let builtin = models.iter().find(|m| m["provider"] == *name); + if defs.is_empty() + && !["baseUrl", "headers", "compat", "modelOverrides"] + .iter() + .any(|k| p.get(k).is_some()) + { + invalid = true; + } + if !defs.is_empty() + && builtin.is_none() + && (p["baseUrl"].as_str().is_none() + || p["apiKey"].as_str().is_none() + || defs + .iter() + .any(|m| m["api"].as_str().or(p["api"].as_str()).is_none())) + { + invalid = true; + } + } + if invalid { + // Node blocks an explicit malformed visibility filter, but otherwise retains builtin availability. + let explicit = overlay.is_some_and(crate::catalog_overlay::has_visibility); + return Self { + models, + config: if explicit { + json!({"visibility":{"providers":[]}}) + } else { + json!({}) + }, + invalid, + }; + } + let originals = models.clone(); + for model in &mut models { + let provider = &config["providers"][model["provider"].as_str().unwrap()]; + if let Some(url) = provider.get("baseUrl") { + model["baseUrl"] = url.clone(); + } + if provider.get("compat").is_some() { + model["compat"] = merge(&model["compat"], &provider["compat"]); + } + let override_ = &provider["modelOverrides"][model["id"].as_str().unwrap()]; + apply(model, override_); + normalize(model); + } + for name in &order { + if name == "grok-oauth-proxy" { + continue; + } + let provider = &config["providers"][name]; + let default = originals.iter().find(|m| m["provider"] == *name); + for def in provider["models"] + .as_array() + .map(Vec::as_slice) + .unwrap_or(&[]) + { + let pick = |key: &str| { + def.get(key) + .or_else(|| provider.get(key)) + .or_else(|| default.and_then(|m| m.get(key))) + .cloned() + }; + let (Some(api), Some(url)) = (pick("api"), pick("baseUrl")) else { + continue; + }; + let mut model = json!({"id":def["id"],"name":def.get("name").unwrap_or(&def["id"]),"provider":name,"api":api,"baseUrl":url,"reasoning":def.get("reasoning").unwrap_or(&json!(false)),"input":def.get("input").unwrap_or(&json!(["text"])),"cost":def.get("cost").unwrap_or(&json!({"input":0,"output":0,"cacheRead":0,"cacheWrite":0})),"contextWindow":def.get("contextWindow").unwrap_or(&json!(128000)),"maxTokens":def.get("maxTokens").unwrap_or(&json!(16384))}); + if let Some(map) = def.get("thinkingLevelMap") { + model["thinkingLevelMap"] = map.clone(); + } + if provider.get("compat").is_some() || def.get("compat").is_some() { + model["compat"] = merge(&provider["compat"], &def["compat"]); + } + normalize(&mut model); + if let Some(index) = models + .iter() + .position(|m| m["provider"] == *name && m["id"] == def["id"]) + { + models[index] = model; + } else { + models.push(model); + } + } + } + Self { + models, + config, + invalid, + } + } + pub fn find(&self, provider: &str, id: &str) -> Option<&Value> { + self.models + .iter() + .find(|m| m["provider"] == provider && m["id"] == id) + } + pub fn is_invalid(&self) -> bool { + self.invalid + } + pub(crate) fn provider_config(&self, provider: &str) -> &Value { + &self.config["providers"][provider] + } + pub(crate) fn model_headers(&self, provider: &str, id: &str) -> Option<&Value> { + let config = self.provider_config(provider); + if let Some(model) = config["models"] + .as_array() + .and_then(|models| models.iter().rev().find(|m| m["id"] == id)) + { + return model.get("headers"); + } + config["modelOverrides"][id].get("headers") + } + fn visible(&self, m: &Value) -> bool { + let v = &self.config["visibility"]; + v["providers"] + .as_array() + .is_none_or(|ps| ps.contains(&m["provider"])) + && v["models"][m["provider"].as_str().unwrap()] + .as_array() + .is_none_or(|ids| ids.contains(&m["id"])) + } + /// Authenticated provider IDs are supplied by the host, not inferred from credential text. + pub fn view(&self, providers: &[String], authenticated: &[String]) -> Value { + let models: Vec<_> = self + .models + .iter() + .filter(|m| providers.is_empty() || providers.iter().any(|p| m["provider"] == *p)) + .collect(); + let available: Vec<_> = models + .iter() + .filter(|m| self.visible(m) && authenticated.iter().any(|p| m["provider"] == *p)) + .map(|m| json!([m["provider"], m["id"]])) + .collect(); + json!({"invalid":self.invalid,"total":self.models.len(),"models":models,"available":available}) + } +} +pub(crate) fn validate_provider(p: &Value) -> Result<(), ()> { + p.as_object().ok_or(())?; + validate_fields(p, true)?; + if let Some(models) = p.get("models") { + let models = models.as_array().ok_or(())?; + if models.len() > 4096 { + return Err(()); + } + for model in models { + if model["id"].as_str().is_none_or(str::is_empty) { + return Err(()); + } + validate_fields(model, false)?; + if let Some(cost) = model.get("cost") + && ["input", "output", "cacheRead", "cacheWrite"] + .iter() + .any(|key| !cost[key].is_number()) + { + return Err(()); + } + } + } + if let Some(overrides) = p.get("modelOverrides") { + for m in overrides.as_object().ok_or(())?.values() { + validate_fields(m, false)?; + } + } + Ok(()) +} +fn validate_fields(v: &Value, provider: bool) -> Result<(), ()> { + v.as_object().ok_or(())?; + for key in ["name", "api", "apiKey", "baseUrl"] { + if let Some(s) = v.get(key) + && s.as_str().is_none_or(str::is_empty) + { + return Err(()); + } + } + for key in ["reasoning", "authHeader"] { + if v.get(key).is_some_and(|v| !v.is_boolean()) { + return Err(()); + } + } + for key in ["contextWindow", "maxTokens"] { + if let Some(n) = v.get(key) + && n.as_f64().is_none_or(|n| n <= 0.0) + { + return Err(()); + } + } + if let Some(input) = v.get("input") { + strings(input)?; + if input + .as_array() + .unwrap() + .iter() + .any(|s| s != "text" && s != "image") + { + return Err(()); + } + } + if let Some(headers) = v.get("headers") + && headers + .as_object() + .ok_or(())? + .values() + .any(|v| !v.is_string()) + { + return Err(()); + } + if let Some(cost) = v.get("cost") + && cost.as_object().ok_or(())?.values().any(|n| !n.is_number()) + { + return Err(()); + } + if let Some(map) = v.get("thinkingLevelMap") + && map + .as_object() + .ok_or(())? + .values() + .any(|s| !s.is_string() && !s.is_null()) + { + return Err(()); + } + if let Some(compat) = v.get("compat") { + compat.as_object().ok_or(())?; + } + if !provider + && v.get("id") + .is_some_and(|s| s.as_str().is_none_or(str::is_empty)) + { + return Err(()); + } + Ok(()) +} diff --git a/native/omk-providers/src/catalog_overlay.rs b/native/omk-providers/src/catalog_overlay.rs new file mode 100644 index 0000000000..0908cc1a94 --- /dev/null +++ b/native/omk-providers/src/catalog_overlay.rs @@ -0,0 +1,185 @@ +// models.json merge semantics from packages/coding-agent/src/core/model-registry.ts (MIT). +use serde::{ + Deserialize, + de::{MapAccess, Visitor}, +}; +use serde_json::{Value, json}; +use std::fmt; + +fn clean(text: &str) -> Result { + if text.len() > 1024 * 1024 { + return Err(()); + } + // Match Node's line comments and trailing commas, without changing quoted strings. + let mut out = String::new(); + let mut chars = text.chars().peekable(); + let (mut quoted, mut escaped) = (false, false); + while let Some(c) = chars.next() { + if quoted { + out.push(c); + if escaped { + escaped = false; + } else if c == '\\' { + escaped = true; + } else if c == '"' { + quoted = false; + } + } else if c == '"' { + quoted = true; + out.push(c); + } else if c == '/' && chars.peek() == Some(&'/') { + for next in chars.by_ref() { + if next == '\n' { + out.push('\n'); + break; + } + } + } else { + out.push(c); + } + } + let mut chars = out.chars().peekable(); + let mut clean = String::new(); + (quoted, escaped) = (false, false); + while let Some(c) = chars.next() { + if !quoted && c == ',' { + let mut look = chars.clone(); + if matches!( + look.find(|c| matches!(c, '}' | ']') || !c.is_whitespace()), + Some('}' | ']') + ) { + continue; + } + } + clean.push(c); + if escaped { + escaped = false; + } else if quoted && c == '\\' { + escaped = true; + } else if c == '"' { + quoted = !quoted; + } + } + Ok(clean) +} +pub(crate) fn has_visibility(text: &str) -> bool { + clean(text) + .ok() + .and_then(|s| serde_json::from_str::(&s).ok()) + .is_some_and(|v| v.get("visibility").is_some()) +} +pub(crate) fn parse(text: &str) -> Result<(Value, Vec), ()> { + let clean = clean(text)?; + let config: Value = serde_json::from_str(&clean).map_err(|_| ())?; + let providers = config + .get("providers") + .and_then(Value::as_object) + .ok_or(())?; + if providers.len() > 4096 { + return Err(()); + } + for (name, provider) in providers { + if name == "grok-oauth-proxy" { + continue; + } + super::catalog::validate_provider(provider)?; + } + if let Some(visibility) = config.get("visibility") { + let visibility = visibility.as_object().ok_or(())?; + if let Some(p) = visibility.get("providers") { + strings(p)?; + } + if let Some(models) = visibility.get("models") { + for ids in models.as_object().ok_or(())?.values() { + strings(ids)?; + } + } + } + #[derive(Deserialize)] + struct Ordered { + providers: Order, + } + let ordered: Ordered = serde_json::from_str(&clean).map_err(|_| ())?; + Ok((config, ordered.providers.0)) +} +struct Order(Vec); +impl<'de> Deserialize<'de> for Order { + fn deserialize>(d: D) -> Result { + struct Keys; + impl<'de> Visitor<'de> for Keys { + type Value = Order; + fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str("provider map") + } + fn visit_map>(self, mut map: A) -> Result { + let mut keys = Vec::new(); + while let Some((key, _)) = map.next_entry::()? { + if !keys.contains(&key) { + keys.push(key); + } + } + // ECMAScript enumerates integer property keys before insertion-ordered strings. + keys.sort_by_key(|key| { + key.parse::() + .ok() + .filter(|n| *n < u32::MAX && n.to_string() == *key) + .map_or((1, 0), |n| (0, n)) + }); + Ok(Order(keys)) + } + } + d.deserialize_map(Keys) + } +} +pub(crate) fn strings(v: &Value) -> Result<(), ()> { + if v.as_array() + .ok_or(())? + .iter() + .any(|s| s.as_str().is_none_or(str::is_empty)) + { + return Err(()); + } + Ok(()) +} +pub(crate) fn normalize(model: &mut Value) { + if model["api"] != "anthropic-messages" { + return; + } + if let Some(url) = model["baseUrl"].as_str() { + let end = url.strip_suffix('/').unwrap_or(url); + if let Some((base, version)) = end.rsplit_once('/') + && version + .strip_prefix(['v', 'V']) + .is_some_and(|n| !n.is_empty() && n.bytes().all(|b| b.is_ascii_digit())) + { + model["baseUrl"] = json!(base); + } + } +} +pub(crate) fn merge(base: &Value, overlay: &Value) -> Value { + if !overlay.is_object() { + return base.clone(); + } + let mut merged = base.as_object().cloned().unwrap_or_default(); + for (key, value) in overlay.as_object().unwrap() { + merged.insert(key.clone(), value.clone()); + } + for key in ["openRouterRouting", "vercelGatewayRouting"] { + if base[key].is_object() || overlay[key].is_object() { + merged.insert(key.into(), merge(&base[key], &overlay[key])); + } + } + Value::Object(merged) +} +pub(crate) fn apply(model: &mut Value, overlay: &Value) { + for key in ["name", "reasoning", "input", "contextWindow", "maxTokens"] { + if let Some(value) = overlay.get(key) { + model[key] = value.clone(); + } + } + for key in ["cost", "compat", "thinkingLevelMap"] { + if overlay.get(key).is_some() { + model[key] = merge(&model[key], &overlay[key]); + } + } +} diff --git a/native/omk-providers/src/config_value.rs b/native/omk-providers/src/config_value.rs new file mode 100644 index 0000000000..4e3119cd48 --- /dev/null +++ b/native/omk-providers/src/config_value.rs @@ -0,0 +1,77 @@ +// Matches the non-command template grammar in core/resolve-config-value.ts. +use crate::auth::{Error, Secret, bounded_secret}; + +fn initial(byte: u8) -> bool { + byte.is_ascii_alphabetic() || byte == b'_' +} +fn continuation(byte: u8) -> bool { + initial(byte) || byte.is_ascii_digit() +} +fn variable(name: &str) -> bool { + let bytes = name.as_bytes(); + bytes.first().is_some_and(|byte| initial(*byte)) && bytes.iter().all(|byte| continuation(*byte)) +} +/// Does not read ambient environment or execute shell commands, including expanded commands. +pub fn resolve_config( + config: &str, + env: impl Fn(&str) -> Option, +) -> Result, Error> { + if config.len() > 65536 { + return Err(Error::InvalidInput); + } + if config.starts_with('!') { + return Err(Error::CommandRequiresHost); + } + let mut remaining = config; + let mut output = String::new(); + while let Some(index) = remaining.find('$') { + output.push_str(&remaining[..index]); + remaining = &remaining[index + 1..]; + match remaining.as_bytes().first().copied() { + Some(b'$' | b'!') => { + output.push(char::from(remaining.as_bytes()[0])); + remaining = &remaining[1..]; + } + Some(b'{') => { + if let Some(end) = remaining.find('}') { + let name = &remaining[1..end]; + if variable(name) { + let Some(value) = env(name).filter(|value| !value.is_empty()) else { + return Ok(None); + }; + if output.len().saturating_add(value.len()) > 65536 { + return Err(Error::InvalidInput); + } + output.push_str(&value); + } else { + output.push('$'); + output.push_str(&remaining[..=end]); + } + remaining = &remaining[end + 1..]; + } else { + output.push('$'); + } + } + Some(byte) if initial(byte) => { + let end = remaining + .bytes() + .take_while(|byte| continuation(*byte)) + .count(); + let Some(value) = env(&remaining[..end]).filter(|value| !value.is_empty()) else { + return Ok(None); + }; + if output.len().saturating_add(value.len()) > 65536 { + return Err(Error::InvalidInput); + } + output.push_str(&value); + remaining = &remaining[end..]; + } + _ => output.push('$'), + } + if output.len() > 65536 { + return Err(Error::InvalidInput); + } + } + output.push_str(remaining); + bounded_secret(&output).map(Some) +} diff --git a/native/omk-providers/src/dispatch.rs b/native/omk-providers/src/dispatch.rs new file mode 100644 index 0000000000..e4202abf58 --- /dev/null +++ b/native/omk-providers/src/dispatch.rs @@ -0,0 +1,243 @@ +//! Explicit single-attempt Anthropic dispatch; never reads ambient credentials. +use crate::{ + anthropic::{Input, Replay, Stream}, + auth::{KeySources, Snapshot, resolve_config}, + catalog::Catalog, + request::build_body, + transport::{self, Cancellation, Limits, Transport}, +}; +use reqwest::{ + Url, + header::{HeaderMap, HeaderName, HeaderValue}, +}; +use serde_json::{Value, json}; +#[derive(Debug, PartialEq, Eq)] +pub enum Error { + InvalidCatalog, + UnknownModel, + UnsupportedProvider, + InvalidRequest, + MissingCredential, + Authentication, + Headers, +} +impl std::fmt::Display for Error { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "provider dispatch refused: {self:?}") + } +} +impl std::error::Error for Error {} +/// Does not implement Debug/Serialize: headers and body may contain user secrets. +pub struct Prepared { + endpoint: String, + headers: HeaderMap, + body: Vec, + provider: String, + model: String, +} +pub fn prepare( + catalog: &Catalog, + provider: &str, + input: &Input, + snapshot: &Snapshot, + sources: KeySources<'_>, + env: impl Fn(&str) -> Option, +) -> Result { + if catalog.is_invalid() { + return Err(Error::InvalidCatalog); + } + let model = catalog + .find(provider, &input.model) + .ok_or(Error::UnknownModel)?; + if model["api"] != "anthropic-messages" + || matches!( + provider, + "github-copilot" | "cloudflare-ai-gateway" | "kimi-coding" + ) + { + return Err(Error::UnsupportedProvider); + } + let config = catalog.provider_config(provider); + let sources = KeySources { + runtime: sources.runtime, + environment: sources.environment, + fallback: sources.fallback.or_else(|| config["apiKey"].as_str()), + include_fallback: sources.include_fallback, + }; + let key = snapshot + .resolve(provider, sources, &env) + .map_err(|_| Error::Authentication)? + .filter(|s| !s.expose().is_empty()) + .ok_or(Error::MissingCredential)?; + if key.expose().contains("sk-ant-oat") { + return Err(Error::Authentication); + } + let eager = model["compat"]["supportsEagerToolInputStreaming"] + .as_bool() + .unwrap_or(provider != "fireworks"); + let fallback = provider == "anthropic" + && matches!( + input.model.as_str(), + "claude-fable-5" + | "claude-fable-5-1" + | "claude-fable-5-2" + | "claude-opus-5" + | "claude-opus-5-5" + | "claude-sonnet-5-5" + ) + && Url::parse(model["baseUrl"].as_str().ok_or(Error::InvalidRequest)?) + .is_ok_and(|u| u.origin().ascii_serialization() == "https://api.anthropic.com"); + let vision = model["input"] + .as_array() + .is_some_and(|types| types.contains(&json!("image"))); + let body = build_body( + input, + vision, + eager, + fallback.then_some("default"), + crate::request_policy::Policy::new(model, input.options.as_ref()) + .map_err(|_| Error::InvalidRequest)?, + ) + .map_err(|_| Error::InvalidRequest)? + .into_bytes(); + if body.len() > 8 * 1024 * 1024 { + return Err(Error::InvalidRequest); + } + let mut headers = HeaderMap::new(); + for (name, value) in [ + ("accept", "application/json"), + ("anthropic-dangerous-direct-browser-access", "true"), + ("anthropic-version", "2023-06-01"), + ("content-type", "application/json"), + ("x-api-key", key.expose()), + ] { + insert(&mut headers, name, value)?; + } + let mut beta = Vec::new(); + if fallback { + beta.push("server-side-fallback-2026-07-01"); + } + if !input.tools.is_empty() && !eager { + beta.push("fine-grained-tool-streaming-2025-05-14"); + } + if model["compat"]["forceAdaptiveThinking"] != true { + beta.push("interleaved-thinking-2025-05-14"); + } + if !beta.is_empty() { + insert(&mut headers, "anthropic-beta", &beta.join(","))?; + } + for source in [ + model.get("headers"), + config.get("headers"), + catalog.model_headers(provider, &input.model), + ] + .into_iter() + .flatten() + { + for (name, value) in source.as_object().ok_or(Error::Headers)? { + let value = resolve_config(value.as_str().ok_or(Error::Headers)?, &env) + .map_err(|_| Error::Headers)? + .ok_or(Error::Headers)?; + insert(&mut headers, name, value.expose())?; + } + } + if config["authHeader"] == true { + insert( + &mut headers, + "authorization", + &format!("Bearer {}", key.expose()), + )?; + } + let base = model["baseUrl"].as_str().ok_or(Error::InvalidRequest)?; + let endpoint = format!("{}/v1/messages", base.trim_end_matches('/')); + // Validate before any I/O; transport independently enforces its endpoint/framing boundary. + let url = Url::parse(&endpoint).map_err(|_| Error::InvalidRequest)?; + if !url.username().is_empty() + || url.password().is_some() + || url.query().is_some() + || url.fragment().is_some() + { + return Err(Error::InvalidRequest); + } + if headers.contains_key("host") + || headers.contains_key("content-length") + || headers.contains_key("transfer-encoding") + { + return Err(Error::Headers); + } + Ok(Prepared { + endpoint, + headers, + body, + provider: provider.into(), + model: input.model.clone(), + }) +} +fn insert(headers: &mut HeaderMap, name: &str, value: &str) -> Result<(), Error> { + let name = HeaderName::from_bytes(name.as_bytes()).map_err(|_| Error::Headers)?; + let mut value = HeaderValue::from_str(value).map_err(|_| Error::Headers)?; + value.set_sensitive(true); + headers.insert(name, value); + Ok(()) +} +impl Prepared { + pub async fn send( + self, + transport: &Transport, + limits: Limits, + cancellation: &Cancellation, + mut on_event: impl FnMut(Value), + ) -> Result { + let mut stream = Stream::recorded(&self.model, false); + let mut parser_failed = false; + let mut http_status = None; + // Do not emit start until request preparation and credential resolution have succeeded. + for event in stream.take_events() { + on_event(event); + } + let response = transport + .post( + &self.endpoint, + self.headers, + self.body, + limits, + cancellation, + |response, bytes| { + if !(200..300).contains(&response.status) { + http_status = Some(response.status); + return Err(()); + } + let result = stream.feed(bytes); + for event in stream.take_events() { + on_event(event); + } + parser_failed = result.is_err(); + result.map_err(|_| ()) + }, + ) + .await; + if let Ok(response) = &response + && !(200..300).contains(&response.status) + { + http_status = Some(response.status); + } + let aborted = matches!(response, Err(transport::Error::Cancelled)); + let error = http_status + .map(|_| "provider HTTP status failed".to_string()) + .or_else(|| response.err().map(|e| e.to_string())); + let mut replay = stream.finish(error, aborted); + // Provider/SSE errors can contain echoed secrets; this dispatch boundary never exposes their raw bytes. + if parser_failed || replay.result.get("errorMessage").is_some() { + replay.result["errorMessage"] = json!(if aborted { + "Request was aborted" + } else { + "provider response failed" + }); + } + replay.result["provider"] = json!(self.provider); + for event in replay.events.as_array().unwrap().iter().cloned() { + on_event(event); + } + Ok(replay) + } +} diff --git a/native/omk-providers/src/lib.rs b/native/omk-providers/src/lib.rs index e0e31b6b47..d86f819392 100644 --- a/native/omk-providers/src/lib.rs +++ b/native/omk-providers/src/lib.rs @@ -1,4 +1,4 @@ -//! Offline first-provider parity unit. Not a live provider or a selected Rust core. +//! Bounded provider parity and explicit Anthropic dispatch; not a selected Rust core. #[cfg(not(any( all( @@ -19,10 +19,25 @@ compile_error!("K1 B1 approval covers only GNU Linux, macOS and Windows MSVC x64/ARM64"); pub mod anthropic; +mod anthropic_stream; +pub mod auth; +pub mod catalog; +mod catalog_overlay; +mod config_value; +pub mod dispatch; pub mod json_parse; +pub mod openai_completions; +pub mod openai_responses; mod partial_json; mod reducer; mod request; +mod request_blocks; +pub mod request_cache; +mod request_content; mod request_history; +mod request_images; +pub mod request_policy; mod sse; +mod tool_schema; pub mod transport; +mod transport_send; diff --git a/native/omk-providers/src/openai_completions.rs b/native/omk-providers/src/openai_completions.rs new file mode 100644 index 0000000000..9839451570 --- /dev/null +++ b/native/omk-providers/src/openai_completions.rs @@ -0,0 +1,330 @@ +//! Bounded port of packages/ai/src/providers/openai-completions.ts buildParams/convertMessages +//! (MIT; root LICENSE/NOTICE). Request bytes only: no provider detection, client or response parser. +pub(crate) mod arguments; +pub(crate) mod cache; +pub(crate) mod effort; +pub(crate) mod handoff; +mod history; +mod pairing; +use crate::{ + request::Tool, + request_cache::{Boundary, Retention}, + tool_schema, +}; +use history::{WireMessage, messages}; +use pairing::Message; +use serde::{Deserialize, Serialize}; +use serde_json::{Value, json, value::RawValue}; + +/// Caller-resolved model compatibility; provider/URL detection is not ported. +#[derive(Deserialize)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +struct Compat { + supports_store: bool, + supports_developer_role: bool, + supports_usage_in_streaming: bool, + max_tokens_field: MaxTokensField, + supports_strict_mode: bool, + requires_system_message_first: bool, + #[serde(default)] + requires_tool_result_name: bool, + #[serde(default)] + requires_assistant_after_tool_result: bool, + #[serde(default)] + requires_thinking_as_text: bool, + #[serde(default)] + requires_reasoning_content_on_assistant_messages: bool, + /// Node's documented default is "openai" when absent. + #[serde(default)] + thinking_format: effort::Format, + supports_reasoning_effort: Option, + supports_long_cache_retention: Option, + /// Caller-resolved; Node detection never enables it. + #[serde(default)] + send_session_affinity_headers: bool, +} +#[derive(Deserialize, PartialEq)] +#[serde(rename_all = "snake_case")] +enum MaxTokensField { + MaxTokens, + MaxCompletionTokens, +} + +#[derive(Deserialize)] +#[serde(try_from = "Request")] +pub struct Input(Request); +impl TryFrom for Input { + type Error = String; + fn try_from(mut req: Request) -> Result { + handoff::prepare(&mut req.messages, req.provider.as_deref(), &req.model)?; + Ok(Self(req)) + } +} +#[derive(Deserialize)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +struct Request { + provider: Option, + base_url: String, + model: String, + reasoning: bool, + vision: Option, + compat: Compat, + system: String, + messages: Vec, + #[serde(default)] + tools: Vec, + max_tokens: Option, + temperature: Option, + tool_choice: Option, + reasoning_effort: Option, + thinking_level_map: Option, + cache_retention: Option, + session_id: Option, + /// Missing and present (even null or invalid) boundaries differ, as in Node. + #[serde(default)] + system_prompt_cache_boundary: Boundary, + #[serde(default)] + system_prompt_cache_boundary_bypass: bool, +} +#[derive(Deserialize, Serialize)] +#[serde(untagged)] +enum ToolChoice { + Mode(Mode), + Function(FunctionChoice), +} +#[derive(Deserialize, Serialize)] +#[serde(rename_all = "lowercase")] +enum Mode { + Auto, + None, + Required, +} +#[derive(Deserialize, Serialize)] +#[serde(deny_unknown_fields)] +struct FunctionChoice { + r#type: FunctionTag, + function: Named, +} +#[derive(Deserialize, Serialize)] +#[serde(rename_all = "lowercase")] +enum FunctionTag { + Function, +} +#[derive(Deserialize, Serialize)] +#[serde(deny_unknown_fields)] +struct Named { + name: String, +} + +#[derive(Serialize)] +struct Parameters<'a> { + properties: &'a RawValue, + required: &'a [String], + r#type: &'static str, +} +#[derive(Serialize)] +struct Function<'a> { + name: &'a str, + description: &'a str, + parameters: Parameters<'a>, + #[serde(skip_serializing_if = "Option::is_none")] + strict: Option, +} +#[derive(Serialize)] +struct WireTool<'a> { + r#type: &'static str, + function: Function<'a>, +} +#[derive(Serialize)] +struct StreamOptions { + include_usage: bool, +} +#[derive(Serialize)] +struct Body<'a> { + model: &'a str, + messages: Vec>, + stream: bool, + #[serde(skip_serializing_if = "Option::is_none")] + prompt_cache_key: Option, + #[serde(skip_serializing_if = "Option::is_none")] + prompt_cache_retention: Option<&'static str>, + #[serde(skip_serializing_if = "Option::is_none")] + stream_options: Option, + #[serde(skip_serializing_if = "Option::is_none")] + store: Option, + #[serde(skip_serializing_if = "Option::is_none")] + max_completion_tokens: Option, + #[serde(skip_serializing_if = "Option::is_none")] + max_tokens: Option, + #[serde(skip_serializing_if = "Option::is_none")] + temperature: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + tools: Option>>, + #[serde(skip_serializing_if = "Option::is_none")] + tool_choice: Option<&'a ToolChoice>, + #[serde(flatten)] + reasoning: effort::Params, +} + +/// Admits only URLs whose WHATWG serialization is the input itself, then appends the SDK path. +pub(crate) fn endpoint(base: &str, suffix: &str) -> Result { + let refuse = || Err(format!("unsupported baseUrl: {base}")); + let Some((scheme, rest)) = base.split_once("://") else { + return refuse(); + }; + let default_port = match scheme { + "https" => "443", + "http" => "80", + _ => return refuse(), + }; + let (authority, path) = rest.split_once('/').unwrap_or((rest, "")); + let (host, port) = match authority.split_once(':') { + Some((host, port)) => (host, Some(port)), + None => (authority, None), + }; + let labels: Vec<&str> = host.split('.').collect(); + let label = |l: &&str| { + !l.is_empty() + && !l.starts_with("xn--") + && l.bytes() + .all(|b| b.is_ascii_lowercase() || b.is_ascii_digit() || b == b'-') + }; + let numeric = labels + .last() + .is_some_and(|l| l.bytes().next().is_some_and(|b| b.is_ascii_digit())); + let canonical_octet = |l: &&str| l.parse::().is_ok_and(|n| n.to_string() == *l); + let host_ok = if numeric { + labels.len() == 4 && labels.iter().all(canonical_octet) + } else { + labels.iter().all(label) + }; + let port_ok = + port.is_none_or(|p| !p.starts_with('0') && p != default_port && p.parse::().is_ok()); + let segments: Vec<&str> = path.split('/').collect(); + let path_ok = segments.iter().enumerate().all(|(i, s)| { + (s.is_empty() && i + 1 == segments.len()) + || (!s.is_empty() + && !s.bytes().all(|b| b == b'.') + && s.bytes() + .all(|b| b.is_ascii_alphanumeric() || matches!(b, b'-' | b'_' | b'.' | b'~'))) + }); + if !(host_ok && port_ok && path_ok) { + return refuse(); + } + let separator = if base.ends_with('/') { "" } else { "/" }; + Ok(format!("{base}{separator}{suffix}")) +} + +/// Node createClient: headers carry the session unless retention is "none". +fn affinity_session(input: &Request) -> Result, String> { + let session = input + .session_id + .as_deref() + .filter(|s| !s.is_empty() && input.compat.send_session_affinity_headers); + let Some(session) = session.filter(|_| !matches!(input.cache_retention, Some(Retention::None))) + else { + return Ok(None); + }; + plain_header_value(session).map(Some) +} + +/// Fetch Headers trims HTTP whitespace, Latin-1 encodes or rejects anything else. +pub(crate) fn plain_header_value(value: &str) -> Result<&str, String> { + let edge = |c: char| matches!(c, ' ' | '\t'); + if value.starts_with(edge) + || value.ends_with(edge) + || !value.chars().all(|c| edge(c) || c.is_ascii_graphic()) + { + return Err("session header value is not plain visible ASCII".into()); + } + Ok(value) +} + +/// Builds the exact `{url, headers, body}` the Node SDK sends for the admitted surface. +pub fn build_request(input: &Input, api_key: &str) -> Result { + let input = &input.0; + let url = endpoint(&input.base_url, "chat/completions")?; + let tools = tool_schema::stable(&input.tools)?; + let (prompt_cache_key, prompt_cache_retention) = cache::fields(&cache::Policy { + base_url: &input.base_url, + provider: input.provider.as_deref(), + model: &input.model, + system: &input.system, + tools: &tools, + retention: input.cache_retention, + supports_long: input.compat.supports_long_cache_retention, + session: input.session_id.as_deref(), + boundary: &input.system_prompt_cache_boundary, + bypass: input.system_prompt_cache_boundary_bypass, + })?; + let temperature = input + .temperature + .as_ref() + .map(|n| { + tool_schema::js_number(&n.to_string()) + .and_then(|s| RawValue::from_string(s).map_err(|e| e.to_string())) + }) + .transpose()?; + let max_tokens = input.max_tokens.filter(|n| *n > 0); + let legacy = input.compat.max_tokens_field == MaxTokensField::MaxTokens; + let body = Body { + model: &input.model, + messages: messages(input)?, + stream: true, + prompt_cache_key, + prompt_cache_retention, + stream_options: input + .compat + .supports_usage_in_streaming + .then_some(StreamOptions { + include_usage: true, + }), + store: input.compat.supports_store.then_some(false), + max_completion_tokens: max_tokens.filter(|_| !legacy), + max_tokens: max_tokens.filter(|_| legacy), + temperature, + tools: (!tools.is_empty() || input.messages.iter().any(Message::has_tools)).then(|| { + tools + .iter() + .map(|(tool, properties)| WireTool { + r#type: "function", + function: Function { + name: &tool.name, + description: &tool.description, + parameters: Parameters { + properties, + required: &tool.required, + r#type: "object", + }, + strict: input.compat.supports_strict_mode.then_some(false), + }, + }) + .collect() + }), + tool_choice: input.tool_choice.as_ref(), + reasoning: effort::params(&effort::Model { + id: &input.model, + base_url: &input.base_url, + reasoning: input.reasoning, + format: input.compat.thinking_format, + supports_effort: input.compat.supports_reasoning_effort, + effort: input.reasoning_effort, + map: input.thinking_level_map.as_ref(), + })?, + }; + let mut headers = json!({ + "accept": "application/json", + "authorization": format!("Bearer {api_key}"), + "content-type": "application/json", + }); + if let Some(session) = affinity_session(input)? { + for name in ["session_id", "x-client-request-id", "x-session-affinity"] { + headers[name] = json!(session); + } + } + Ok(json!({ + "url": url, + "headers": headers, + "body": serde_json::to_string(&body).map_err(|e| e.to_string())?, + })) +} diff --git a/native/omk-providers/src/openai_completions/arguments.rs b/native/omk-providers/src/openai_completions/arguments.rs new file mode 100644 index 0000000000..5e394b689a --- /dev/null +++ b/native/omk-providers/src/openai_completions/arguments.rs @@ -0,0 +1,96 @@ +//! JSON.stringify on object arguments: index keys first, other keys in insertion order. +use crate::tool_schema::{array_index, js_number}; +use serde::{ + Deserialize, Deserializer, + de::{MapAccess, Visitor}, +}; +use serde_json::value::RawValue; +use std::{collections::HashSet, fmt}; + +struct Entries<'a>(Vec<(String, &'a RawValue)>); +impl<'de> Deserialize<'de> for Entries<'de> { + fn deserialize>(d: D) -> Result { + struct V; + impl<'de> Visitor<'de> for V { + type Value = Entries<'de>; + fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str("object arguments") + } + fn visit_map>(self, mut map: A) -> Result { + let mut entries = Vec::new(); + let mut seen = HashSet::new(); + while let Some((key, value)) = map.next_entry::()? { + if !seen.insert(key.clone()) { + return Err(serde::de::Error::custom("duplicate argument key")); + } + entries.push((key, value)); + } + entries.sort_by_key(|(key, _)| array_index(key).unwrap_or(u32::MAX)); + Ok(Entries(entries)) + } + } + d.deserialize_map(V) + } +} +pub(crate) fn stringify(raw: &RawValue) -> Result { + if !raw.get().starts_with('{') { + return Err("tool arguments must be an object".into()); + } + let mut out = String::new(); + write(raw, &mut out, 0)?; + Ok(out) +} +/// JSON.parse followed by filter(Boolean), then reserialize with JS key order. +pub(super) fn detail(signature: &str) -> Result>, String> { + let Ok(raw) = serde_json::from_str::<&RawValue>(signature) else { + return Ok(None); + }; + let mut out = String::new(); + write(raw, &mut out, 0)?; + if matches!(out.as_str(), "false" | "0" | "\"\"") || raw.get() == "null" { + return Ok(None); + } + RawValue::from_string(out) + .map(Some) + .map_err(|e| e.to_string()) +} +fn write(raw: &RawValue, out: &mut String, depth: u8) -> Result<(), String> { + if depth > 64 { + return Err("tool arguments exceed depth limit".into()); + } + let s = raw.get(); + let err = |e: serde_json::Error| e.to_string(); + match s.as_bytes()[0] { + b'{' => { + let entries: Entries = serde_json::from_str(s).map_err(err)?; + out.push('{'); + for (i, (key, val)) in entries.0.into_iter().enumerate() { + if i > 0 { + out.push(','); + } + out.push_str(&serde_json::to_string(&key).map_err(err)?); + out.push(':'); + write(val, out, depth + 1)?; + } + out.push('}'); + } + b'[' => { + let items: Vec<&RawValue> = serde_json::from_str(s).map_err(err)?; + out.push('['); + for (i, val) in items.into_iter().enumerate() { + if i > 0 { + out.push(','); + } + write(val, out, depth + 1)?; + } + out.push(']'); + } + b'"' => out.push_str( + &serde_json::to_string(&serde_json::from_str::(s).map_err(err)?) + .map_err(err)?, + ), + b't' | b'f' | b'n' => out.push_str(s), + _ => out.push_str(&js_number(s)?), + } + Ok(()) +} diff --git a/native/omk-providers/src/openai_completions/cache.rs b/native/omk-providers/src/openai_completions/cache.rs new file mode 100644 index 0000000000..4ab69107c1 --- /dev/null +++ b/native/omk-providers/src/openai_completions/cache.rs @@ -0,0 +1,93 @@ +//! Port of buildParams' prompt_cache_key/prompt_cache_retention and resolveOpenAIPromptCacheKey +//! (openai-prompt-cache.ts, prompt-cache.ts). Retention and supportsLongCacheRetention are +//! caller-resolved; OMK_CACHE_RETENTION is never read. +use super::handoff::short_hash; +use crate::{ + request::Tool, + request_cache::{Boundary, Retention}, + tool_schema, +}; +use serde_json::{Value, value::RawValue}; + +pub(crate) struct Policy<'a> { + pub base_url: &'a str, + pub provider: Option<&'a str>, + pub model: &'a str, + pub system: &'a str, + pub tools: &'a [(&'a Tool, Box)], + pub retention: Option, + pub supports_long: Option, + pub session: Option<&'a str>, + pub boundary: &'a Boundary, + pub bypass: bool, +} + +/// Returns `(prompt_cache_key, prompt_cache_retention)`. +pub(super) fn fields(p: &Policy) -> Result<(Option, Option<&'static str>), String> { + // Node's default without OMK_CACHE_RETENTION. + let retention = p.retention.unwrap_or(Retention::Short); + let long = match (retention, p.supports_long) { + (Retention::Long, None) => { + return Err( + "long cacheRetention needs caller-resolved supportsLongCacheRetention".into(), + ); + } + (Retention::Long, Some(supported)) => supported, + _ => false, + }; + let keyed = + (p.base_url.contains("api.openai.com") && !matches!(retention, Retention::None)) || long; + let key = if keyed { key(p)? } else { None }; + Ok((key, long.then_some("24h"))) +} + +pub(crate) fn key(p: &Policy) -> Result, String> { + let units: Vec = p.system.encode_utf16().collect(); + let boundary = match p.boundary { + Boundary::Present(Value::Number(n)) if !p.bypass && !units.is_empty() => n + .as_f64() + .filter(|n| *n > 0.0 && n.fract() == 0.0 && *n <= units.len() as f64) + .map(|n| n as usize), + _ => None, + }; + if let Some(n) = boundary { + return content_key(p, &units[..n]).map(Some); + } + if p.bypass || !p.boundary.is_missing() { + return Ok(None); + } + // clampOpenAIPromptCacheKey: first 64 code points. + Ok(p.session.map(|s| s.chars().take(64).collect())) +} + +/// deriveContextPromptCacheKey: canonicalJsonStringify({prefix, scope, tools, version: 1}). +fn content_key(p: &Policy, prefix: &[u16]) -> Result { + let prefix = String::from_utf16(prefix) + .map_err(|_| "cache boundary splitting a surrogate pair is not supported".to_string())?; + let provider = p + .provider + .ok_or("a content cache key needs an explicit provider")?; + let json = |s: &str| serde_json::to_string(s).map_err(|e| e.to_string()); + let mut tools = Vec::with_capacity(p.tools.len()); + for (tool, properties) in p.tools { + let required = tool + .required + .iter() + .map(|r| json(r)) + .collect::, _>>()?; + tools.push(format!( + r#"{{"description":{},"name":{},"parameters":{{"properties":{},"required":[{}],"type":"object"}}}}"#, + json(&tool.description)?, + json(&tool.name)?, + tool_schema::canonical_json(properties)?, + required.join(","), + )); + } + let fingerprint = format!( + r#"{{"prefix":{},"scope":{},"tools":[{}],"version":1}}"#, + json(&prefix)?, + json(&format!("{provider}/{}", p.model))?, + tools.join(","), + ); + Ok(format!("omk-{}", short_hash(&fingerprint))) +} diff --git a/native/omk-providers/src/openai_completions/effort.rs b/native/omk-providers/src/openai_completions/effort.rs new file mode 100644 index 0000000000..36b41eae2e --- /dev/null +++ b/native/omk-providers/src/openai_completions/effort.rs @@ -0,0 +1,190 @@ +//! Port of buildParams' thinkingFormat branches (packages/ai/src/providers/openai-completions.ts). +//! `thinkingFormat` and `supportsReasoningEffort` are caller-resolved; only the Model Studio host +//! test that buildParams itself performs is reproduced here. +use serde::{Deserialize, Serialize}; +use std::collections::HashMap; + +#[derive(Deserialize, Clone, Copy, Default, PartialEq)] +#[serde(rename_all = "kebab-case")] +pub(super) enum Format { + #[default] + Openai, + Openrouter, + Deepseek, + Together, + Zai, + Qwen, + QwenChatTemplate, + StringThinking, + AntLing, +} +#[derive(Deserialize, Clone, Copy, PartialEq, Eq, Hash)] +#[serde(rename_all = "lowercase")] +pub(crate) enum Level { + Off, + Minimal, + Low, + Medium, + High, + Xhigh, + Max, + Ultra, +} +impl Level { + pub(crate) fn name(self) -> &'static str { + match self { + Self::Off => "off", + Self::Minimal => "minimal", + Self::Low => "low", + Self::Medium => "medium", + Self::High => "high", + Self::Xhigh => "xhigh", + Self::Max => "max", + Self::Ultra => "ultra", + } + } +} +/// Absent key and explicit null differ only for `off`; lookups otherwise treat both as missing. +pub(crate) type LevelMap = HashMap>; + +#[derive(Serialize)] +#[serde(untagged)] +enum Reasoning { + Effort { effort: String }, + Enabled { enabled: bool }, +} +#[derive(Serialize)] +struct TemplateKwargs { + enable_thinking: bool, + preserve_thinking: bool, +} +#[derive(Serialize)] +#[serde(untagged)] +enum Thinking { + Toggle { r#type: &'static str }, + Level(String), +} +/// Field order covers every format's Node emission order (each format uses a disjoint subset). +#[derive(Serialize, Default)] +pub(super) struct Params { + #[serde(skip_serializing_if = "Option::is_none")] + enable_thinking: Option, + #[serde(skip_serializing_if = "Option::is_none")] + chat_template_kwargs: Option, + #[serde(skip_serializing_if = "Option::is_none")] + thinking: Option, + #[serde(skip_serializing_if = "Option::is_none")] + reasoning: Option, + #[serde(skip_serializing_if = "Option::is_none")] + reasoning_effort: Option, +} + +pub(super) struct Model<'a> { + pub id: &'a str, + pub base_url: &'a str, + pub reasoning: bool, + pub format: Format, + pub supports_effort: Option, + pub effort: Option, + pub map: Option<&'a LevelMap>, +} + +/// buildParams' URL test; `base` has already passed `endpoint`'s canonical-URL admission. +fn model_studio(base: &str) -> bool { + let Some(rest) = base.strip_prefix("https://") else { + return false; + }; + let host = rest.split(['/', ':']).next().unwrap_or(""); + host.ends_with(".maas.aliyuncs.com") + || matches!( + host, + "dashscope.aliyuncs.com" + | "dashscope-intl.aliyuncs.com" + | "dashscope-us.aliyuncs.com" + | "coding.dashscope.aliyuncs.com" + | "coding-intl.dashscope.aliyuncs.com" + ) +} + +pub(super) fn params(m: &Model) -> Result { + if m.effort == Some(Level::Off) { + return Err("reasoningEffort cannot be off; omit it instead".into()); + } + if (m.effort.is_some() || m.map.is_some()) && m.supports_effort.is_none() { + return Err("reasoning parameters need caller-resolved supportsReasoningEffort".into()); + } + let supports = m.supports_effort.unwrap_or(false); + let entry = |level: Level| m.map.and_then(|map| map.get(&level)); + let mapped = |level: Level| entry(level).cloned().flatten(); + let chosen = m + .effort + .map(|e| mapped(e).unwrap_or_else(|| e.name().into())); + // Node: `map?.off !== null` (absent counts as not null); `map?.off ?? "none"`. + let off_allowed = !matches!(entry(Level::Off), Some(None)); + let off_or_none = || mapped(Level::Off).unwrap_or_else(|| "none".into()); + let on = m.effort.is_some(); + let mut p = Params::default(); + if !m.reasoning { + return Ok(p); + } + match m.format { + Format::Zai => { + p.enable_thinking = Some(on); + p.reasoning_effort = chosen.filter(|_| supports); + } + Format::Qwen => { + p.enable_thinking = Some(on); + if let Some(effort) = m.effort.filter(|_| supports && model_studio(m.base_url)) { + let fallback = if effort == Level::Minimal && m.id.starts_with("deepseek-v4-") { + "low" + } else { + effort.name() + }; + p.reasoning_effort = Some(mapped(effort).unwrap_or_else(|| fallback.into())); + } + } + Format::QwenChatTemplate => { + p.chat_template_kwargs = Some(TemplateKwargs { + enable_thinking: on, + preserve_thinking: true, + }); + } + Format::Deepseek => { + p.thinking = Some(Thinking::Toggle { + r#type: if on { "enabled" } else { "disabled" }, + }); + p.reasoning_effort = chosen.filter(|_| supports); + } + Format::Openrouter => { + p.reasoning = match chosen { + Some(effort) => Some(Reasoning::Effort { effort }), + None if off_allowed => Some(match off_or_none() { + off if off == "none" => Reasoning::Enabled { enabled: false }, + effort => Reasoning::Effort { effort }, + }), + None => None, + }; + } + Format::AntLing if on => { + p.reasoning = m + .effort + .and_then(mapped) + .map(|effort| Reasoning::Effort { effort }); + } + Format::Together => { + p.reasoning = Some(Reasoning::Enabled { enabled: on }); + p.reasoning_effort = chosen.filter(|_| supports); + } + Format::StringThinking => { + p.thinking = match chosen { + Some(level) => Some(Thinking::Level(level)), + None => off_allowed.then(|| Thinking::Level(off_or_none())), + }; + } + // OpenAI-style, plus ant-ling without an effort (Node's final else-if branches). + Format::Openai | Format::AntLing => { + p.reasoning_effort = chosen.or_else(|| mapped(Level::Off)).filter(|_| supports); + } + } + Ok(p) +} diff --git a/native/omk-providers/src/openai_completions/handoff.rs b/native/omk-providers/src/openai_completions/handoff.rs new file mode 100644 index 0000000000..3b4071ae46 --- /dev/null +++ b/native/omk-providers/src/openai_completions/handoff.rs @@ -0,0 +1,220 @@ +//! First pass of transform-messages.ts and Chat Completions normalizeToolCallId (MIT). +use super::pairing::Message; +use crate::request_history::nonblank; +use serde::Deserialize; +use serde_json::value::RawValue; +use std::collections::HashMap; + +#[derive(Deserialize)] +#[serde(deny_unknown_fields)] +pub(super) struct Source { + provider: String, + api: String, + model: String, +} + +// Keep arguments raw; serde's internally tagged enum buffering loses their key order. +#[derive(Deserialize)] +#[serde(try_from = "Box")] +pub(super) enum Block { + Text { + text: String, + }, + Thinking { + thinking: String, + signature: Option, + redacted: bool, + }, + ToolCall { + id: String, + name: String, + arguments: Box, + signature: Option, + }, +} +impl TryFrom> for Block { + type Error = String; + fn try_from(raw: Box) -> Result { + #[derive(Deserialize)] + struct Tag { + r#type: String, + } + #[derive(Deserialize)] + #[serde(rename_all = "camelCase", deny_unknown_fields)] + struct Call { + #[serde(rename = "type")] + _kind: String, + id: String, + name: String, + arguments: Box, + thought_signature: Option, + } + #[derive(Deserialize)] + #[serde(rename_all = "camelCase", deny_unknown_fields)] + struct Text { + #[serde(rename = "type")] + _kind: String, + text: String, + #[serde(rename = "textSignature")] + _signature: Option, + } + let err = |e: serde_json::Error| e.to_string(); + let s = raw.get(); + match serde_json::from_str::(s).map_err(err)?.r#type.as_str() { + "toolCall" => { + let c: Call = serde_json::from_str(s).map_err(err)?; + Ok(Self::ToolCall { + id: c.id, + name: c.name, + arguments: c.arguments, + signature: c.thought_signature, + }) + } + "text" => Ok(Self::Text { + text: serde_json::from_str::(s).map_err(err)?.text, + }), + "thinking" => { + let crate::request_blocks::Block::Thinking { + thinking, + thinking_signature, + redacted, + } = serde_json::from_str(s).map_err(err)? + else { + return Err("expected thinking block".into()); + }; + Ok(Self::Thinking { + thinking, + signature: thinking_signature, + redacted, + }) + } + _ => Err("unsupported assistant block".into()), + } + } +} + +pub(super) fn prepare( + messages: &mut [Message], + provider: Option<&str>, + model: &str, +) -> Result<(), String> { + if provider.is_some_and(|p| !matches!(p, "openai" | "synthetic")) { + return Err("unsupported target provider identity".into()); + } + let mut ids = HashMap::new(); + for msg in messages { + match msg { + Message::Assistant(blocks, _, Some(source)) => { + let target = provider.ok_or("source requires target provider")?; + if source.provider == target + && source.api == "openai-completions" + && source.model == model + { + continue; + } + for block in blocks.iter_mut() { + match block { + Block::ToolCall { id, signature, .. } => { + *signature = None; + let next = normalize(id, target)?; + if *id != next { + ids.insert(std::mem::replace(id, next.clone()), next); + } + } + Block::Thinking { + thinking, redacted, .. + } => { + let text = if !*redacted && nonblank(thinking) { + std::mem::take(thinking) + } else { + String::new() + }; + *block = Block::Text { text }; + } + Block::Text { .. } => {} + } + } + } + Message::Result(id, _, _) => { + if let Some(mapped) = ids.get(id).filter(|s| !s.is_empty()) { + id.clone_from(mapped); + } + } + Message::Assistant(blocks, _, None) + if blocks.iter().any(|b| { + matches!( + b, + Block::Thinking { .. } + | Block::ToolCall { + signature: Some(_), + .. + } + ) + }) => + { + return Err("signed history requires explicit source identity".into()); + } + _ => {} + } + } + Ok(()) +} +fn normalize(id: &str, provider: &str) -> Result { + let Some((call, item)) = id.split_once('|') else { + if provider == "openai" { + return String::from_utf16(&id.encode_utf16().take(40).collect::>()) + .map_err(|_| "ID truncation splits surrogate pair".into()); + } + return Ok(id.into()); + }; + let clean = |s: &str| { + s.encode_utf16() + .map(|c| match u8::try_from(c) { + Ok(b) if b.is_ascii_alphanumeric() || matches!(b, b'_' | b'-') => b as char, + _ => '_', + }) + .collect::() + }; + let call = clean(call); + let item = clean(item); + let combined = if item.is_empty() { + call.clone() + } else { + format!("{call}_{item}") + }; + if combined.len() <= 40 { + return Ok(combined); + } + let hash = short_hash(id); + let suffix = &hash[..8.min(hash.len())]; + Ok(format!( + "{}_{}", + &call[..call.len().min(39 - suffix.len())], + suffix + )) +} +// utils/hash.ts: Math.imul wraps modulo 2^32; charCodeAt reads UTF-16 code units. +pub(crate) fn short_hash(s: &str) -> String { + fn base36(mut n: u32) -> String { + let mut digits = Vec::new(); + loop { + digits.push(char::from_digit(n % 36, 36).unwrap()); + n /= 36; + if n == 0 { + break; + } + } + digits.into_iter().rev().collect() + } + let (mut a, mut b) = (0xdeadbeefu32, 0x41c6ce57u32); + for c in s.encode_utf16() { + a = (a ^ u32::from(c)).wrapping_mul(2654435761); + b = (b ^ u32::from(c)).wrapping_mul(1597334677); + } + let mix = |a: u32, b: u32| { + (a ^ (a >> 16)).wrapping_mul(2246822507) ^ (b ^ (b >> 13)).wrapping_mul(3266489909) + }; + a = mix(a, b); + b = mix(b, a); + format!("{}{}", base36(b), base36(a)) +} diff --git a/native/omk-providers/src/openai_completions/history.rs b/native/omk-providers/src/openai_completions/history.rs new file mode 100644 index 0000000000..308e7cb533 --- /dev/null +++ b/native/omk-providers/src/openai_completions/history.rs @@ -0,0 +1,287 @@ +use super::{ + arguments::stringify, + handoff::Block, + pairing::{Turn, pair}, +}; +use crate::{ + request_content::{InputContent, TOOL_IMAGE, USER_IMAGE, texts}, + request_history::nonblank, +}; +use serde::{Deserialize, Serialize}; +use std::borrow::Cow; + +#[derive(Deserialize)] +#[serde(untagged)] +pub(super) enum UserContent { + String(String), + Blocks(Vec), +} +#[derive(Serialize)] +#[serde(tag = "type", rename_all = "snake_case")] +enum Part<'a> { + Text { text: Cow<'a, str> }, + ImageUrl { image_url: ImageUrl }, +} +#[derive(Serialize)] +struct ImageUrl { + url: String, +} +#[derive(Serialize)] +#[serde(untagged)] +enum Content<'a> { + String(Cow<'a, str>), + Parts(Vec>), + Null, +} +#[derive(Serialize)] +struct Call<'a> { + id: &'a str, + r#type: &'static str, + function: Function<'a>, +} +#[derive(Serialize)] +struct Function<'a> { + name: &'a str, + arguments: String, +} +#[derive(Serialize)] +pub(super) struct WireMessage<'a> { + role: &'static str, + content: Content<'a>, + #[serde(skip_serializing_if = "Option::is_none")] + reasoning_content: Option, + #[serde(skip_serializing_if = "Option::is_none")] + reasoning: Option, + #[serde(skip_serializing_if = "Vec::is_empty")] + tool_calls: Vec>, + #[serde(skip_serializing_if = "Vec::is_empty")] + reasoning_details: Vec>, + // The SDK appends a missing required field after tool calls and reasoning details. + #[serde(rename = "reasoning_content", skip_serializing_if = "Option::is_none")] + required_reasoning_content: Option<&'static str>, + #[serde(skip_serializing_if = "Option::is_none")] + tool_call_id: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + name: Option<&'a str>, +} +impl<'a> WireMessage<'a> { + fn new(role: &'static str, content: Content<'a>) -> Self { + Self { + role, + content, + reasoning: None, + reasoning_content: None, + reasoning_details: Vec::new(), + required_reasoning_content: None, + tool_calls: vec![], + tool_call_id: None, + name: None, + } + } + fn text(role: &'static str, s: &'a str) -> Self { + Self::new(role, Content::String(s.into())) + } +} +fn parts<'a>( + blocks: &'a [InputContent], + vision: Option, + marker: &'static str, +) -> Result>, String> { + if blocks + .iter() + .any(|b| matches!(b, InputContent::Image { .. })) + { + if blocks.len() > 4096 { + return Err("image history exceeds 4096 blocks".into()); + } + if !vision.ok_or("images require explicit vision capability")? { + return Ok(texts(blocks, marker)? + .into_iter() + .map(|text| Part::Text { text: text.into() }) + .collect()); + } + } + Ok(blocks + .iter() + .map(|b| match b { + InputContent::Text { text } => Part::Text { + text: text.as_str().into(), + }, + InputContent::Image { data, mime_type } => Part::ImageUrl { + image_url: ImageUrl { + url: format!("data:{mime_type};base64,{data}"), + }, + }, + }) + .collect()) +} +const BRIDGE: &str = "I have processed the tool results."; +fn assistant<'a>( + blocks: &'a [Block], + input: &super::Request, +) -> Result>, String> { + let mut msg = WireMessage::new( + "assistant", + if input.compat.requires_assistant_after_tool_result { + Content::String("".into()) + } else { + Content::Null + }, + ); + let mut texts = Vec::new(); + let mut thoughts = Vec::new(); + let mut field = None; + for b in blocks { + match b { + Block::Text { text } => { + if nonblank(text) { + texts.push(text.as_str()); + } + } + Block::ToolCall { + id, + name, + arguments, + signature, + } => { + if let Some(s) = signature + && let Some(d) = super::arguments::detail(s)? + { + msg.reasoning_details.push(d); + } + msg.tool_calls.push(Call { + id, + r#type: "function", + function: Function { + name, + arguments: stringify(arguments)?, + }, + }); + } + Block::Thinking { + thinking, + signature, + .. + } => { + if nonblank(thinking) { + if thoughts.is_empty() { + field = signature.as_deref(); + } + thoughts.push(thinking.as_str()); + } + } + } + } + if input.compat.requires_thinking_as_text && !thoughts.is_empty() { + let mut parts = vec![Part::Text { + text: thoughts.join("\n\n").into(), + }]; + parts.extend(texts.into_iter().map(|s| Part::Text { text: s.into() })); + msg.content = Content::Parts(parts); + } else { + match field { + None | Some("") => {} + Some("reasoning_content") => msg.reasoning_content = Some(thoughts.join("\n")), + Some("reasoning") => msg.reasoning = Some(thoughts.join("\n")), + Some(_) => return Err("unsupported thinking signature field".into()), + } + if !texts.is_empty() { + msg.content = Content::String(texts.concat().into()); + } else if msg.tool_calls.is_empty() { + return Ok(None); + } + } + if input.reasoning + && input + .compat + .requires_reasoning_content_on_assistant_messages + && msg.reasoning_content.is_none() + { + msg.required_reasoning_content = Some(""); + } + Ok(Some(msg)) +} +pub(super) fn messages(input: &super::Request) -> Result>, String> { + let mut wire = Vec::new(); + if !input.system.is_empty() || input.compat.requires_system_message_first { + let role = if input.reasoning && input.compat.supports_developer_role { + "developer" + } else { + "system" + }; + wire.push(WireMessage::text(role, &input.system)); + } + let bridge = input.compat.requires_assistant_after_tool_result; + let mut after_result = false; + let mut turns = pair(&input.messages).into_iter().peekable(); + while let Some(turn) = turns.next() { + match turn { + Turn::User(user) => { + if after_result && bridge { + wire.push(WireMessage::text("assistant", BRIDGE)); + } + let content = match user { + UserContent::String(s) => Content::String(s.as_str().into()), + UserContent::Blocks(b) if b.is_empty() => continue, + UserContent::Blocks(b) => Content::Parts(parts(b, input.vision, USER_IMAGE)?), + }; + wire.push(WireMessage::new("user", content)); + after_result = false; + } + Turn::Assistant(blocks) => { + if let Some(msg) = assistant(blocks, input)? { + wire.push(msg); + after_result = false; + } + } + Turn::Result { .. } => { + let mut images = Vec::new(); + let mut current = turn; + while let Turn::Result { id, name, blocks } = current { + let mut text_parts = Vec::new(); + if let Some(blocks) = blocks { + for part in parts(blocks, input.vision, TOOL_IMAGE)? { + match part { + Part::Text { text } => text_parts.push(text), + image => images.push(image), + } + } + } else { + text_parts.push("No result provided".into()); + } + let joined = text_parts.join("\n"); + let mut msg = WireMessage::new( + "tool", + Content::String(if joined.is_empty() { + "(see attached image)".into() + } else { + joined.into() + }), + ); + msg.tool_call_id = Some(id); + msg.name = (input.compat.requires_tool_result_name && !name.is_empty()) + .then_some(name); + wire.push(msg); + let Some(next) = turns.next_if(|t| matches!(t, Turn::Result { .. })) else { + break; + }; + current = next; + } + after_result = images.is_empty(); + if !images.is_empty() { + if bridge { + wire.push(WireMessage::text("assistant", BRIDGE)); + } + images.insert( + 0, + Part::Text { + text: "Attached image(s) from tool result:".into(), + }, + ); + wire.push(WireMessage::new("user", Content::Parts(images))); + } + } + } + } + Ok(wire) +} diff --git a/native/omk-providers/src/openai_completions/pairing.rs b/native/omk-providers/src/openai_completions/pairing.rs new file mode 100644 index 0000000000..829b25146f --- /dev/null +++ b/native/omk-providers/src/openai_completions/pairing.rs @@ -0,0 +1,125 @@ +//! Same-model transformMessages: flush pending calls at turn boundaries, retain live IDs. +use super::handoff::{Block, Source}; +use super::history::UserContent; +use crate::{request_blocks::StopReason, request_content::InputContent, request_history::blank}; +use serde::Deserialize; +use serde_json::value::RawValue; +use std::collections::HashSet; + +#[derive(Deserialize)] +#[serde(try_from = "Fields")] +pub(super) enum Message { + User(UserContent), + Assistant(Vec, StopReason, Option), + Result(String, String, Vec), +} +#[derive(Deserialize)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +struct Fields { + role: String, + content: Box, + source: Option, + stop_reason: Option, + tool_call_id: Option, + tool_name: Option, + is_error: Option, +} +impl TryFrom for Message { + type Error = String; + fn try_from(f: Fields) -> Result { + if f.role != "assistant" && f.source.is_some() { + return Err("only assistants carry source identity".into()); + } + let raw = f.content.get(); + let err = |e: serde_json::Error| e.to_string(); + match ( + f.role.as_str(), + f.stop_reason, + f.tool_call_id, + f.tool_name, + f.is_error, + ) { + ("user", None, None, None, None) => { + Ok(Self::User(serde_json::from_str(raw).map_err(err)?)) + } + ("assistant", stop, None, None, None) => { + let blocks: Vec = serde_json::from_str(raw).map_err(err)?; + Ok(Self::Assistant(blocks, stop.unwrap_or_default(), f.source)) + } + ("toolResult", None, Some(id), name, _) => Ok(Self::Result( + id, + name.unwrap_or_default(), + serde_json::from_str(raw).map_err(err)?, + )), + _ => Err("unsupported history fields".into()), + } + } +} +impl Message { + pub(super) fn has_tools(&self) -> bool { + match self { + Self::Result(..) => true, + Self::Assistant(blocks, ..) => { + blocks.iter().any(|b| matches!(b, Block::ToolCall { .. })) + } + Self::User(_) => false, + } + } +} +pub(super) enum Turn<'a> { + User(&'a UserContent), + Assistant(&'a [Block]), + Result { + id: &'a str, + name: &'a str, + blocks: Option<&'a [InputContent]>, + }, +} +pub(super) fn pair(messages: &[Message]) -> Vec> { + let mut out = Vec::new(); + let mut live = HashSet::new(); + let mut pending = Vec::new(); + let mut provided = HashSet::new(); + for message in messages.iter().map(Some).chain(std::iter::once(None)) { + if !matches!(message, Some(Message::Result(..))) { + for (id, name) in pending.drain(..) { + if !provided.contains(id) { + out.push(Turn::Result { + id, + name, + blocks: None, + }); + } + } + provided.clear(); + } + match message { + None => break, + Some(Message::User(user)) => out.push(Turn::User(user)), + Some(Message::Assistant(_, StopReason::Error | StopReason::Aborted, _)) => {} + Some(Message::Assistant(blocks, ..)) => { + for b in blocks { + if let Block::ToolCall { id, name, .. } = b { + pending.push((id.as_str(), name.as_str())); + if !id.is_empty() { + live.insert(id.as_str()); + } + } + } + out.push(Turn::Assistant(blocks)); + } + Some(Message::Result(id, name, blocks)) => { + let id = id.trim_matches(blank); + if live.contains(id) { + provided.insert(id); + out.push(Turn::Result { + id, + name, + blocks: Some(blocks), + }); + } + } + } + } + out +} diff --git a/native/omk-providers/src/openai_responses.rs b/native/omk-providers/src/openai_responses.rs new file mode 100644 index 0000000000..6dac44dad7 --- /dev/null +++ b/native/omk-providers/src/openai_responses.rs @@ -0,0 +1,281 @@ +//! Bounded port of packages/ai/src/providers/openai-responses.ts buildParams/createClient and +//! openai-responses-shared.ts convertResponsesMessages/convertResponsesTools (MIT; root +//! LICENSE/NOTICE). Request bytes only for text history (see history.rs): no images, Codex turn +//! metadata, Copilot/Cloudflare clients or response parser. +mod headers; +mod history; +use crate::{ + openai_completions::{ + cache, + effort::{Level, LevelMap}, + endpoint, + }, + request::Tool, + request_cache::{Boundary, Retention}, + tool_schema, +}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_json::{Value, json, value::RawValue}; + +#[derive(Deserialize)] +#[serde(try_from = "Request")] +pub struct Input(Request); +impl TryFrom for Input { + type Error = String; + fn try_from(mut req: Request) -> Result { + if matches!( + req.provider.as_str(), + "github-copilot" | "cloudflare-workers-ai" | "cloudflare-ai-gateway" + ) { + return Err(format!( + "provider-specific client not ported: {}", + req.provider + )); + } + if req.compat.send_codex_turn_metadata == Some(true) { + return Err("sendCodexTurnMetadata is not ported".into()); + } + if req.reasoning_effort == Some(Level::Off) { + return Err("reasoningEffort off is not a Responses option".into()); + } + // Checked before pairing so dropped turns cannot hide an unresolved capability. + if req.vision.is_none() && history::has_images(&req.messages) { + return Err("images require explicit vision capability".into()); + } + history::prepare(&mut req.messages, &req.provider, &req.model); + Ok(Self(req)) + } +} + +/// Model compat as given; Node's `?? true` / `?? false` defaults are applied here. +#[derive(Deserialize, Default)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +struct Compat { + send_session_id_header: Option, + supports_long_cache_retention: Option, + send_codex_turn_metadata: Option, +} +#[derive(Deserialize)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +struct Request { + provider: String, + base_url: String, + model: String, + reasoning: bool, + /// Caller-resolved `model.input` includes "image"; required once history has images. + vision: Option, + #[serde(default)] + compat: Compat, + thinking_level_map: Option, + system: String, + messages: Vec, + #[serde(default)] + tools: Vec, + max_tokens: Option, + // Node forwards an explicit null for these, so null is refused rather than read as absent. + #[serde(default, deserialize_with = "present")] + temperature: Option, + #[serde(default, deserialize_with = "present")] + service_tier: Option, + reasoning_effort: Option, + reasoning_summary: Option, + cache_retention: Option, + #[serde(default, deserialize_with = "present")] + session_id: Option, + #[serde(default)] + system_prompt_cache_boundary: Boundary, + #[serde(default)] + system_prompt_cache_boundary_bypass: bool, + /// `model.headers`, then `options.headers` merged last. + model_headers: Option, + headers: Option, +} +fn present<'de, D: Deserializer<'de>, T: Deserialize<'de>>(d: D) -> Result, D::Error> { + T::deserialize(d).map(Some) +} +#[derive(Deserialize, Serialize, Clone, Copy)] +#[serde(rename_all = "lowercase")] +enum ServiceTier { + Auto, + Default, + Flex, + Scale, + Priority, +} +#[derive(Deserialize, Serialize, Clone, Copy)] +#[serde(rename_all = "lowercase")] +enum Summary { + Auto, + Detailed, + Concise, +} +#[derive(Serialize)] +struct Parameters<'a> { + properties: &'a RawValue, + required: &'a [String], + r#type: &'static str, +} +#[derive(Serialize)] +struct WireTool<'a> { + r#type: &'static str, + name: &'a str, + description: &'a str, + parameters: Parameters<'a>, + strict: bool, +} +#[derive(Serialize)] +struct Reasoning<'a> { + effort: &'a str, + #[serde(skip_serializing_if = "Option::is_none")] + summary: Option, +} +#[derive(Serialize)] +struct Body<'a> { + model: &'a str, + input: Vec>, + stream: bool, + #[serde(skip_serializing_if = "Option::is_none")] + prompt_cache_key: Option, + #[serde(skip_serializing_if = "Option::is_none")] + prompt_cache_retention: Option<&'static str>, + store: bool, + #[serde(skip_serializing_if = "Option::is_none")] + max_output_tokens: Option, + #[serde(skip_serializing_if = "Option::is_none")] + temperature: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + service_tier: Option, + #[serde(skip_serializing_if = "Option::is_none")] + tools: Option>>, + #[serde(skip_serializing_if = "Option::is_none")] + reasoning: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + include: Option<[&'static str; 1]>, +} + +/// buildParams' reasoning branch: explicit effort/summary, else the model's `off` value. +fn reasoning(req: &Request) -> (Option>, bool) { + if !req.reasoning { + return (None, false); + } + let mapped = |level: Level| { + req.thinking_level_map + .as_ref() + .and_then(|m| m.get(&level)) + .and_then(Option::as_deref) + }; + if req.reasoning_effort.is_some() || req.reasoning_summary.is_some() { + let effort = req + .reasoning_effort + .map_or("medium", |l| mapped(l).unwrap_or(l.name())); + let summary = req.reasoning_summary.unwrap_or(Summary::Auto); + return ( + Some(Reasoning { + effort, + summary: Some(summary), + }), + true, + ); + } + let off = req + .thinking_level_map + .as_ref() + .and_then(|m| m.get(&Level::Off)); + match off { + // `thinkingLevelMap.off === null` suppresses the parameter. + Some(None) => (None, false), + _ => ( + Some(Reasoning { + effort: mapped(Level::Off).unwrap_or("none"), + summary: None, + }), + false, + ), + } +} + +/// Builds the exact `{url, headers, body}` the Node SDK sends for the admitted surface. +pub fn build_request(input: &Input, api_key: &str) -> Result { + let req = &input.0; + let url = endpoint(&req.base_url, "responses")?; + let tools = tool_schema::stable(&req.tools)?; + // Node's default without OMK_CACHE_RETENTION, which is never read. + let retention = req.cache_retention.unwrap_or(Retention::Short); + let cached = !matches!(retention, Retention::None); + let session = req.session_id.as_deref().filter(|_| cached); + let prompt_cache_key = if cached { + cache::key(&cache::Policy { + base_url: &req.base_url, + provider: Some(&req.provider), + model: &req.model, + system: &req.system, + tools: &tools, + retention: Some(retention), + supports_long: req.compat.supports_long_cache_retention, + session, + boundary: &req.system_prompt_cache_boundary, + bypass: req.system_prompt_cache_boundary_bypass, + })? + } else { + None + }; + let long = matches!(retention, Retention::Long) + && req.compat.supports_long_cache_retention.unwrap_or(true); + let temperature = req + .temperature + .as_ref() + .map(|n| { + tool_schema::js_number(&n.to_string()) + .and_then(|s| RawValue::from_string(s).map_err(|e| e.to_string())) + }) + .transpose()?; + let (reasoning, include) = reasoning(req); + let body = Body { + model: &req.model, + input: history::items( + &req.messages, + &req.provider, + &req.model, + req.reasoning, + req.vision, + &req.system, + )?, + stream: true, + prompt_cache_key, + prompt_cache_retention: long.then_some("24h"), + store: false, + max_output_tokens: req.max_tokens.filter(|n| *n > 0), + temperature, + service_tier: req.service_tier, + tools: (!tools.is_empty()).then(|| { + tools + .iter() + .map(|(tool, properties)| WireTool { + r#type: "function", + name: &tool.name, + description: &tool.description, + parameters: Parameters { + properties, + required: &tool.required, + r#type: "object", + }, + strict: false, + }) + .collect() + }), + reasoning, + include: include.then_some(["reasoning.encrypted_content"]), + }; + let headers = headers::merge(&headers::Merge { + model: req.model_headers.as_ref(), + session: session.filter(|s| !s.is_empty()), + send_session_id: req.compat.send_session_id_header.unwrap_or(true), + options: req.headers.as_ref(), + api_key, + })?; + Ok(json!({ + "url": url, + "headers": headers, + "body": serde_json::to_string(&body).map_err(|e| e.to_string())?, + })) +} diff --git a/native/omk-providers/src/openai_responses/headers.rs b/native/omk-providers/src/openai_responses/headers.rs new file mode 100644 index 0000000000..10c96da679 --- /dev/null +++ b/native/omk-providers/src/openai_responses/headers.rs @@ -0,0 +1,94 @@ +//! createClient header merge (openai-responses.ts) and the openai SDK's buildHeaders order +//! (internal/headers.js, client.js; Apache-2.0): accept, auth, defaultHeaders, then content-type. +use crate::openai_completions::plain_header_value; +use serde::{ + Deserialize, Deserializer, + de::{MapAccess, Visitor}, +}; +use serde_json::{Map, Value, json}; +use std::{collections::HashSet, fmt}; + +/// A JS `Record` in source key order; duplicate keys are refused. +#[derive(Default)] +pub(super) struct Headers(Vec<(String, String)>); +impl<'de> Deserialize<'de> for Headers { + fn deserialize>(d: D) -> Result { + struct V; + impl<'de> Visitor<'de> for V { + type Value = Headers; + fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str("an object of string header values") + } + fn visit_map>(self, mut map: A) -> Result { + let mut entries = Vec::new(); + let mut seen = HashSet::new(); + while let Some((name, value)) = map.next_entry::()? { + if !seen.insert(name.clone()) { + return Err(serde::de::Error::custom("duplicate header name")); + } + entries.push((name, value)); + } + Ok(Headers(entries)) + } + } + d.deserialize_map(V) + } +} +impl Headers { + /// Object.assign: an existing key keeps its position and takes the new value. + fn set(&mut self, name: &str, value: &str) { + match self.0.iter_mut().find(|(n, _)| n == name) { + Some(entry) => entry.1 = value.into(), + None => self.0.push((name.into(), value.into())), + } + } +} + +fn token(name: &str) -> bool { + !name.is_empty() + && name + .bytes() + .all(|b| b.is_ascii_alphanumeric() || b"!#$%&'*+-.^_`|~".contains(&b)) +} + +pub(super) struct Merge<'a> { + pub model: Option<&'a Headers>, + pub session: Option<&'a str>, + pub send_session_id: bool, + pub options: Option<&'a Headers>, + pub api_key: &'a str, +} +pub(super) fn merge(m: &Merge) -> Result { + let mut merged = Headers(m.model.map(|h| h.0.clone()).unwrap_or_default()); + if let Some(session) = m.session { + let session = plain_header_value(session)?; + if m.send_session_id { + merged.set("session_id", session); + } + merged.set("x-client-request-id", session); + } + for (name, value) in m.options.iter().flat_map(|h| &h.0) { + merged.set(name, value); + } + // Array-index keys would reorder under Object.entries, but digits have no case variants, + // so per-lowercase-name "last entry wins" is unaffected. + let mut out = Map::new(); + out.insert("accept".into(), json!("application/json")); + out.insert( + "authorization".into(), + json!(format!("Bearer {}", m.api_key)), + ); + for (name, value) in &merged.0 { + let lower = name.to_ascii_lowercase(); + if !token(name) { + return Err(format!("header name is not an HTTP token: {name:?}")); + } + if lower == "user-agent" || lower.starts_with("x-stainless-") { + return Err(format!("SDK-owned header is not ported: {name}")); + } + out.insert(lower, json!(plain_header_value(value)?)); + } + // bodyHeaders come after defaultHeaders in buildHeaders. + out.insert("content-type".into(), json!("application/json")); + Ok(Value::Object(out)) +} diff --git a/native/omk-providers/src/openai_responses/history.rs b/native/omk-providers/src/openai_responses/history.rs new file mode 100644 index 0000000000..3a799e2010 --- /dev/null +++ b/native/omk-providers/src/openai_responses/history.rs @@ -0,0 +1,569 @@ +//! transform-messages.ts plus convertResponsesMessages history items (MIT; root LICENSE/NOTICE). +//! Images need caller-resolved vision: true keeps them as data URLs, false downgrades them. +use crate::{ + openai_completions::{arguments, handoff::short_hash}, + request_blocks::StopReason, + request_content::{InputContent, TOOL_IMAGE, USER_IMAGE, texts}, + request_history::{blank, nonblank}, +}; +use serde::{Deserialize, Serialize}; +use serde_json::{Value, value::RawValue}; +use std::{ + borrow::Cow, + collections::{HashMap, HashSet}, +}; + +const API: &str = "openai-responses"; +const TOOL_CALL_PROVIDERS: [&str; 3] = ["openai", "openai-codex", "opencode"]; + +#[derive(Deserialize)] +#[serde(deny_unknown_fields)] +pub(super) struct Source { + provider: String, + api: String, + model: String, +} +#[derive(Deserialize)] +#[serde(untagged)] +pub(super) enum Content { + Text(String), + Parts(Vec), +} + +// Arguments stay raw: serde's tagged-enum buffering would lose their key order. +#[derive(Deserialize)] +#[serde(try_from = "Box")] +pub(super) enum Block { + Text { + text: String, + signature: Option, + }, + Thinking { + thinking: String, + signature: Option, + redacted: bool, + }, + ToolCall { + id: String, + name: String, + arguments: Box, + }, +} +impl TryFrom> for Block { + type Error = String; + fn try_from(raw: Box) -> Result { + #[derive(Deserialize)] + struct Tag { + r#type: String, + } + #[derive(Deserialize)] + #[serde(rename_all = "camelCase", deny_unknown_fields)] + struct Text { + #[serde(rename = "type")] + _kind: String, + text: String, + text_signature: Option, + } + #[derive(Deserialize)] + #[serde(rename_all = "camelCase", deny_unknown_fields)] + struct Thinking { + #[serde(rename = "type")] + _kind: String, + thinking: String, + thinking_signature: Option, + redacted: Option, + } + #[derive(Deserialize)] + #[serde(rename_all = "camelCase", deny_unknown_fields)] + struct Call { + #[serde(rename = "type")] + _kind: String, + id: String, + name: String, + arguments: Box, + // Never emitted by the Responses converter. + #[serde(rename = "thoughtSignature")] + _signature: Option, + } + let err = |e: serde_json::Error| e.to_string(); + let s = raw.get(); + match serde_json::from_str::(s).map_err(err)?.r#type.as_str() { + "text" => { + let t: Text = serde_json::from_str(s).map_err(err)?; + Ok(Self::Text { + text: t.text, + signature: t.text_signature, + }) + } + "thinking" => { + let t: Thinking = serde_json::from_str(s).map_err(err)?; + Ok(Self::Thinking { + thinking: t.thinking, + signature: t.thinking_signature, + redacted: t.redacted.unwrap_or(false), + }) + } + "toolCall" => { + let c: Call = serde_json::from_str(s).map_err(err)?; + Ok(Self::ToolCall { + id: c.id, + name: c.name, + arguments: c.arguments, + }) + } + _ => Err("unsupported assistant block".into()), + } + } +} + +#[derive(Deserialize)] +#[serde(try_from = "Fields")] +pub(super) enum Message { + User(Content), + Assistant(Vec, StopReason, Source), + Result(String, Vec), +} +#[derive(Deserialize)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +struct Fields { + role: String, + content: Box, + source: Option, + stop_reason: Option, + tool_call_id: Option, + #[serde(rename = "toolName")] + _tool_name: Option, + #[serde(rename = "isError")] + _is_error: Option, +} +impl TryFrom for Message { + type Error = String; + fn try_from(f: Fields) -> Result { + let raw = f.content.get(); + let err = |e: serde_json::Error| e.to_string(); + let tool = f.tool_call_id.is_some() || f._tool_name.is_some() || f._is_error.is_some(); + match (f.role.as_str(), f.source, f.stop_reason, tool) { + ("user", None, None, false) => Ok(Self::User(serde_json::from_str(raw).map_err(err)?)), + ("assistant", Some(source), stop, false) => Ok(Self::Assistant( + serde_json::from_str(raw).map_err(err)?, + stop.unwrap_or_default(), + source, + )), + ("toolResult", None, None, true) => Ok(Self::Result( + f.tool_call_id.ok_or("toolResult needs toolCallId")?, + serde_json::from_str(raw).map_err(err)?, + )), + _ => Err("unsupported history fields (assistants need explicit source)".into()), + } + } +} + +pub(super) fn has_images(messages: &[Message]) -> bool { + let image = |c: &[InputContent]| c.iter().any(|c| matches!(c, InputContent::Image { .. })); + messages.iter().any(|m| match m { + Message::User(Content::Parts(c)) | Message::Result(_, c) => image(c), + _ => false, + }) +} + +/// normalizeIdPart: UTF-16 units outside [A-Za-z0-9_-] become `_`, 64 units, no trailing `_`. +fn id_part(part: &str) -> String { + let clean: String = part + .encode_utf16() + .take(64) + .map(|c| match u8::try_from(c) { + Ok(b) if b.is_ascii_alphanumeric() || matches!(b, b'_' | b'-') => b as char, + _ => '_', + }) + .collect(); + clean.trim_end_matches('_').into() +} +fn normalize(id: &str, provider: &str, source: &Source) -> String { + let Some((call, rest)) = id + .split_once('|') + .filter(|_| TOOL_CALL_PROVIDERS.contains(&provider)) + else { + return id_part(id); + }; + // JS split("|")[1]: text up to the next `|`. + let item = rest.split('|').next().unwrap_or_default(); + let foreign = source.provider != provider || source.api != API; + let mut item = if foreign { + format!("fc_{}", short_hash(item)) + } else { + id_part(item) + }; + if !item.starts_with("fc_") { + item = id_part(&format!("fc_{item}")); + } + format!("{}|{item}", id_part(call)) +} + +/// First pass of transformMessages for a target that is never the source model itself. +pub(super) fn prepare(messages: &mut [Message], provider: &str, model: &str) { + let mut ids = HashMap::new(); + for message in messages { + match message { + Message::Assistant(blocks, _, source) + if !(source.provider == provider && source.api == API && source.model == model) => + { + let mut kept = Vec::with_capacity(blocks.len()); + for block in std::mem::take(blocks) { + match block { + Block::Thinking { + thinking, redacted, .. + } => { + if !redacted && nonblank(&thinking) { + kept.push(Block::Text { + text: thinking, + signature: None, + }); + } + } + Block::Text { text, .. } => kept.push(Block::Text { + text, + signature: None, + }), + Block::ToolCall { + id, + name, + arguments, + } => { + let next = normalize(&id, provider, source); + if next != id { + ids.insert(id, next.clone()); + } + kept.push(Block::ToolCall { + id: next, + name, + arguments, + }); + } + } + } + *blocks = kept; + } + Message::Result(id, _) => { + if let Some(mapped) = ids.get(id.as_str()).filter(|s| !s.is_empty()) { + id.clone_from(mapped); + } + } + _ => {} + } + } +} + +enum Turn<'a> { + User(&'a Content), + Assistant(&'a [Block], &'a Source), + /// `None` is the synthetic "No result provided" result. + Result(&'a str, Option<&'a [InputContent]>), +} +/// Second pass: drop error/aborted turns and orphan results, synthesize missing results. +fn pair(messages: &[Message]) -> Vec> { + let mut out = Vec::new(); + let mut live = HashSet::new(); + let mut pending: Vec<&str> = Vec::new(); + let mut provided = HashSet::new(); + for message in messages.iter().map(Some).chain(std::iter::once(None)) { + if !matches!(message, Some(Message::Result(..))) { + for id in pending.drain(..) { + if !provided.contains(id) { + out.push(Turn::Result(id, None)); + } + } + provided.clear(); + } + match message { + None => break, + Some(Message::User(content)) => out.push(Turn::User(content)), + Some(Message::Assistant(_, StopReason::Error | StopReason::Aborted, _)) => {} + Some(Message::Assistant(blocks, _, source)) => { + for b in blocks { + if let Block::ToolCall { id, .. } = b { + pending.push(id); + if !id.is_empty() { + live.insert(id.as_str()); + } + } + } + out.push(Turn::Assistant(blocks, source)); + } + Some(Message::Result(id, parts)) => { + let id = id.trim_matches(blank); + if live.contains(id) { + provided.insert(id); + out.push(Turn::Result(id, Some(parts))); + } + } + } + } + out +} + +#[derive(Serialize)] +#[serde(untagged)] +pub(super) enum Item<'a> { + System { + role: &'static str, + content: &'a str, + }, + User { + role: &'static str, + content: Vec>, + }, + Message { + r#type: &'static str, + role: &'static str, + content: [OutputText<'a>; 1], + status: &'static str, + id: String, + #[serde(skip_serializing_if = "Option::is_none")] + phase: Option<&'static str>, + }, + Call { + r#type: &'static str, + #[serde(skip_serializing_if = "Option::is_none")] + id: Option<&'a str>, + call_id: &'a str, + name: &'a str, + arguments: String, + }, + Output { + r#type: &'static str, + call_id: &'a str, + output: Output<'a>, + }, + Reasoning(Box), +} +#[derive(Serialize)] +#[serde(untagged)] +pub(super) enum Output<'a> { + Text(String), + Parts(Vec>), +} +#[derive(Serialize)] +#[serde(tag = "type", rename_all = "snake_case")] +pub(super) enum Part<'a> { + InputText { + text: Cow<'a, str>, + }, + InputImage { + detail: &'static str, + image_url: String, + }, +} + +/// downgradeUnsupportedImages, then the input_text/input_image mapping. +fn parts<'a>( + content: &'a [InputContent], + vision: Option, + marker: &'static str, +) -> Result>, String> { + let has_image = content + .iter() + .any(|c| matches!(c, InputContent::Image { .. })); + if has_image && !vision.ok_or("images require explicit vision capability")? { + return Ok(texts(content, marker)? + .into_iter() + .map(|text| Part::InputText { text: text.into() }) + .collect()); + } + if content.len() > 4096 { + return Err("history content exceeds 4096 blocks".into()); + } + Ok(content + .iter() + .map(|c| match c { + InputContent::Text { text } => Part::InputText { text: text.into() }, + InputContent::Image { data, mime_type } => Part::InputImage { + detail: "auto", + image_url: format!("data:{mime_type};base64,{data}"), + }, + }) + .collect()) +} +#[derive(Serialize)] +pub(super) struct OutputText<'a> { + r#type: &'static str, + text: &'a str, + annotations: [(); 0], +} + +/// parseTextSignature: `{v:1,id}` JSON with an optional known phase, else the raw string. +fn message_id(signature: Option<&str>) -> Result<(Option, Option<&'static str>), String> { + let Some(sig) = signature.filter(|s| !s.is_empty()) else { + return Ok((None, None)); + }; + if !sig.starts_with('{') { + return Ok((Some(sig.into()), None)); + } + // JSON.parse also accepts lone surrogate escapes and overflowing numbers; refuse, never guess. + let Ok(Value::Object(mut map)) = serde_json::from_str::(sig) else { + return Err("text signature starting with `{` is not portable JSON".into()); + }; + let v1 = map.get("v").and_then(Value::as_f64) == Some(1.0); + match map.remove("id") { + Some(Value::String(id)) if v1 => { + let phase = match map.get("phase").and_then(Value::as_str) { + Some("commentary") => Some("commentary"), + Some("final_answer") => Some("final_answer"), + _ => None, + }; + // An empty v1 id is falsy in Node and falls back to msg_omk_*. + Ok(((!id.is_empty()).then_some(id), phase)) + } + _ => Ok((Some(sig.into()), None)), + } +} + +pub(super) fn items<'a>( + messages: &'a [Message], + provider: &str, + model: &str, + reasoning: bool, + vision: Option, + system: &'a str, +) -> Result>, String> { + let mut items = Vec::new(); + if !system.is_empty() { + let role = if reasoning { "developer" } else { "system" }; + items.push(Item::System { + role, + content: system, + }); + } + let mut index = 0usize; + for turn in pair(messages) { + let before = items.len(); + match turn { + Turn::User(content) => { + let content = match content { + Content::Text(s) => vec![Part::InputText { text: s.into() }], + Content::Parts(c) => parts(c, vision, USER_IMAGE)?, + }; + if !content.is_empty() { + items.push(Item::User { + role: "user", + content, + }); + } + } + Turn::Assistant(blocks, source) => { + let different = + source.model != model && source.provider == provider && source.api == API; + let mut text_index = 0usize; + for block in blocks { + match block { + Block::Thinking { + thinking, + signature, + .. + } => { + let Some(sig) = signature.as_deref().filter(|s| !s.is_empty()) else { + continue; + }; + if !nonblank(thinking) { + continue; + } + let raw = serde_json::from_str::<&RawValue>(sig) + .map_err(|_| "Invalid OpenAI reasoning signature".to_string())?; + let item = arguments::stringify(raw) + .map_err(|e| format!("unsupported reasoning signature: {e}"))?; + items.push(Item::Reasoning( + RawValue::from_string(item).map_err(|e| e.to_string())?, + )); + } + Block::Text { text, signature } => { + let (id, phase) = message_id(signature.as_deref())?; + let id = match id { + Some(id) if id.encode_utf16().count() > 64 => { + format!("msg_{}", short_hash(&id)) + } + Some(id) => id, + None if text_index == 0 => format!("msg_omk_{index}"), + None => format!("msg_omk_{index}_{text_index}"), + }; + text_index += 1; + items.push(Item::Message { + r#type: "message", + role: "assistant", + content: [OutputText { + r#type: "output_text", + text, + annotations: [], + }], + status: "completed", + id, + phase, + }); + } + Block::ToolCall { + id, + name, + arguments: args, + } => { + let mut parts = id.split('|'); + let call_id = parts.next().unwrap_or_default(); + let item = parts + .next() + .filter(|item| !(different && item.starts_with("fc_"))); + items.push(Item::Call { + r#type: "function_call", + id: item, + call_id, + name, + arguments: arguments::stringify(args)?, + }); + } + } + } + } + Turn::Result(id, parts) => { + let parts = parts + .map(|p| self::parts(p, vision, TOOL_IMAGE)) + .transpose()?; + let output = match parts { + None => Output::Text("No result provided".into()), + Some(parts) => { + let text = parts + .iter() + .filter_map(|p| match p { + Part::InputText { text } => Some(text.as_ref()), + Part::InputImage { .. } => None, + }) + .collect::>() + .join("\n"); + // After the downgrade, remaining images imply a vision model. + let images: Vec<_> = parts + .into_iter() + .filter(|p| matches!(p, Part::InputImage { .. })) + .collect(); + if !images.is_empty() { + let mut out = Vec::with_capacity(images.len() + 1); + if !text.is_empty() { + out.push(Part::InputText { text: text.into() }); + } + out.extend(images); + Output::Parts(out) + } else if text.is_empty() { + Output::Text("(see attached image)".into()) + } else { + Output::Text(text) + } + } + }; + items.push(Item::Output { + r#type: "function_call_output", + call_id: id.split('|').next().unwrap_or_default(), + output, + }); + } + } + // Node `continue`s past msgIndex++ when a user or assistant turn adds no items. + if items.len() > before { + index += 1; + } + } + Ok(items) +} diff --git a/native/omk-providers/src/request.rs b/native/omk-providers/src/request.rs index f610514b71..e3749c55cf 100644 --- a/native/omk-providers/src/request.rs +++ b/native/omk-providers/src/request.rs @@ -1,11 +1,18 @@ -use crate::request_history::{HistoryMessage, Message, Text, messages}; +use crate::request_cache::{self, Text}; +use crate::request_history::{HistoryMessage, Message, messages}; use serde::{Deserialize, Serialize}; use serde_json::{Value, json, value::RawValue}; -/// Deliberately bounded API-key, no-cache synthetic request surface. +/// Shared bounded Anthropic input; optional request policies require catalog dispatch. #[derive(Deserialize)] #[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct Input { + #[serde(default)] + pub options: Option, + #[serde(default)] + pub system_prompt_cache_boundary: request_cache::Boundary, + #[serde(default)] + pub system_prompt_cache_boundary_bypass: bool, pub model: String, pub max_tokens: u32, pub system: String, @@ -17,10 +24,10 @@ pub struct Input { #[derive(Deserialize, Serialize)] #[serde(deny_unknown_fields)] pub struct Tool { - name: String, - description: String, - properties: Box, - required: Vec, + pub(crate) name: String, + pub(crate) description: String, + pub(crate) properties: Box, + pub(crate) required: Vec, } #[derive(Serialize)] struct Schema<'a> { @@ -29,7 +36,10 @@ struct Schema<'a> { properties: &'a RawValue, required: &'a [String], } -fn compact_raw(value: &RawValue, serializer: S) -> Result { +pub(crate) fn compact_raw( + value: &RawValue, + serializer: S, +) -> Result { let mut quoted = false; let mut escaped = false; let compact: String = value @@ -61,8 +71,11 @@ fn compact_raw(value: &RawValue, serializer: S) -> Result< struct WireTool<'a> { name: &'a str, description: &'a str, + #[serde(skip_serializing_if = "std::ops::Not::not")] eager_input_streaming: bool, input_schema: Schema<'a>, + #[serde(skip_serializing_if = "Option::is_none")] + cache_control: Option, } #[derive(Serialize)] struct Body<'a> { @@ -70,53 +83,95 @@ struct Body<'a> { messages: Vec>, max_tokens: u32, stream: bool, + #[serde(skip_serializing_if = "Option::is_none")] + fallbacks: Option<&'a str>, #[serde(skip_serializing_if = "Vec::is_empty")] system: Vec>, + #[serde(skip_serializing_if = "Option::is_none")] + temperature: Option, #[serde(skip_serializing_if = "Vec::is_empty")] tools: Vec>, + #[serde(skip_serializing_if = "Option::is_none")] + thinking: Option, + #[serde(skip_serializing_if = "Option::is_none")] + output_config: Option, + #[serde(skip_serializing_if = "Option::is_none")] + metadata: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + tool_choice: Option>, } pub fn build_request(input: &Input) -> Result { - if input.model != "synthetic-anthropic" || input.max_tokens == 0 { + if input.options.is_some() + || !input.system_prompt_cache_boundary.is_missing() + || input.system_prompt_cache_boundary_bypass + { + return Err("request options require catalog dispatch".into()); + } + let vision = input.model == "synthetic-anthropic-vision"; + if (!vision && input.model != "synthetic-anthropic") || input.max_tokens == 0 { return Err( "only the recorded synthetic model and positive maxTokens are supported".into(), ); } + Ok(json!({ + "url":"https://synthetic.invalid/v1/messages", + "headers":{ + "accept":"application/json","anthropic-beta":"interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access":"true","anthropic-version":"2023-06-01", + "content-type":"application/json","x-api-key":"faux-key" + }, + "body":build_body(input, vision, true, None, crate::request_policy::Policy::default())? + })) +} +pub(crate) fn build_body<'a>( + input: &'a Input, + vision: bool, + eager: bool, + fallbacks: Option<&str>, + policy: crate::request_policy::Policy<'a>, +) -> Result { + if input.max_tokens == 0 { + return Err("invalid maxTokens".into()); + } + let tools = crate::tool_schema::stable(&input.tools)?; let body = Body { model: &input.model, - messages: messages(&input.history, &input.user), + temperature: policy.temperature, + thinking: policy.thinking, + output_config: policy.output_config, + metadata: policy.metadata, + tool_choice: policy.tool_choice, + messages: messages( + &input.history, + &input.user, + vision, + policy.cache, + policy.allow_empty_signature, + )?, max_tokens: input.max_tokens, stream: true, - system: if input.system.is_empty() { - vec![] - } else { - vec![Text { - r#type: "text", - text: &input.system, - }] - }, - tools: input - .tools + fallbacks, + system: request_cache::system(input, policy.cache), + tools: tools .iter() - .map(|tool| WireTool { + .enumerate() + .map(|(index, (tool, properties))| WireTool { + cache_control: if policy.cache_tools && index + 1 == tools.len() { + policy.cache + } else { + None + }, name: &tool.name, description: &tool.description, - eager_input_streaming: true, + eager_input_streaming: eager, input_schema: Schema { r#type: "object", - properties: &tool.properties, + properties, required: &tool.required, }, }) .collect(), }; - Ok(json!({ - "url": "https://synthetic.invalid/v1/messages", - "headers": { - "accept": "application/json", "anthropic-beta": "interleaved-thinking-2025-05-14", - "anthropic-dangerous-direct-browser-access": "true", "anthropic-version": "2023-06-01", - "content-type": "application/json", "x-api-key": "faux-key" - }, - "body": serde_json::to_string(&body).map_err(|e| e.to_string())? - })) + serde_json::to_string(&body).map_err(|e| e.to_string()) } diff --git a/native/omk-providers/src/request_blocks.rs b/native/omk-providers/src/request_blocks.rs new file mode 100644 index 0000000000..d201a2a5df --- /dev/null +++ b/native/omk-providers/src/request_blocks.rs @@ -0,0 +1,264 @@ +//! Same-model request blocks ported from packages/ai/src/providers/anthropic.ts (MIT). +use crate::request_content::{InputContent, TOOL_IMAGE, convert}; +use crate::{json_parse::parse_json_with_repair, request::compact_raw, request_history::nonblank}; +use serde::{Deserialize, Serialize}; +use serde_json::value::RawValue; +use std::borrow::Cow; + +#[derive(Serialize)] +#[serde(untagged)] +pub(crate) enum ToolContent<'a> { + Text(String), + Blocks(Vec>), +} +#[derive(Serialize)] +pub(crate) struct ImageSource<'a> { + pub r#type: &'static str, + pub media_type: &'a str, + pub data: &'a str, +} + +#[derive(Default, Deserialize)] +#[serde(rename_all = "camelCase")] +pub(crate) enum StopReason { + #[default] + Stop, + Length, + ToolUse, + Error, + Aborted, +} + +#[derive(Deserialize)] +#[serde(try_from = "BlockInput")] +pub(crate) enum Block { + Text { + text: String, + }, + Thinking { + thinking: String, + thinking_signature: Option, + redacted: bool, + }, + ToolCall { + id: String, + name: String, + arguments: Box, + }, +} +#[derive(Deserialize)] +#[serde(rename_all = "camelCase")] +enum Kind { + Text, + Thinking, + ToolCall, +} +#[derive(Deserialize)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +struct BlockInput { + r#type: Kind, + text: Option, + thinking: Option, + thinking_signature: Option, + redacted: Option, + id: Option, + name: Option, + arguments: Option>, +} +impl TryFrom for Block { + type Error = &'static str; + fn try_from(input: BlockInput) -> Result { + match input { + BlockInput { + r#type: Kind::Text, + text: Some(text), + thinking: None, + thinking_signature: None, + redacted: None, + id: None, + name: None, + arguments: None, + } => Ok(Self::Text { text }), + BlockInput { + r#type: Kind::Thinking, + text: None, + thinking: Some(thinking), + thinking_signature, + redacted, + id: None, + name: None, + arguments: None, + } => { + let redacted = redacted.unwrap_or(false); + if redacted && thinking_signature.is_none() { + return Err("redacted thinking requires a signature"); + } + Ok(Self::Thinking { + thinking, + thinking_signature, + redacted, + }) + } + BlockInput { + r#type: Kind::ToolCall, + text: None, + thinking: None, + thinking_signature: None, + redacted: None, + id: Some(id), + name: Some(name), + arguments: Some(arguments), + } => Ok(Self::ToolCall { + id, + name, + arguments, + }), + _ => Err("unsupported or ambiguous history block fields"), + } + } +} + +pub(crate) enum BlockHistory { + Assistant { + content: Vec, + stop_reason: StopReason, + }, + ToolResult { + tool_call_id: String, + content: Vec, + is_error: bool, + }, +} +#[derive(Serialize)] +#[serde(tag = "type", rename_all = "snake_case")] +pub(crate) enum WireBlock<'a> { + Text { + text: Cow<'a, str>, + }, + Image { + source: ImageSource<'a>, + }, + Thinking { + thinking: &'a str, + signature: &'a str, + }, + RedactedThinking { + data: &'a str, + }, + ToolUse { + id: &'a str, + name: &'a str, + #[serde(serialize_with = "compact_raw")] + input: &'a RawValue, + }, + ToolResult { + tool_use_id: &'a str, + content: ToolContent<'a>, + is_error: bool, + }, +} + +pub(crate) fn blocks( + content: &[Block], + allow_empty_signature: bool, +) -> Result>, String> { + if content.len() > 4096 { + return Err("history content exceeds 4096 blocks".into()); + } + let mut result = Vec::new(); + for block in content { + match block { + Block::Text { text } if nonblank(text) => { + result.push(WireBlock::Text { text: text.into() }) + } + Block::Thinking { + thinking_signature, + redacted: true, + .. + } => { + let data = thinking_signature + .as_deref() + .ok_or("redacted thinking requires a signature")?; + result.push(WireBlock::RedactedThinking { data }); + } + Block::Thinking { + thinking, + thinking_signature, + .. + } if nonblank(thinking) => { + result.push( + match thinking_signature.as_deref().filter(|s| nonblank(s)) { + Some(signature) => WireBlock::Thinking { + thinking, + signature, + }, + None if allow_empty_signature => WireBlock::Thinking { + thinking, + signature: "", + }, + None => WireBlock::Text { + text: thinking.into(), + }, + }, + ); + } + Block::ToolCall { + id, + name, + arguments, + } => { + // Preserve recorded Node key order; raw JSON lexical parity is corpus-bounded. + parse_json_with_repair(arguments.get()).map_err(|e| e.to_string())?; + result.push(WireBlock::ToolUse { + id, + name, + input: arguments, + }); + } + Block::Text { .. } | Block::Thinking { .. } => {} + } + } + Ok(result) +} + +pub(crate) fn tool_result<'a>( + id: &'a str, + content: &'a [InputContent], + is_error: bool, + vision: bool, +) -> Result, String> { + let mut blocks = convert(content, vision, TOOL_IMAGE)?; + let content = if blocks + .iter() + .any(|block| matches!(block, WireBlock::Image { .. })) + { + if !blocks + .iter() + .any(|block| matches!(block, WireBlock::Text { .. })) + { + blocks.insert( + 0, + WireBlock::Text { + text: "(see attached image)".into(), + }, + ); + } + ToolContent::Blocks(blocks) + } else { + ToolContent::Text( + blocks + .iter() + .filter_map(|block| match block { + WireBlock::Text { text } => Some(text.as_ref()), + _ => None, + }) + .collect::>() + .join("\n"), + ) + }; + Ok(WireBlock::ToolResult { + tool_use_id: id, + content, + is_error, + }) +} diff --git a/native/omk-providers/src/request_cache.rs b/native/omk-providers/src/request_cache.rs new file mode 100644 index 0000000000..1b071f1c07 --- /dev/null +++ b/native/omk-providers/src/request_cache.rs @@ -0,0 +1,102 @@ +//! Explicit request caching; no environment reads or cache-affinity/session policy. +use crate::request::Input; +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::borrow::Cow; + +#[derive(Clone, Copy, Default, Deserialize)] +#[serde(rename_all = "lowercase")] +pub enum Retention { + #[default] + None, + Short, + Long, +} + +#[derive(Default)] +pub enum Boundary { + #[default] + Missing, + Present(Value), +} +impl<'de> Deserialize<'de> for Boundary { + fn deserialize>(d: D) -> Result { + Value::deserialize(d).map(Self::Present) + } +} +impl Boundary { + pub(crate) fn is_missing(&self) -> bool { + matches!(self, Self::Missing) + } +} +#[derive(Clone, Copy, Serialize)] +pub(crate) struct Control { + r#type: &'static str, + #[serde(skip_serializing_if = "Option::is_none")] + ttl: Option<&'static str>, +} +pub(crate) fn control(model: &Value, retention: Retention) -> Option { + match retention { + Retention::None => None, + retention => Some(Control { + r#type: "ephemeral", + ttl: (matches!(retention, Retention::Long) + && model["compat"]["supportsLongCacheRetention"] + .as_bool() + .unwrap_or(model["provider"] != "fireworks")) + .then_some("1h"), + }), + } +} +#[derive(Serialize)] +pub(crate) struct Text<'a> { + pub r#type: &'static str, + pub text: Cow<'a, str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub cache_control: Option, +} +pub(crate) fn system(input: &Input, cache: Option) -> Vec> { + if input.system.is_empty() { + return vec![]; + } + let bypass = input.system_prompt_cache_boundary_bypass; + let units: Vec<_> = input.system.encode_utf16().collect(); + let boundary = match &input.system_prompt_cache_boundary { + Boundary::Present(Value::Number(n)) if cache.is_some() && !bypass => n + .as_f64() + .filter(|n| *n > 0.0 && n.fract() == 0.0 && *n <= units.len() as f64) + .map(|n| n as usize), + _ => None, + }; + if let Some(n) = boundary { + let mut blocks = vec![Text { + r#type: "text", + text: char::decode_utf16(units[..n].iter().copied()) + .filter_map(Result::ok) + .collect::() + .into(), + cache_control: cache, + }]; + if n < units.len() { + blocks.push(Text { + r#type: "text", + text: char::decode_utf16(units[n..].iter().copied()) + .filter_map(Result::ok) + .collect::() + .into(), + cache_control: None, + }); + } + blocks + } else { + vec![Text { + r#type: "text", + text: (&input.system).into(), + cache_control: if bypass || !input.system_prompt_cache_boundary.is_missing() { + None + } else { + cache + }, + }] + } +} diff --git a/native/omk-providers/src/request_content.rs b/native/omk-providers/src/request_content.rs new file mode 100644 index 0000000000..d6e883bd64 --- /dev/null +++ b/native/omk-providers/src/request_content.rs @@ -0,0 +1,80 @@ +//! Image conversion ported from the Node Anthropic provider and transform-messages.ts (MIT). +use crate::{ + request_blocks::{ImageSource, WireBlock}, + request_images::omission, +}; +use serde::Deserialize; + +pub(crate) const USER_IMAGE: &str = "(image omitted: model does not support images)"; +pub(crate) const TOOL_IMAGE: &str = "(tool image omitted: model does not support images)"; + +#[derive(Deserialize)] +#[serde(tag = "type", rename_all = "lowercase", deny_unknown_fields)] +pub(crate) enum InputContent { + Text { + text: String, + }, + Image { + data: String, + #[serde(rename = "mimeType")] + mime_type: String, + }, +} + +pub(crate) fn texts<'a>( + content: &'a [InputContent], + placeholder: &'a str, +) -> Result, String> { + if content.len() > 4096 { + return Err("history content exceeds 4096 blocks".into()); + } + let mut result = Vec::new(); + let mut previous_was_placeholder = false; + for block in content { + match block { + InputContent::Text { text } => { + result.push(text.as_str()); + previous_was_placeholder = text == placeholder; + } + InputContent::Image { .. } => { + if !previous_was_placeholder { + result.push(placeholder); + } + previous_was_placeholder = true; + } + } + } + Ok(result) +} + +pub(crate) fn convert<'a>( + content: &'a [InputContent], + vision: bool, + placeholder: &'a str, +) -> Result>, String> { + if !vision { + return Ok(texts(content, placeholder)? + .into_iter() + .map(|text| WireBlock::Text { text: text.into() }) + .collect()); + } + if content.len() > 4096 { + return Err("history content exceeds 4096 blocks".into()); + } + Ok(content + .iter() + .map(|block| match block { + InputContent::Text { text } => WireBlock::Text { text: text.into() }, + InputContent::Image { data, mime_type } => match omission(data) { + Some(text) => WireBlock::Text { text: text.into() }, + None => WireBlock::Image { + source: ImageSource { + r#type: "base64", + media_type: mime_type, + data, + }, + }, + }, + }) + .collect()) +} diff --git a/native/omk-providers/src/request_history.rs b/native/omk-providers/src/request_history.rs index 545f3b0b0a..cf3da15440 100644 --- a/native/omk-providers/src/request_history.rs +++ b/native/omk-providers/src/request_history.rs @@ -1,67 +1,252 @@ +//! Tool pairing ported from packages/ai/src/providers/transform-messages.ts (MIT). +use crate::request_blocks::{ + BlockHistory, StopReason, ToolContent, WireBlock, blocks, tool_result, +}; +use crate::request_cache::{Control, Text}; +use crate::request_content::{InputContent, USER_IMAGE, convert}; use serde::{Deserialize, Serialize}; +use serde_json::value::RawValue; +use std::collections::HashSet; -/// Only the same-model text history covered by the independent Node oracle. #[derive(Deserialize)] -#[serde(tag = "role", rename_all = "lowercase", deny_unknown_fields)] +#[serde(try_from = "HistoryInput")] pub(crate) enum HistoryMessage { User { text: String }, + UserBlocks { content: Vec }, Assistant { text: String }, + Blocks(BlockHistory), +} +#[derive(Deserialize)] +#[serde(rename_all = "camelCase")] +enum Role { + User, + Assistant, + ToolResult, +} +#[derive(Deserialize)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +struct HistoryInput { + role: Role, + text: Option, + content: Option>, + stop_reason: Option, + tool_call_id: Option, + is_error: Option, +} +impl TryFrom for HistoryMessage { + type Error = String; + fn try_from(input: HistoryInput) -> Result { + let HistoryInput { + role, + text, + content, + stop_reason, + tool_call_id, + is_error, + } = input; + match (role, text, content, stop_reason, tool_call_id, is_error) { + (Role::User, Some(text), None, None, None, None) => Ok(Self::User { text }), + (Role::User, None, Some(content), None, None, None) => Ok(Self::UserBlocks { + content: serde_json::from_str(content.get()).map_err(|e| e.to_string())?, + }), + (Role::Assistant, Some(text), None, None, None, None) => Ok(Self::Assistant { text }), + (Role::Assistant, None, Some(content), stop_reason, None, None) => { + Ok(Self::Blocks(BlockHistory::Assistant { + content: serde_json::from_str(content.get()).map_err(|e| e.to_string())?, + stop_reason: stop_reason.unwrap_or_default(), + })) + } + (Role::ToolResult, None, Some(content), None, Some(tool_call_id), Some(is_error)) => { + Ok(Self::Blocks(BlockHistory::ToolResult { + tool_call_id, + content: serde_json::from_str(content.get()).map_err(|e| e.to_string())?, + is_error, + })) + } + _ => Err("unsupported or ambiguous history message fields".into()), + } + } } #[derive(Serialize)] -pub(crate) struct Text<'a> { - pub r#type: &'a str, - pub text: &'a str, +struct CachedBlock<'a> { + #[serde(flatten)] + block: WireBlock<'a>, + #[serde(skip_serializing_if = "Option::is_none")] + cache_control: Option, } - #[derive(Serialize)] #[serde(untagged)] enum Content<'a> { Text(&'a str), - Blocks([Text<'a>; 1]), + Blocks(Vec>), + CachedText(Vec>), + CachedBlocks(Vec>), } - #[derive(Serialize)] pub(crate) struct Message<'a> { role: &'a str, content: Content<'a>, } -// ECMAScript trim's whitespace set differs from Rust's, notably U+0085 and U+FEFF. -fn nonblank(text: &str) -> bool { - text.chars().any(|c| { - !matches!(c, '\u{0009}'..='\u{000d}' | ' ' | '\u{00a0}' | '\u{1680}' - | '\u{2000}'..='\u{200a}' | '\u{2028}' | '\u{2029}' | '\u{202f}' - | '\u{205f}' | '\u{3000}' | '\u{feff}') - }) +// ECMAScript trim differs from Rust's whitespace set (U+0085 and U+FEFF). +pub(crate) fn blank(c: char) -> bool { + matches!(c, '\u{0009}'..='\u{000d}' | ' ' | '\u{00a0}' | '\u{1680}' + | '\u{2000}'..='\u{200a}' | '\u{2028}' | '\u{2029}' | '\u{202f}' + | '\u{205f}' | '\u{3000}' | '\u{feff}') +} +pub(crate) fn nonblank(text: &str) -> bool { + text.chars().any(|c| !blank(c)) } -pub(crate) fn messages<'a>(history: &'a [HistoryMessage], user: &'a str) -> Vec> { - let mut result = Vec::new(); +enum Turn<'a> { + User(&'a str), + UserBlocks(Vec>), + Assistant(Vec>), + ToolResult(WireBlock<'a>), +} +fn flush<'a>( + pending: &mut Vec<&'a str>, + provided: &mut HashSet<&'a str>, + turns: &mut Vec>, +) { + for id in pending.drain(..) { + if !provided.contains(id) { + turns.push(Turn::ToolResult(WireBlock::ToolResult { + tool_use_id: id, + content: ToolContent::Text("No result provided".into()), + is_error: true, + })); + } + } + provided.clear(); +} + +pub(crate) fn messages<'a>( + history: &'a [HistoryMessage], + user: &'a str, + vision: bool, + cache: Option, + allow_empty_signature: bool, +) -> Result>, String> { + if history.len() > 4096 { + return Err("history exceeds 4096 messages".into()); + } + let (mut pending, mut provided, mut live, mut turns) = + (Vec::new(), HashSet::new(), HashSet::new(), Vec::new()); for message in history { - let (role, text) = match message { - HistoryMessage::User { text } => ("user", text.as_str()), - HistoryMessage::Assistant { text } => ("assistant", text.as_str()), - }; - if !nonblank(text) { - continue; + match message { + HistoryMessage::UserBlocks { content } => { + flush(&mut pending, &mut provided, &mut turns); + let content = convert(content, vision, USER_IMAGE)? + .into_iter() + .filter(|block| !matches!(block, WireBlock::Text { text } if !nonblank(text))) + .collect(); + turns.push(Turn::UserBlocks(content)); + } + HistoryMessage::User { text } => { + flush(&mut pending, &mut provided, &mut turns); + turns.push(Turn::User(text)); + } + HistoryMessage::Assistant { text } => { + flush(&mut pending, &mut provided, &mut turns); + turns.push(Turn::Assistant(if nonblank(text) { + vec![WireBlock::Text { text: text.into() }] + } else { + vec![] + })); + } + HistoryMessage::Blocks(BlockHistory::Assistant { + content, + stop_reason, + }) => { + let content = blocks(content, allow_empty_signature)?; + flush(&mut pending, &mut provided, &mut turns); + if matches!(stop_reason, StopReason::Error | StopReason::Aborted) { + continue; + } + for block in &content { + if let WireBlock::ToolUse { id, .. } = block { + pending.push(*id); + if !id.is_empty() { + live.insert(*id); + } + } + } + turns.push(Turn::Assistant(content)); + } + HistoryMessage::Blocks(BlockHistory::ToolResult { + tool_call_id, + content, + is_error, + }) => { + let id = tool_call_id.trim_matches(blank); + let block = tool_result(id, content, *is_error, vision)?; + if id.is_empty() || !live.contains(id) { + continue; + } + provided.insert(id); + turns.push(Turn::ToolResult(block)); + } + } + } + flush(&mut pending, &mut provided, &mut turns); + turns.push(Turn::User(user)); + let mut turns = turns.into_iter().peekable(); + let mut result = Vec::new(); + while let Some(turn) = turns.next() { + match turn { + Turn::UserBlocks(content) if !content.is_empty() => result.push(Message { + role: "user", + content: Content::Blocks(content), + }), + Turn::User(text) if nonblank(text) => result.push(Message { + role: "user", + content: Content::Text(text), + }), + Turn::Assistant(content) if !content.is_empty() => result.push(Message { + role: "assistant", + content: Content::Blocks(content), + }), + Turn::ToolResult(block) => { + let mut content = vec![block]; + while matches!(turns.peek(), Some(Turn::ToolResult(_))) { + if let Some(Turn::ToolResult(block)) = turns.next() { + content.push(block); + } + } + result.push(Message { + role: "user", + content: Content::Blocks(content), + }); + } + Turn::User(_) | Turn::UserBlocks(_) | Turn::Assistant(_) => {} } - result.push(Message { - role, - content: match message { - HistoryMessage::User { .. } => Content::Text(text), - HistoryMessage::Assistant { .. } => Content::Blocks([Text { - r#type: "text", - text, - }]), - }, - }); } - if nonblank(user) { - result.push(Message { - role: "user", - content: Content::Text(user), - }); + if let Some(cache) = cache + && let Some(last) = result.last_mut().filter(|message| message.role == "user") + { + last.content = match std::mem::replace(&mut last.content, Content::Text("")) { + Content::Text(text) => Content::CachedText(vec![Text { + r#type: "text", + text: text.into(), + cache_control: Some(cache), + }]), + Content::Blocks(blocks) => { + let len = blocks.len(); + Content::CachedBlocks( + blocks + .into_iter() + .enumerate() + .map(|(index, block)| CachedBlock { + block, + cache_control: (index + 1 == len).then_some(cache), + }) + .collect(), + ) + } + other => other, + }; } - result + Ok(result) } diff --git a/native/omk-providers/src/request_images.rs b/native/omk-providers/src/request_images.rs new file mode 100644 index 0000000000..dbe279c2d0 --- /dev/null +++ b/native/omk-providers/src/request_images.rs @@ -0,0 +1,97 @@ +//! Header guard ported from packages/ai/src/providers/anthropic-image-guard.ts (MIT). +fn header(data: &str) -> Vec { + let mut bytes = Vec::new(); + let (mut value, mut bits) = (0u32, 0); + // Buffer.from(base64) uses low UTF-16 bytes; slice by code units before decoding. + for unit in data.encode_utf16().take(87384) { + let digit = match unit as u8 { + b'A'..=b'Z' => (unit as u8 - b'A') as u32, + b'a'..=b'z' => (unit as u8 - b'a' + 26) as u32, + b'0'..=b'9' => (unit as u8 - b'0' + 52) as u32, + b'+' | b'-' => 62, + b'/' | b'_' => 63, + b'=' => break, + _ => continue, + }; + value = (value << 6) | digit; + bits += 6; + if bits >= 8 { + bits -= 8; + bytes.push((value >> bits) as u8); + value &= (1 << bits) - 1; + } + } + bytes +} +fn dimensions(b: &[u8]) -> Option<(u32, u32)> { + if b.len() < 10 { + return None; + } + let be16 = |i| u16::from_be_bytes([b[i], b[i + 1]]) as u32; + let le16 = |i| u16::from_le_bytes([b[i], b[i + 1]]) as u32; + if b.starts_with(&[0x89, 0x50, 0x4e, 0x47]) { + return (b.len() >= 24).then(|| { + ( + u32::from_be_bytes(b[16..20].try_into().unwrap()), + u32::from_be_bytes(b[20..24].try_into().unwrap()), + ) + }); + } + if b.starts_with(b"GIF8") { + return Some((le16(6), le16(8))); + } + if b.starts_with(&[0xff, 0xd8]) { + let mut offset = 2; + while offset + 9 < b.len() { + if b[offset] != 0xff { + offset += 1; + continue; + } + let marker = b[offset + 1]; + if (0xc0..=0xcf).contains(&marker) && ![0xc4, 0xc8, 0xcc].contains(&marker) { + return Some((be16(offset + 7), be16(offset + 5))); + } + let size = be16(offset + 2) as usize; + if size < 2 { + break; + } + offset += 2 + size; + } + return None; + } + if b.len() >= 30 && b.starts_with(b"RIFF") && &b[8..12] == b"WEBP" { + return match &b[12..16] { + b"VP8X" => Some(( + 1 + b[24] as u32 + ((b[25] as u32) << 8) + ((b[26] as u32) << 16), + 1 + b[27] as u32 + ((b[28] as u32) << 8) + ((b[29] as u32) << 16), + )), + b"VP8 " => Some((le16(26) & 0x3fff, le16(28) & 0x3fff)), + b"VP8L" => Some(( + 1 + (((b[22] as u32 & 0x3f) << 8) | b[21] as u32), + 1 + (((b[24] as u32 & 0x0f) << 10) + | ((b[23] as u32) << 2) + | ((b[22] as u32 & 0xc0) >> 6)), + )), + _ => None, + }; + } + None +} +pub(crate) fn omission(data: &str) -> Option { + let (width, height) = dimensions(&header(data))?; + (width > 1900 || height > 1900).then(|| format!( + "[image omitted: {width}x{height} exceeds the Anthropic 1900px dimension limit. The image was replaced to keep the request valid — ask the user to resize and re-attach it if its content is needed.]" + )) +} + +#[cfg(test)] +mod tests { + use super::header; + #[test] + fn bounded_base64_matches_observed_node_utf16_rules() { + assert_eq!(header("ŁAAA"), [0, 0, 0]); + assert!(header("ĽAAAA").is_empty()); + assert_eq!(header("🌏AAAA"), [0, 0, 0]); + assert!(header(&format!("{}AAAA", "!".repeat(87384))).is_empty()); + } +} diff --git a/native/omk-providers/src/request_policy.rs b/native/omk-providers/src/request_policy.rs new file mode 100644 index 0000000000..c03083d66b --- /dev/null +++ b/native/omk-providers/src/request_policy.rs @@ -0,0 +1,225 @@ +//! Explicit Anthropic options; no ambient cache preference or simple-option inference. +use serde::{Deserialize, Serialize}; +use serde_json::{Number, Value}; + +#[derive(Default, Deserialize)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct Options { + #[serde(default)] + cache_retention: crate::request_cache::Retention, + temperature: Option, + thinking_enabled: Option, + thinking_budget_tokens: Option, + thinking_display: Option, + effort: Option, + metadata: Option, + tool_choice: Option, +} +#[derive(Clone, Copy, Default, Deserialize, Serialize)] +#[serde(rename_all = "lowercase")] +pub(crate) enum ThinkingDisplay { + #[default] + Summarized, + Omitted, +} +#[derive(Clone, Copy, Deserialize, Serialize)] +#[serde(rename_all = "lowercase")] +enum Effort { + Low, + Medium, + High, + Xhigh, + Max, +} +#[derive(Deserialize)] +#[serde(untagged)] +enum Choice { + Mode(Mode), + Tool(NamedTool), +} +#[derive(Clone, Copy, Deserialize)] +#[serde(rename_all = "lowercase")] +enum Mode { + Auto, + Any, + None, +} +#[derive(Deserialize)] +#[serde(deny_unknown_fields)] +struct NamedTool { + r#type: ToolTag, + name: String, +} +#[derive(Clone, Copy, Deserialize)] +#[serde(rename_all = "lowercase")] +enum ToolTag { + Tool, +} +#[derive(Serialize)] +#[serde(tag = "type", rename_all = "lowercase")] +pub(crate) enum Thinking { + Adaptive { + display: ThinkingDisplay, + }, + Enabled { + budget_tokens: u32, + display: ThinkingDisplay, + }, + Disabled, +} +#[derive(Serialize)] +pub(crate) struct OutputConfig { + effort: Effort, +} +#[derive(Serialize)] +pub(crate) struct Metadata<'a> { + user_id: &'a str, +} +#[derive(Serialize)] +#[serde(tag = "type", rename_all = "lowercase")] +pub(crate) enum ToolChoice<'a> { + Auto, + Any, + None, + Tool { name: &'a str }, +} +#[derive(Default)] +pub(crate) struct Policy<'a> { + pub allow_empty_signature: bool, + pub cache: Option, + pub cache_tools: bool, + pub temperature: Option, + pub thinking: Option, + pub output_config: Option, + pub metadata: Option>, + pub tool_choice: Option>, +} +impl<'a> Policy<'a> { + pub fn new(model: &Value, options: Option<&'a Options>) -> Result { + let mut p = Self { + allow_empty_signature: model["compat"]["allowEmptySignature"] == true, + ..Self::default() + }; + let Some(o) = options else { + return Ok(p); + }; + p.cache = crate::request_cache::control(model, o.cache_retention); + p.cache_tools = model["compat"]["supportsCacheControlOnTools"] + .as_bool() + .unwrap_or(model["provider"] != "fireworks"); + if let Some(n) = &o.temperature { + let n = n + .as_f64() + .filter(|n| (0.0..=1.0).contains(n)) + .ok_or("invalid temperature")?; + if o.thinking_enabled != Some(true) && model["compat"]["supportsTemperature"] != false { + p.temperature = Some(if n == 0.0 || n == 1.0 { + Number::from(n as u8) + } else { + Number::from_f64(n).unwrap() + }); + } + } + if model["reasoning"] == true { + if o.thinking_enabled == Some(true) { + let display = o.thinking_display.unwrap_or_default(); + if model["compat"]["forceAdaptiveThinking"] == true { + p.thinking = Some(Thinking::Adaptive { display }); + p.output_config = o.effort.map(|effort| OutputConfig { effort }); + } else { + p.thinking = Some(Thinking::Enabled { + budget_tokens: o.thinking_budget_tokens.filter(|n| *n != 0).unwrap_or(1024), + display, + }); + } + } else if o.thinking_enabled == Some(false) + && model["compat"]["supportsDisabledThinking"] + .as_bool() + .unwrap_or_else(|| !always_thinks(model["id"].as_str().unwrap_or_default())) + { + p.thinking = Some(Thinking::Disabled); + } + } + p.metadata = o + .metadata + .as_ref() + .and_then(|m| m["user_id"].as_str()) + .map(|user_id| Metadata { user_id }); + p.tool_choice = match &o.tool_choice { + Some(Choice::Mode(Mode::Auto)) => Some(ToolChoice::Auto), + Some(Choice::Mode(Mode::Any)) => Some(ToolChoice::Any), + Some(Choice::Mode(Mode::None)) => Some(ToolChoice::None), + Some(Choice::Tool(tool)) => { + if tool.name.is_empty() || tool.name.len() > 256 { + return Err("invalid tool choice".into()); + } + let ToolTag::Tool = tool.r#type; + Some(ToolChoice::Tool { name: &tool.name }) + } + None => None, + }; + Ok(p) + } +} +fn always_thinks(id: &str) -> bool { + std::iter::once(id) + .chain(id.match_indices(['/', '.']).map(|(i, _)| &id[i + 1..])) + .any(|part| { + part.starts_with("claude-fable-") + || ["claude-opus-5.5", "claude-opus-5-5"].iter().any(|prefix| { + part.strip_prefix(prefix).is_some_and(|tail| { + tail.as_bytes().first().is_none_or(|b| !b.is_ascii_digit()) + }) + }) + }) +} + +#[cfg(test)] +mod tests { + use super::*; + use serde_json::json; + #[test] + fn disabled_thinking_defaults_match_observed_node_model_names_and_override() { + let options: Options = serde_json::from_value(json!({"thinkingEnabled":false})).unwrap(); + for (id, disabled) in [ + ("claude-fable-5", false), + ("proxy/claude-fable-5", false), + ("proxy.claude-fable-5", false), + ("claude-opus-5.5", false), + ("claude-opus-5-5-beta", false), + ("claude-opus-5-50", true), + ("xclaude-fable-5", true), + ("claude-sonnet-5-5", true), + ] { + let mut model = json!({"id":id,"reasoning":true}); + assert_eq!( + Policy::new(&model, Some(&options)) + .unwrap() + .thinking + .is_some(), + disabled, + "{id}" + ); + model["compat"] = json!({"supportsDisabledThinking":!disabled}); + assert_eq!( + Policy::new(&model, Some(&options)) + .unwrap() + .thinking + .is_some(), + !disabled + ); + } + } + #[test] + fn numeric_temperature_spelling_is_canonical_and_ignored_metadata_is_not_emitted() { + for (raw, expected) in [("-0.0", "0"), ("0.0", "0"), ("1.0", "1"), ("1e-1", "0.1")] { + let options: Options = serde_json::from_str(&format!( + "{{\"temperature\":{raw},\"metadata\":{{\"user_id\":123}}}}" + )) + .unwrap(); + let p = Policy::new(&json!({}), Some(&options)).unwrap(); + assert_eq!(p.temperature.unwrap().to_string(), expected); + assert!(p.metadata.is_none()); + } + } +} diff --git a/native/omk-providers/src/tool_schema.rs b/native/omk-providers/src/tool_schema.rs new file mode 100644 index 0000000000..4134280b49 --- /dev/null +++ b/native/omk-providers/src/tool_schema.rs @@ -0,0 +1,158 @@ +//! Port of OMK's packages/ai/src/providers/tool-schema.ts stableTools (MIT; root LICENSE/NOTICE). +use crate::request::Tool; +use serde_json::value::RawValue; +use std::{cmp::Ordering, collections::BTreeMap}; + +/// ICU root primary order of the Anthropic tool-name alphabet; lowercase sorts first on ties. +const PRIMARY: &[u8] = b"_-0123456789abcdefghijklmnopqrstuvwxyz"; + +fn collation_key(name: &str) -> Result<(Vec, Vec), String> { + name.bytes() + .map(|b| { + let weight = PRIMARY.iter().position(|p| *p == b.to_ascii_lowercase()); + weight.map(|w| (w, b.is_ascii_uppercase())) + }) + .collect::>>() + .map(|keys| keys.into_iter().unzip()) + .ok_or_else(|| "tool names outside [A-Za-z0-9_-] are not supported".to_string()) +} + +/// Node localeCompare order for root-equivalent default locales, with canonical schemas. +pub(crate) fn stable(tools: &[Tool]) -> Result)>, String> { + let mut keyed = tools + .iter() + .map(|tool| { + let schema = canonical_properties(&tool.properties)?; + Ok((collation_key(&tool.name)?, tool, schema)) + }) + .collect::, String>>()?; + keyed.sort_by(|a, b| a.0.cmp(&b.0)); + if keyed.windows(2).any(|pair| pair[0].0 == pair[1].0) { + // Node would tie-break on description/schema; duplicate names are refused instead. + return Err("duplicate tool names are not supported".into()); + } + Ok(keyed + .into_iter() + .map(|(_, tool, schema)| (tool, schema)) + .collect()) +} + +fn canonical_properties(raw: &RawValue) -> Result, String> { + let mut out = String::new(); + if raw.get().trim_start().starts_with('{') { + write(raw, &mut out, key_order)?; + } else { + out.push_str("{}"); + } + RawValue::from_string(out).map_err(|e| e.to_string()) +} + +pub(crate) fn array_index(key: &str) -> Option { + let canonical = + key == "0" || (!key.starts_with('0') && key.bytes().all(|b| b.is_ascii_digit())); + key.parse::() + .ok() + .filter(|n| canonical && *n != u32::MAX) +} + +/// JSON.parse(canonicalJsonStringify(...)) order: array indexes ascending, then UTF-16 order. +fn key_order(a: &str, b: &str) -> Ordering { + match (array_index(a), array_index(b)) { + (Some(x), Some(y)) => x.cmp(&y), + (Some(_), None) => Ordering::Less, + (None, Some(_)) => Ordering::Greater, + (None, None) => a.encode_utf16().cmp(b.encode_utf16()), + } +} + +/// canonicalJsonStringify alone: object keys sorted by UTF-16 code units, no index-first rule. +pub(crate) fn canonical_json(raw: &RawValue) -> Result { + let mut out = String::new(); + write(raw, &mut out, |a, b| a.encode_utf16().cmp(b.encode_utf16()))?; + Ok(out) +} + +fn write( + raw: &RawValue, + out: &mut String, + order: fn(&str, &str) -> Ordering, +) -> Result<(), String> { + let text = raw.get().trim(); + let json = |e: serde_json::Error| e.to_string(); + match text.as_bytes().first() { + Some(b'{') => { + // BTreeMap insertion keeps JSON.parse's last duplicate; nullish `required` is dropped. + let map: BTreeMap = serde_json::from_str(text).map_err(json)?; + let mut entries: Vec<_> = map + .iter() + .filter(|(key, value)| !(*key == "required" && value.get() == "null")) + .collect(); + entries.sort_by(|a, b| order(a.0, b.0)); + out.push('{'); + for (index, (key, value)) in entries.into_iter().enumerate() { + if index > 0 { + out.push(','); + } + out.push_str(&serde_json::to_string(key).map_err(json)?); + out.push(':'); + write(value, out, order)?; + } + out.push('}'); + } + Some(b'[') => { + let items: Vec<&RawValue> = serde_json::from_str(text).map_err(json)?; + out.push('['); + for (index, item) in items.into_iter().enumerate() { + if index > 0 { + out.push(','); + } + write(item, out, order)?; + } + out.push(']'); + } + Some(b'"') => { + let value: String = serde_json::from_str(text).map_err(json)?; + out.push_str(&serde_json::to_string(&value).map_err(json)?); + } + Some(b't' | b'f' | b'n') => out.push_str(text), + _ => out.push_str(&js_number(text)?), + } + Ok(()) +} + +/// ECMAScript Number::toString(10) after JSON.parse, from Rust's shortest round-trip digits. +pub(crate) fn js_number(text: &str) -> Result { + let value: f64 = text + .parse() + .map_err(|_| "invalid JSON number".to_string())?; + if !value.is_finite() { + return Ok("null".into()); + } + if value == 0.0 { + return Ok("0".into()); + } + let scientific = format!("{:e}", value.abs()); + let (mantissa, exponent) = scientific + .split_once('e') + .ok_or_else(|| "invalid float formatting".to_string())?; + let digits = mantissa.replace('.', ""); + let k = digits.len() as i32; + let n = exponent.parse::().map_err(|e| e.to_string())? + 1; + let body = if k <= n && n <= 21 { + format!("{digits}{}", "0".repeat((n - k) as usize)) + } else if 0 < n && n <= 21 { + format!("{}.{}", &digits[..n as usize], &digits[n as usize..]) + } else if -6 < n && n <= 0 { + format!("0.{}{digits}", "0".repeat((-n) as usize)) + } else { + let (head, tail) = digits.split_at(1); + let dot = if tail.is_empty() { "" } else { "." }; + let sign = if n > 0 { "+" } else { "-" }; + format!("{head}{dot}{tail}e{sign}{}", (n - 1).abs()) + }; + Ok(if value < 0.0 { + format!("-{body}") + } else { + body + }) +} diff --git a/native/omk-providers/src/transport.rs b/native/omk-providers/src/transport.rs index 3bf3a5c2fd..94c03d8610 100644 --- a/native/omk-providers/src/transport.rs +++ b/native/omk-providers/src/transport.rs @@ -1,7 +1,8 @@ +pub use crate::transport_send::{Cancellation, Error, Limits, Response, Transport}; use std::{sync::OnceLock, time::Duration}; -/// Build-only transport probe. No credentials, request dispatch or live provider wiring. -/// Defaults here are deliberately offline-test policy, not claimed Node transport parity. +/// Explicit client policy: no implicit redirects, retries or inherited proxies. +/// The 30-second ceiling and native trust roots are not claimed Node transport parity. pub fn build_client() -> Result { static CRYPTO: OnceLock> = OnceLock::new(); CRYPTO diff --git a/native/omk-providers/src/transport_send.rs b/native/omk-providers/src/transport_send.rs new file mode 100644 index 0000000000..fdaefff5a7 --- /dev/null +++ b/native/omk-providers/src/transport_send.rs @@ -0,0 +1,177 @@ +use reqwest::{Client, Url, header::HeaderMap}; +use std::{ + fmt, + future::{Future, poll_fn}, + task::Poll, +}; +use tokio::{ + sync::watch, + time::{Instant, timeout_at}, +}; + +/// Irreversible cancellation shared by a request owner and its caller. +#[derive(Clone)] +pub struct Cancellation(watch::Sender); +impl Default for Cancellation { + fn default() -> Self { + Self(watch::channel(false).0) + } +} +impl Cancellation { + pub fn cancel(&self) { + self.0.send_replace(true); + } + async fn cancelled(&self) { + let mut receiver = self.0.subscribe(); + while !*receiver.borrow_and_update() { + if receiver.changed().await.is_err() { + break; + } + } + } +} + +#[derive(Debug, PartialEq, Eq)] +pub enum Error { + InvalidRequest, + Cancelled, + Deadline, + Network, + ResponseTooLarge, + Sink, +} +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str(match self { + Self::InvalidRequest => "invalid HTTP request", + Self::Cancelled => "HTTP request cancelled", + Self::Deadline => "HTTP request deadline exceeded", + Self::Network => "HTTP connection or body failed", + Self::ResponseTooLarge => "HTTP response byte limit exceeded", + Self::Sink => "HTTP response consumer failed", + }) + } +} +impl std::error::Error for Error {} + +pub struct Limits { + pub deadline: Instant, + pub max_response_bytes: usize, +} +#[derive(Debug)] +pub struct Response { + pub status: u16, + pub headers: HeaderMap, +} + +/// Explicit single-attempt transport. It neither resolves auth nor owns provider retry policy. +pub struct Transport(Client); +impl Transport { + pub fn new() -> Result { + super::transport::build_client().map(Self) + } + + /// Streams bytes synchronously to the consumer without collecting the response. + /// Dropping this future cancels local I/O, not server-side work already accepted. + pub async fn post( + &self, + endpoint: &str, + headers: HeaderMap, + body: Vec, + limits: Limits, + cancellation: &Cancellation, + mut on_chunk: impl FnMut(&Response, &[u8]) -> Result<(), ()>, + ) -> Result { + if *cancellation.0.borrow() { + return Err(Error::Cancelled); + } + if Instant::now() >= limits.deadline { + return Err(Error::Deadline); + } + let url = Url::parse(endpoint).map_err(|_| Error::InvalidRequest)?; + let loopback = url + .host_str() + .and_then(|host| { + host.trim_matches(['[', ']']) + .parse::() + .ok() + }) + .is_some_and(|ip| ip.is_loopback()); + if !(url.scheme() == "https" || url.scheme() == "http" && loopback) + || !url.username().is_empty() + || url.password().is_some() + || url.fragment().is_some() + || body.len() > 8 * 1024 * 1024 + || limits.max_response_bytes > 8 * 1024 * 1024 + || headers.contains_key(reqwest::header::CONTENT_LENGTH) + || headers.contains_key(reqwest::header::TRANSFER_ENCODING) + { + return Err(Error::InvalidRequest); + } + let request = self + .0 + .post(url) + .headers(headers) + .body(body) + .build() + .map_err(|_| Error::InvalidRequest)?; + let operation = async { + let mut response = self.0.execute(request).await.map_err(|e| { + if e.is_timeout() { + Error::Deadline + } else { + Error::Network + } + })?; + let metadata = Response { + status: response.status().as_u16(), + headers: response.headers().clone(), + }; + if response + .content_length() + .is_some_and(|n| n > limits.max_response_bytes as u64) + { + return Err(Error::ResponseTooLarge); + } + let mut total = 0usize; + while let Some(chunk) = response.chunk().await.map_err(|e| { + if e.is_timeout() { + Error::Deadline + } else { + Error::Network + } + })? { + if *cancellation.0.borrow() { + return Err(Error::Cancelled); + } + if Instant::now() >= limits.deadline { + return Err(Error::Deadline); + } + total = total + .checked_add(chunk.len()) + .filter(|n| *n <= limits.max_response_bytes) + .ok_or(Error::ResponseTooLarge)?; + on_chunk(&metadata, &chunk).map_err(|_| Error::Sink)?; + } + if *cancellation.0.borrow() { + return Err(Error::Cancelled); + } + if Instant::now() >= limits.deadline { + return Err(Error::Deadline); + } + Ok(metadata) + }; + let mut operation = std::pin::pin!(timeout_at(limits.deadline, operation)); + let mut cancelled = std::pin::pin!(cancellation.cancelled()); + poll_fn(|cx| { + if cancelled.as_mut().poll(cx).is_ready() { + return Poll::Ready(Err(Error::Cancelled)); + } + operation + .as_mut() + .poll(cx) + .map(|outcome| outcome.unwrap_or(Err(Error::Deadline))) + }) + .await + } +} diff --git a/native/omk-providers/tests/anthropic_content.rs b/native/omk-providers/tests/anthropic_content.rs new file mode 100644 index 0000000000..76c7da27e4 --- /dev/null +++ b/native/omk-providers/tests/anthropic_content.rs @@ -0,0 +1,115 @@ +use omk_providers::anthropic::{Input, build_request}; +use serde::Deserialize; +use serde_json::{Value, json, value::RawValue}; +use std::{ + io::Write, + process::{Command, Output, Stdio}, +}; + +#[derive(Deserialize)] +struct Case { + id: String, + input: Box, + request: Value, +} +#[derive(Deserialize)] +struct Corpus { + cases: Vec, +} +fn corpus() -> Corpus { + serde_json::from_str(include_str!("fixtures/anthropic-content.json")).unwrap() +} +fn cli(input: &str) -> Output { + let mut child = Command::new(env!("CARGO_BIN_EXE_replay-anthropic")) + .env_clear() + .stdin(Stdio::piped()) + .stdout(Stdio::piped()) + .stderr(Stdio::piped()) + .spawn() + .unwrap(); + child + .stdin + .take() + .unwrap() + .write_all(format!(r#"{{"input":{input},"chunks":[],"abort":false}}"#).as_bytes()) + .unwrap(); + child.wait_with_output().unwrap() +} +#[test] +fn content_request_bytes_match_independent_node_recording() { + let corpus = corpus(); + assert_eq!(corpus.cases.len(), 26); + for case in corpus.cases { + let input: Input = serde_json::from_str(case.input.get()) + .unwrap_or_else(|error| panic!("{}: {error}", case.id)); + assert_eq!( + build_request(&input).unwrap(), + case.request, + "{} library", + case.id + ); + let output = cli(case.input.get()); + assert!( + output.status.success(), + "{}: {}", + case.id, + String::from_utf8_lossy(&output.stderr) + ); + let actual: Value = serde_json::from_slice(&output.stdout).unwrap(); + assert_eq!(actual["request"], case.request, "{} executable", case.id); + } +} +#[test] +fn unsupported_content_is_refused_without_partial_stdout() { + for history in [ + json!([{"role":"user","text":"ambiguous","content":[]}]), + json!([{"role":"user","content":[],"stopReason":"stop"}]), + json!([{"role":"user","content":[{"type":"image","data":"x"}]}]), + json!([{"role":"user","content":[{"type":"image","data":1,"mimeType":"image/png"}]}]), + json!([{"role":"user","content":[{"type":"image","data":"x","mimeType":"image/png","url":"https://synthetic.invalid"}]}]), + json!([{"role":"user","content":[{"type":"text","text":"x","data":"ambiguous"}]}]), + json!([{"role":"user","content":[{"type":"audio","data":"x"}]}]), + json!([{"role":"user","content":null}]), + json!([{"role":"toolResult","toolCallId":"orphan","content":[{"type":"image","data":"x"}],"isError":false}]), + ] { + let mut input: Value = serde_json::from_str(corpus().cases[0].input.get()).unwrap(); + input["history"] = history; + let serialized = input.to_string(); + assert!( + serde_json::from_str::(&serialized) + .and_then(|input| build_request(&input).map_err(serde::de::Error::custom)) + .is_err() + ); + let output = cli(&serialized); + assert!(!output.status.success(), "accepted {serialized}"); + assert!(output.stdout.is_empty()); + assert!(String::from_utf8_lossy(&output.stderr).contains("replay refused:")); + } +} +#[test] +fn content_block_limit_counts_images_before_deduplication() { + for role in ["user", "toolResult"] { + for block in [ + json!({"type":"text","text":""}), + json!({"type":"image","data":"x","mimeType":"image/png"}), + ] { + let mut input: Value = serde_json::from_str(corpus().cases[0].input.get()).unwrap(); + let mut message = json!({"role":role,"content":vec![block.clone();4096]}); + if role == "toolResult" { + message["toolCallId"] = json!("orphan"); + message["isError"] = json!(false); + } + input["history"] = json!([message.clone()]); + let valid: Input = serde_json::from_str(&input.to_string()).unwrap(); + assert!(build_request(&valid).is_ok()); + message["content"].as_array_mut().unwrap().push(block); + input["history"] = json!([message]); + let serialized = input.to_string(); + let invalid: Input = serde_json::from_str(&serialized).unwrap(); + assert!(build_request(&invalid).is_err()); + let output = cli(&serialized); + assert!(!output.status.success()); + assert!(output.stdout.is_empty()); + } + } +} diff --git a/native/omk-providers/tests/anthropic_history.rs b/native/omk-providers/tests/anthropic_history.rs index 58b36efcd7..c2b331b891 100644 --- a/native/omk-providers/tests/anthropic_history.rs +++ b/native/omk-providers/tests/anthropic_history.rs @@ -65,7 +65,7 @@ fn unsupported_history_roles_and_extra_fields_fail_closed() { for history in [ json!([{"role":"toolResult","text":"not a supported text message"}]), json!([{"role":"assistant","text":"reply","thinkingSignature":"not supported"}]), - json!([{"role":"user","content":[]}]), + json!([{"role":"user","content":[{"type":"toolCall","id":"call_1","name":"read","arguments":{}}]}]), ] { let mut input = corpus()["cases"][0]["input"].clone(); input["history"] = history; diff --git a/native/omk-providers/tests/anthropic_stream.rs b/native/omk-providers/tests/anthropic_stream.rs new file mode 100644 index 0000000000..367d137791 --- /dev/null +++ b/native/omk-providers/tests/anthropic_stream.rs @@ -0,0 +1,160 @@ +use omk_providers::anthropic::Stream; +use serde_json::Value; + +fn corpus() -> Value { + serde_json::from_str(include_str!("fixtures/anthropic.json")).unwrap() +} + +#[test] +fn incremental_chunks_match_all_independent_node_terminal_recordings() { + let corpus = corpus(); + let cases = corpus["cases"].as_array().unwrap(); + assert_eq!(cases.len(), 16); + for case in cases { + let aborted = case["abort"] == true || case["abortAfterChunks"].is_number(); + let mut stream = Stream::new(case["input"]["model"].as_str().unwrap()).unwrap(); + let mut events = stream.take_events(); + if case["abort"] != true { + let limit = case["abortAfterChunks"] + .as_u64() + .map(|n| n as usize) + .unwrap_or(usize::MAX); + for chunk in case["chunks"].as_array().unwrap().iter().take(limit) { + let bytes: Vec = serde_json::from_value(chunk.clone()).unwrap(); + let outcome = stream.feed(&bytes); + events.extend(stream.take_events()); + if outcome.is_err() { + break; + } + } + } + let terminal = stream.finish(None, aborted); + events.extend(terminal.events.as_array().unwrap().iter().cloned()); + assert_eq!( + serde_json::json!(events), + case["events"], + "{} events", + case["id"] + ); + assert_eq!(terminal.result, case["result"], "{} result", case["id"]); + } +} + +#[test] +fn complete_frames_are_delivered_before_eof_and_not_delivered_twice() { + let corpus = corpus(); + let case = &corpus["cases"][0]; + assert_eq!(case["id"], "unicode"); + let mut stream = Stream::new("synthetic-anthropic").unwrap(); + assert_eq!(stream.take_events(), [serde_json::json!({"type":"start"})]); + assert!(stream.take_events().is_empty()); + let bytes: Vec = serde_json::from_value(case["chunks"][0].clone()).unwrap(); + stream.feed(&bytes).unwrap(); + let events = stream.take_events(); + assert!(events.iter().any(|event| event["type"] == "text_delta")); + assert!(events.iter().all(|event| event["type"] != "done")); + assert!(stream.take_events().is_empty()); + let terminal = stream.finish(None, false); + assert_eq!( + terminal.events, + serde_json::json!([{"type":"done","reason":"stop"}]) + ); + assert_eq!(terminal.result, case["result"]); +} + +#[test] +fn parser_failure_latches_and_preserves_prior_events_and_one_terminal() { + let mut stream = Stream::new("synthetic-anthropic").unwrap(); + let first = stream + .feed(b"event: message_start\ndata: malformed\n\n") + .unwrap_err(); + assert_eq!(stream.feed(b""), Err(first.clone())); + assert_eq!(stream.take_events(), [serde_json::json!({"type":"start"})]); + let terminal = stream.finish(Some("HTTP consumer failed".into()), false); + assert_eq!( + terminal.events, + serde_json::json!([{"type":"error","reason":"error"}]) + ); + assert_eq!(terminal.result["errorMessage"], first); +} + +#[test] +fn total_byte_bound_and_unrecorded_model_fail_closed() { + assert!(Stream::new("unrecorded").is_err()); + assert!(Stream::new("synthetic-anthropic-vision").is_err()); + let mut stream = Stream::new("synthetic-anthropic").unwrap(); + // Valid ignored frames keep decoder storage small while crossing the total bound. + let chunk = b"event: ping\ndata: {}\n\n".repeat(4096); + for _ in 0..(8 * 1024 * 1024 / chunk.len()) { + stream.feed(&chunk).unwrap(); + } + assert_eq!(stream.feed(&chunk).unwrap_err(), "stream exceeds 8 MiB"); + let terminal = stream.finish(None, false); + assert_eq!(terminal.result["stopReason"], "error"); +} + +#[test] +fn transport_delivers_events_before_eof_and_cancels_after_partial_text() { + use omk_providers::transport::{Cancellation, Error, Limits, Transport}; + use reqwest::header::HeaderMap; + use std::{io::ErrorKind, time::Duration}; + use tokio::{ + io::{AsyncReadExt, AsyncWriteExt}, + net::TcpListener, + time::{Instant, timeout}, + }; + + tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap().block_on(async { + let corpus = corpus(); + for aborted in [false, true] { + let case = corpus["cases"].as_array().unwrap().iter().find(|case| case["id"] == "cancel-mid").unwrap(); + let chunks: Vec> = serde_json::from_value(case["chunks"].clone()).unwrap(); + let split = chunks[0].len(); + let wire: Vec = chunks.into_iter().flatten().collect(); + let listener = TcpListener::bind("127.0.0.1:0").await.unwrap(); + let endpoint = format!("http://{}/v1/messages", listener.local_addr().unwrap()); + let (sent, received) = tokio::sync::oneshot::channel(); + let server = tokio::spawn(async move { + let (mut socket, _) = listener.accept().await.unwrap(); + let mut request = Vec::new(); + loop { + let byte = socket.read_u8().await.unwrap(); + request.push(byte); + if request.ends_with(b"\r\n\r\n") { break; } + } + socket.write_all(format!("HTTP/1.1 200 OK\r\nContent-Length: {}\r\nConnection: close\r\n\r\n", wire.len()).as_bytes()).await.unwrap(); + socket.write_all(&wire[..split]).await.unwrap(); + received.await.unwrap(); + if aborted { + let mut byte = [0]; + let eof = timeout(Duration::from_secs(2), socket.read(&mut byte)).await.unwrap(); + assert!(matches!(eof, Ok(0)) || eof.is_err_and(|e| matches!(e.kind(), ErrorKind::ConnectionReset | ErrorKind::ConnectionAborted))); + } else { + socket.write_all(&wire[split..]).await.unwrap(); + } + }); + let cancellation = Cancellation::default(); + let mut sent = Some(sent); + let mut stream = Stream::new("synthetic-anthropic").unwrap(); + let mut events = stream.take_events(); + let outcome = Transport::new().unwrap().post(&endpoint, HeaderMap::new(), vec![], Limits { deadline: Instant::now() + Duration::from_secs(3), max_response_bytes: 8192 }, &cancellation, |response, chunk| { + assert_eq!(response.status, 200); + stream.feed(chunk).unwrap(); + let pending = stream.take_events(); + if pending.iter().any(|event| event["type"] == "text_delta") { + sent.take().unwrap().send(()).unwrap(); + if aborted { cancellation.cancel(); } + } + events.extend(pending); + Ok(()) + }).await; + if aborted { assert_eq!(outcome.unwrap_err(), Error::Cancelled); } else { assert!(outcome.is_ok()); } + let terminal = stream.finish(None, aborted); + events.extend(terminal.events.as_array().unwrap().iter().cloned()); + let expected = if aborted { case } else { &corpus["cases"][0] }; + assert_eq!(serde_json::json!(events), expected["events"]); + assert_eq!(terminal.result, expected["result"]); + server.await.unwrap(); + } + }); +} diff --git a/native/omk-providers/tests/anthropic_tool_history.rs b/native/omk-providers/tests/anthropic_tool_history.rs new file mode 100644 index 0000000000..a5cd378b6b --- /dev/null +++ b/native/omk-providers/tests/anthropic_tool_history.rs @@ -0,0 +1,104 @@ +use omk_providers::anthropic::{Input, build_request}; +use serde::Deserialize; +use serde_json::{Value, json, value::RawValue}; +use std::{ + io::Write, + process::{Command, Output, Stdio}, +}; + +#[derive(Deserialize)] +struct Case { + id: String, + input: Box, + request: Value, +} +#[derive(Deserialize)] +struct Corpus { + cases: Vec, +} +fn corpus() -> Corpus { + serde_json::from_str(include_str!("fixtures/anthropic-tool-history.json")).unwrap() +} +fn cli(input: &str) -> Output { + let mut child = Command::new(env!("CARGO_BIN_EXE_replay-anthropic")) + .env_clear() + .stdin(Stdio::piped()) + .stdout(Stdio::piped()) + .stderr(Stdio::piped()) + .spawn() + .unwrap(); + child + .stdin + .take() + .unwrap() + .write_all(format!(r#"{{"input":{input},"chunks":[],"abort":false}}"#).as_bytes()) + .unwrap(); + child.wait_with_output().unwrap() +} +#[test] +fn tool_history_request_bytes_match_independent_node_recording() { + let corpus = corpus(); + assert_eq!(corpus.cases.len(), 25); + for case in corpus.cases { + let input: Input = serde_json::from_str(case.input.get()) + .unwrap_or_else(|error| panic!("{}: {error}", case.id)); + assert_eq!( + build_request(&input).unwrap(), + case.request, + "{} library", + case.id + ); + let output = cli(case.input.get()); + assert!( + output.status.success(), + "{}: {}", + case.id, + String::from_utf8_lossy(&output.stderr) + ); + let actual: Value = serde_json::from_slice(&output.stdout).unwrap(); + assert_eq!(actual["request"], case.request, "{} executable", case.id); + } +} +#[test] +fn unsupported_tool_history_is_refused_without_partial_stdout() { + for history in [ + json!([{"role":"assistant","content":[{"type":"image","data":"unsupported"}]}]), + json!([{"role":"assistant","content":[],"provider":"other"}]), + json!([{"role":"assistant","content":[],"text":"ambiguous"}]), + json!([{"role":"assistant","content":[],"stopReason":"unknown"}]), + json!([{"role":"toolResult","toolCallId":"call_1","content":[],"isError":"false"}]), + json!([{"role":"toolResult","toolCallId":"call_1","content":[],"isError":false,"extra":1}]), + json!([{"role":"assistant","content":[{"type":"thinking","thinking":"","redacted":true}]}]), + ] { + let mut input: Value = serde_json::from_str(corpus().cases[0].input.get()).unwrap(); + input["history"] = history; + let serialized = input.to_string(); + assert!( + serde_json::from_str::(&serialized) + .and_then(|input| build_request(&input).map_err(serde::de::Error::custom)) + .is_err() + ); + let output = cli(&serialized); + assert!(!output.status.success(), "accepted {serialized}"); + assert!(output.stdout.is_empty()); + assert!(String::from_utf8_lossy(&output.stderr).contains("replay refused:")); + } +} +#[test] +fn tool_history_and_argument_limits_fail_closed() { + for history in [ + json!(vec![json!({"role":"user","text":""}); 4097]), + json!([{"role":"assistant","content":vec![json!({"type":"text","text":""}); 4097]}]), + json!([{"role":"assistant","content":[{"type":"toolCall","id":"a","name":"read","arguments":{"value":9007199254740992u64}}]}]), + json!([{"role":"assistant","content":[{"type":"toolCall","id":"a","name":"read","arguments":{"value":"x".repeat(1024*1024)}}]}]), + ] { + let mut input: Value = serde_json::from_str(corpus().cases[0].input.get()).unwrap(); + input["history"] = history; + let serialized = input.to_string(); + let input: Input = serde_json::from_str(&serialized).unwrap(); + assert!(build_request(&input).is_err()); + let output = cli(&serialized); + assert!(!output.status.success()); + assert!(output.stdout.is_empty()); + } +} diff --git a/native/omk-providers/tests/anthropic_vision.rs b/native/omk-providers/tests/anthropic_vision.rs new file mode 100644 index 0000000000..6ea85d1f05 --- /dev/null +++ b/native/omk-providers/tests/anthropic_vision.rs @@ -0,0 +1,90 @@ +use omk_providers::anthropic::{Input, build_request}; +use serde::Deserialize; +use serde_json::{Value, json, value::RawValue}; +use std::{ + io::Write, + process::{Command, Output, Stdio}, +}; + +#[derive(Deserialize)] +struct Case { + id: String, + input: Box, + request: Value, +} +#[derive(Deserialize)] +struct Corpus { + cases: Vec, +} +fn corpus() -> Corpus { + serde_json::from_str(include_str!("fixtures/anthropic-vision.json")).unwrap() +} +fn cli(input: &str) -> Output { + let mut child = Command::new(env!("CARGO_BIN_EXE_replay-anthropic")) + .env_clear() + .stdin(Stdio::piped()) + .stdout(Stdio::piped()) + .stderr(Stdio::piped()) + .spawn() + .unwrap(); + child + .stdin + .take() + .unwrap() + .write_all(format!(r#"{{"input":{input},"chunks":[],"abort":false}}"#).as_bytes()) + .unwrap(); + child.wait_with_output().unwrap() +} +#[test] +fn vision_request_bytes_match_independent_node_recording() { + let corpus = corpus(); + assert_eq!(corpus.cases.len(), 50); + for case in corpus.cases { + let input: Input = serde_json::from_str(case.input.get()).unwrap(); + let request = build_request(&input).unwrap_or_else(|error| panic!("{}: {error}", case.id)); + assert_eq!(request, case.request, "{} library", case.id); + let output = cli(case.input.get()); + assert!( + output.status.success(), + "{}: {}", + case.id, + String::from_utf8_lossy(&output.stderr) + ); + let actual: Value = serde_json::from_slice(&output.stdout).unwrap(); + assert_eq!(actual["request"], case.request, "{} executable", case.id); + } +} +#[test] +fn vision_rejects_unsupported_fields_and_original_block_overflow() { + let original: Value = serde_json::from_str(corpus().cases[0].input.get()).unwrap(); + let mut oversized = original.clone(); + oversized["history"] = json!([{"role":"toolResult","toolCallId":"orphan","content":vec![json!({"type":"image","data":"","mimeType":"image/png"});4097],"isError":false}]); + let mut wrong_model = original.clone(); + wrong_model["model"] = json!("synthetic-anthropic-vision2"); + let mut malformed = original.clone(); + malformed["history"][0]["content"][0]["url"] = json!("https://synthetic.invalid/image"); + for input in [oversized, wrong_model, malformed] { + let serialized = input.to_string(); + assert!( + serde_json::from_str::(&serialized) + .and_then(|input| build_request(&input).map_err(serde::de::Error::custom)) + .is_err() + ); + let output = cli(&serialized); + assert!(!output.status.success()); + assert!(output.stdout.is_empty()); + } + let mut boundary = original; + boundary["history"][0]["content"] = json!(vec![ + json!({"type":"image","data":"","mimeType":"image/png"}); + 4096 + ]); + assert!(build_request(&serde_json::from_str::(&boundary.to_string()).unwrap()).is_ok()); +} + +#[test] +fn vision_does_not_admit_unrecorded_response_or_cancellation_replay() { + use omk_providers::anthropic::replay; + assert!(replay("synthetic-anthropic-vision", &[vec![]], None).is_err()); + assert!(replay("synthetic-anthropic-vision", &[], Some(0)).is_err()); +} diff --git a/native/omk-providers/tests/auth.rs b/native/omk-providers/tests/auth.rs new file mode 100644 index 0000000000..7f3fdf6f27 --- /dev/null +++ b/native/omk-providers/tests/auth.rs @@ -0,0 +1,198 @@ +use omk_providers::auth::{Error, KeySources, Snapshot, resolve_config}; +use serde_json::{Value, json}; +use std::{ + io::Write, + process::{Command, Output, Stdio}, +}; + +fn cli(input: &str) -> Output { + let mut child = Command::new(env!("CARGO_BIN_EXE_replay-auth")) + .env_clear() + .env("SYN_KEY", "ambient-must-not-be-used") + .stdin(Stdio::piped()) + .stdout(Stdio::piped()) + .stderr(Stdio::piped()) + .spawn() + .unwrap(); + child + .stdin + .take() + .unwrap() + .write_all(input.as_bytes()) + .unwrap(); + child.wait_with_output().unwrap() +} +fn sources<'a>( + runtime: Option<&'a str>, + environment: Option<&'a str>, + fallback: Option<&'a str>, +) -> KeySources<'a> { + KeySources { + runtime, + environment, + fallback, + include_fallback: true, + } +} +#[test] +fn every_independent_node_case_matches_library_and_executable() { + let corpus: Value = serde_json::from_str(include_str!("fixtures/auth.json")).unwrap(); + let cases = corpus["cases"].as_array().unwrap(); + assert_eq!(cases.len(), 52); + let mut mismatches = Vec::new(); + for case in cases { + let input = &case["input"]; + let env = |name: &str| input["env"][name].as_str().map(String::from); + let result = if let Some(config) = input["config"].as_str() { + resolve_config(config, env) + } else { + let snapshot = Snapshot::from_json(if input["loadError"] == true { + Err(()) + } else { + Ok(input["store"].as_str()) + }); + let mut sources = sources( + input["runtime"].as_str(), + input["environment"].as_str(), + input["fallback"].as_str(), + ); + sources.include_fallback = input["includeFallback"].as_bool().unwrap_or(true); + snapshot.resolve("anthropic", sources, env) + }; + let actual = match result { + Ok(key) => json!({"key":key.as_ref().map(|key| key.expose()),"blocked":false}), + Err(Error::UnavailableStore) => json!({"key":null,"blocked":true}), + Err(error) => panic!("{}: {error}", case["id"]), + }; + if actual != case["expected"] { + mismatches.push(format!("{} library: {actual}", case["id"])); + } + let output = cli(&input.to_string()); + assert!( + output.status.success(), + "{}: {}", + case["id"], + String::from_utf8_lossy(&output.stderr) + ); + let actual: Value = serde_json::from_slice(&output.stdout).unwrap(); + if actual != case["expected"] { + mismatches.push(format!("{} executable: {actual}", case["id"])); + } + } + assert!( + mismatches.is_empty(), + "{} mismatches: {}", + mismatches.len(), + mismatches.join("\n") + ); +} +#[test] +fn secrets_are_redacted_and_host_only_policies_never_substitute_credentials() { + let key = resolve_config("sensitive-marker", |_| None) + .unwrap() + .unwrap(); + assert_eq!(format!("{key:?}"), "[REDACTED]"); + assert_eq!( + resolve_config("!echo sensitive-marker", |_| None).unwrap_err(), + Error::CommandRequiresHost + ); + for (text, expected) in [ + ( + r#"{"anthropic":{"type":"oauth","access":"sensitive-marker"}}"#, + Error::OAuthRequiresHost, + ), + ( + r#"{"anthropic":{"type":"api_key","key":123}}"#, + Error::InvalidCredential, + ), + ( + r#"{"anthropic":{"type":"unknown"}}"#, + Error::InvalidCredential, + ), + ] { + let error = Snapshot::from_json(Ok(Some(text))) + .resolve( + "anthropic", + sources(None, Some("faux-environment"), Some("faux-fallback")), + |_| None, + ) + .unwrap_err(); + assert_eq!(error, expected); + assert!(!format!("{error:?} {error}").contains("sensitive-marker")); + } + for input in [ + json!({"config":"!echo sensitive-marker"}), + json!({"config":"sensitive-marker","store":"{}"}), + json!({"unexpected":"sensitive-marker"}), + json!({"config":123,"runtime":"sensitive-marker"}), + ] { + let output = cli(&input.to_string()); + assert!(!output.status.success()); + assert!(output.stdout.is_empty()); + assert!(!String::from_utf8_lossy(&output.stderr).contains("sensitive-marker")); + } +} +#[test] +fn bounded_snapshots_and_templates_fail_closed_without_reading_ambient_environment() { + assert!(matches!( + resolve_config(&"x".repeat(65537), |_| None), + Err(Error::InvalidInput) + )); + for text in ["[]", "null", "123", "\"sensitive-marker\""] { + assert!(matches!( + Snapshot::from_json(Ok(Some(text))).resolve( + "anthropic", + sources(None, Some("faux-environment"), None), + |_| None + ), + Err(Error::UnavailableStore) + )); + } + let big = format!(r#"{{"padding":"{}"}}"#, "x".repeat(1024 * 1024)); + let store = Snapshot::from_json(Ok(Some(&big))); + assert!(matches!( + store.resolve( + "anthropic", + sources(None, Some("faux-environment"), None), + |_| None + ), + Err(Error::UnavailableStore) + )); + assert!(resolve_config("$SYN_KEY", |_| None).unwrap().is_none()); + let output = cli(r#"{"config":"$SYN_KEY"}"#); + assert!(output.status.success()); + assert_eq!( + serde_json::from_slice::(&output.stdout).unwrap(), + json!({"key":null,"blocked":false}) + ); +} +#[test] +fn exact_limits_and_expanded_output_are_bounded() { + let exact = "x".repeat(65536); + assert_eq!( + resolve_config(&exact, |_| None).unwrap().unwrap().expose(), + exact + ); + for config in ["${X}tail", "$X$X", "prefix$X"] { + assert!(matches!( + resolve_config(config, |_| Some(exact.clone())), + Err(Error::InvalidInput) + )); + } + let padding = "x".repeat(1024 * 1024 - r#"{"padding":""}"#.len()); + let store = format!(r#"{{"padding":"{padding}"}}"#); + assert_eq!(store.len(), 1024 * 1024); + assert!( + Snapshot::from_json(Ok(Some(&store))) + .resolve("anthropic", sources(None, None, None), |_| None) + .unwrap() + .is_none() + ); + let oversized = cli(&" ".repeat(2 * 1024 * 1024 + 1)); + assert!(!oversized.status.success()); + assert!(oversized.stdout.is_empty()); + assert_eq!( + String::from_utf8(oversized.stderr).unwrap(), + "auth replay refused: input exceeds 2 MiB\n" + ); +} diff --git a/native/omk-providers/tests/boundaries.rs b/native/omk-providers/tests/boundaries.rs index ad407bb8e3..14fa873400 100644 --- a/native/omk-providers/tests/boundaries.rs +++ b/native/omk-providers/tests/boundaries.rs @@ -25,7 +25,7 @@ fn invalid_usage_is_an_error_not_a_panic_or_success() { } #[test] -fn request_rejects_unknown_input_and_preserves_schema_order_and_string_spaces() { +fn request_rejects_unknown_input_and_canonicalizes_schema_order_like_node() { let mut input = json!({"model":"synthetic-anthropic","maxTokens":1,"system":"","user":"hello", "tools":[]}); input["apiKey"] = json!("synthetic-unused"); @@ -37,7 +37,8 @@ fn request_rejects_unknown_input_and_preserves_schema_order_and_string_spaces() }"#).unwrap(); let request = build_request(&input).unwrap(); let body = request["body"].as_str().unwrap(); - assert!(body.find("\"z\"").unwrap() < body.find("\"a\"").unwrap()); + // Node stableToolSchema sorts keys; the old order-preservation expectation was not Node parity. + assert!(body.find("\"a\"").unwrap() < body.find("\"z\"").unwrap()); let parsed: Value = serde_json::from_str(body).unwrap(); assert_eq!( parsed["tools"][0]["input_schema"]["properties"]["z"]["description"], diff --git a/native/omk-providers/tests/catalog.rs b/native/omk-providers/tests/catalog.rs new file mode 100644 index 0000000000..6d1a97c069 --- /dev/null +++ b/native/omk-providers/tests/catalog.rs @@ -0,0 +1,70 @@ +use omk_providers::catalog::Catalog; +use serde_json::{Value, json}; +use std::{ + io::Write, + process::{Command, Stdio}, +}; +#[test] +fn independent_node_catalog_matches_library_and_executable() { + let corpus: Value = serde_json::from_str(include_str!("fixtures/catalog.json")).unwrap(); + let providers = vec!["anthropic".into(), "synthetic".into()]; + let mut failures = Vec::new(); + for case in corpus["cases"].as_array().unwrap() { + let overlay = case["overlay"].as_str().unwrap(); + let actual = Catalog::load(Some(overlay)).view(&providers, &providers); + if actual != case["expected"] { + failures.push(format!("{} library", case["id"])); + } + let mut child = Command::new(env!("CARGO_BIN_EXE_provider")) + .arg("catalog") + .env_clear() + .stdin(Stdio::piped()) + .stdout(Stdio::piped()) + .stderr(Stdio::piped()) + .spawn() + .unwrap(); + child + .stdin + .take() + .unwrap() + .write_all( + json!({"overlay":overlay,"providers":providers,"authenticated":providers}) + .to_string() + .as_bytes(), + ) + .unwrap(); + let output = child.wait_with_output().unwrap(); + assert!(output.status.success()); + let cli: Value = serde_json::from_slice(&output.stdout).unwrap(); + if cli != case["expected"] { + failures.push(format!("{} executable", case["id"])); + } + } + assert!(failures.is_empty(), "Node oracle mismatches: {failures:?}"); +} + +#[test] +fn overlay_failures_preserve_builtins_and_explicit_visibility_fails_closed() { + let auth = vec!["anthropic".to_string()]; + for overlay in [ + "null", + "[]", + "{\"providers\":null}", + "{\"providers\":{\"anthropic\":{\"models\":[{\"id\":\"bad\",\"maxTokens\":0}]}}}", + ] { + let catalog = Catalog::load(Some(overlay)); + assert!(catalog.is_invalid()); + assert!(catalog.view(&auth, &auth)["total"].as_u64().unwrap() > 2000); + } + let hidden = Catalog::load(Some( + "{// comment\n\"providers\":{},\"visibility\":{\"providers\":false},}", + )); + assert!(hidden.is_invalid()); + assert_eq!(hidden.view(&auth, &auth)["available"], json!([])); + let huge = " ".repeat(1024 * 1024 + 1); + assert!(Catalog::load(Some(&huge)).is_invalid()); + let unicode = Catalog::load(Some( + r#"{"providers":{"anthropic":{"baseUrl":"https://synthetic.invalid/한글"}}}"#, + )); + assert!(!unicode.is_invalid()); +} diff --git a/native/omk-providers/tests/dispatch.rs b/native/omk-providers/tests/dispatch.rs new file mode 100644 index 0000000000..025922a969 --- /dev/null +++ b/native/omk-providers/tests/dispatch.rs @@ -0,0 +1,147 @@ +use omk_providers::{ + anthropic::Input, + auth::{KeySources, Snapshot}, + catalog::Catalog, + dispatch, + transport::{Cancellation, Limits, Transport}, +}; +use serde_json::{Value, json}; +use std::{collections::BTreeMap, time::Duration}; +use tokio::{ + io::{AsyncReadExt, AsyncWriteExt}, + net::TcpListener, + time::{Instant, timeout}, +}; +fn corpus() -> Value { + let mut recorded: Value = serde_json::from_str(include_str!("fixtures/dispatch.json")).unwrap(); + for extra in [ + include_str!("fixtures/anthropic-policy.json"), + include_str!("fixtures/anthropic-cache.json"), + include_str!("fixtures/anthropic-signature.json"), + include_str!("fixtures/anthropic-tool-schema.json"), + ] { + let extra: Value = serde_json::from_str(extra).unwrap(); + recorded["cases"] + .as_array_mut() + .unwrap() + .extend(extra["cases"].as_array().unwrap().iter().cloned()); + } + recorded +} +async fn server(listener: TcpListener, wire: String, expected: Value) { + let (mut socket, _) = timeout(Duration::from_secs(3), listener.accept()) + .await + .unwrap() + .unwrap(); + let mut raw = Vec::new(); + while !raw.ends_with(b"\r\n\r\n") { + raw.push(socket.read_u8().await.unwrap()); + assert!(raw.len() < 65536); + } + let headers = String::from_utf8(raw).unwrap(); + assert!(headers.starts_with("POST /v1/messages HTTP/1.1\r\n")); + let mut actual = BTreeMap::new(); + for line in headers.split("\r\n").skip(1).filter(|l| l.contains(':')) { + let (key, value) = line.split_once(':').unwrap(); + actual.insert(key.to_ascii_lowercase(), value.trim().to_string()); + } + let length: usize = actual["content-length"].parse().unwrap(); + let mut body = vec![0; length]; + socket.read_exact(&mut body).await.unwrap(); + assert_eq!( + String::from_utf8(body).unwrap(), + expected["body"].as_str().unwrap() + ); + for (k, v) in expected["headers"].as_object().unwrap() { + assert_eq!(actual.get(k).map(String::as_str), v.as_str(), "header {k}"); + } + assert_eq!( + actual.contains_key("authorization"), + expected["headers"].get("authorization").is_some() + ); + socket.write_all(format!("HTTP/1.1 200 OK\r\nContent-Type: text/event-stream\r\nContent-Length: {}\r\nConnection: close\r\n\r\n{}",wire.len(),wire).as_bytes()).await.unwrap(); +} +#[test] +fn independent_node_dispatch_matches_library_socket_request_and_response() { + tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + .unwrap() + .block_on(async { + for case in corpus()["cases"].as_array().unwrap() { + let listener = TcpListener::bind("127.0.0.1:0").await.unwrap(); + let base = format!("http://{}", listener.local_addr().unwrap()); + let overlay = case["overlay"] + .as_str() + .unwrap() + .replace("https://synthetic.invalid/v1/", &base) + .replace("https://synthetic.invalid", &base); + let catalog = Catalog::load(Some(&overlay)); + let input: Input = serde_json::from_value(case["input"].clone()).unwrap(); + let snapshot = Snapshot::from_json(Ok(case["store"].as_str())); + let prepared = dispatch::prepare( + &catalog, + case["provider"].as_str().unwrap(), + &input, + &snapshot, + KeySources { + runtime: case["runtime"].as_str(), + environment: case["environment"].as_str(), + fallback: None, + include_fallback: true, + }, + |key| case["env"][key].as_str().map(str::to_string), + ) + .unwrap(); + let task = tokio::spawn(server( + listener, + case["wire"].as_str().unwrap().into(), + case["request"].clone(), + )); + let mut events = Vec::new(); + let result = prepared + .send( + &Transport::new().unwrap(), + Limits { + deadline: Instant::now() + Duration::from_secs(3), + max_response_bytes: 8192, + }, + &Cancellation::default(), + |event| events.push(event), + ) + .await + .unwrap(); + task.await.unwrap(); + assert_eq!(json!(events), case["events"], "{} events", case["id"]); + assert_eq!(result.result, case["result"], "{} result", case["id"]); + } + }); +} + +#[test] +fn executable_dispatch_matches_all_independent_node_cases() { + use std::{ + io::Write, + process::{Command, Stdio}, + }; + tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap().block_on(async { + for case in corpus()["cases"].as_array().unwrap() { + let listener=TcpListener::bind("127.0.0.1:0").await.unwrap(); + let base=format!("http://{}",listener.local_addr().unwrap()); + let overlay=case["overlay"].as_str().unwrap().replace("https://synthetic.invalid/v1/",&base).replace("https://synthetic.invalid",&base); + let task=tokio::spawn(server(listener,case["wire"].as_str().unwrap().into(),case["request"].clone())); + let input=json!({"overlay":overlay,"provider":case["provider"],"input":case["input"],"runtime":case["runtime"],"store":case["store"],"environment":case["environment"],"env":case.get("env").cloned().unwrap_or(json!({})),"timeoutMs":2000}); + let output=tokio::task::spawn_blocking(move || { + let mut child=Command::new(env!("CARGO_BIN_EXE_provider")).arg("stream").env_clear().env("ANTHROPIC_API_KEY","ambient-must-not-win").stdin(Stdio::piped()).stdout(Stdio::piped()).stderr(Stdio::piped()).spawn().unwrap(); + child.stdin.take().unwrap().write_all(input.to_string().as_bytes()).unwrap(); child.wait_with_output().unwrap() + }).await.unwrap(); + task.await.unwrap(); + assert!(output.status.success(),"{}: {}",case["id"],String::from_utf8_lossy(&output.stderr)); + assert!(output.stderr.is_empty()); + let lines:Vec=String::from_utf8(output.stdout).unwrap().lines().map(|line|serde_json::from_str(line).unwrap()).collect(); + let events:Vec<_>=lines.iter().filter_map(|v|v.get("event")).collect(); + assert_eq!(json!(events),case["events"]); + assert_eq!(lines.last().unwrap()["result"],case["result"]); + } + }); +} diff --git a/native/omk-providers/tests/dispatch_boundaries.rs b/native/omk-providers/tests/dispatch_boundaries.rs new file mode 100644 index 0000000000..178db6bfac --- /dev/null +++ b/native/omk-providers/tests/dispatch_boundaries.rs @@ -0,0 +1,193 @@ +use omk_providers::{ + anthropic::Input, + auth::{KeySources, Snapshot}, + catalog::Catalog, + dispatch, + transport::{Cancellation, Limits, Transport}, +}; +use serde_json::{Value, json}; +use std::time::Duration; +use tokio::{ + io::{AsyncReadExt, AsyncWriteExt}, + net::TcpListener, + time::{Instant, timeout}, +}; +fn corpus() -> Value { + serde_json::from_str(include_str!("fixtures/dispatch.json")).unwrap() +} +#[test] +fn credentials_headers_and_catalog_refusals_do_not_dispatch_or_disclose_secrets() { + let case = &corpus()["cases"][0]; + let input: Input = serde_json::from_value(case["input"].clone()).unwrap(); + let catalog = Catalog::load(case["overlay"].as_str()); + let sources = || KeySources { + runtime: None, + environment: Some("wrong-account"), + fallback: None, + include_fallback: false, + }; + assert!(matches!( + dispatch::prepare( + &catalog, + "anthropic", + &input, + &Snapshot::from_json(Ok(None)), + KeySources { + environment: None, + ..sources() + }, + |_| None + ), + Err(dispatch::Error::MissingCredential) + )); + assert!( + dispatch::prepare( + &catalog, + "anthropic", + &input, + &Snapshot::from_json(Ok(None)), + KeySources { + environment: None, + include_fallback: true, + ..sources() + }, + |_| None + ) + .is_ok() + ); + for store in [ + Err(()), + Ok(Some("{broken")), + Ok(Some(r#"{"anthropic":{"type":"api_key","key":"$MISSING"}}"#)), + Ok(Some( + r#"{"anthropic":{"type":"api_key","key":"!touch must-not-execute"}}"#, + )), + Ok(Some( + r#"{"anthropic":{"type":"oauth","access":"secret-marker"}}"#, + )), + ] { + let snapshot = Snapshot::from_json(store); + let error = + match dispatch::prepare(&catalog, "anthropic", &input, &snapshot, sources(), |_| { + None + }) { + Ok(_) => panic!("unsafe account substitution"), + Err(e) => e, + }; + assert!(!format!("{error:?} {error}").contains("secret-marker")); + } + for headers in [ + json!({"x-test":"secret-marker\r\nInjected: yes"}), + json!({"Host":"elsewhere.invalid"}), + json!({"Content-Length":"0"}), + json!({"x-test":"$MISSING"}), + ] { + let mut overlay: Value = serde_json::from_str(case["overlay"].as_str().unwrap()).unwrap(); + overlay["providers"]["anthropic"]["headers"] = headers; + let catalog = Catalog::load(Some(&overlay.to_string())); + assert!( + dispatch::prepare( + &catalog, + "anthropic", + &input, + &Snapshot::from_json(Ok(None)), + sources(), + |_| None + ) + .is_err() + ); + } + assert!( + dispatch::prepare( + &Catalog::load(Some("{")), + "anthropic", + &input, + &Snapshot::from_json(Ok(None)), + sources(), + |_| None + ) + .is_err() + ); + assert!( + dispatch::prepare( + &catalog, + "missing", + &input, + &Snapshot::from_json(Ok(None)), + sources(), + |_| None + ) + .is_err() + ); +} + +#[test] +fn http_failure_has_one_terminal_no_retry_and_no_echoed_secret() { + tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap().block_on(async { + for body in ["", "secret-marker: invalid key"] { + let listener=TcpListener::bind("127.0.0.1:0").await.unwrap(); + let endpoint=format!("http://{}",listener.local_addr().unwrap()); + let case=&corpus()["cases"][0]; + let overlay=case["overlay"].as_str().unwrap().replace("https://synthetic.invalid/v1/",&endpoint); + let prepared=dispatch::prepare(&Catalog::load(Some(&overlay)),"anthropic",&serde_json::from_value(case["input"].clone()).unwrap(),&Snapshot::from_json(Ok(None)),KeySources{runtime:Some("faux-key"),environment:None,fallback:None,include_fallback:false}, |_|None).unwrap(); + let body=body.to_string(); + let server=tokio::spawn(async move { + let (mut socket,_)=listener.accept().await.unwrap(); + let mut raw=Vec::new(); while !raw.ends_with(b"\r\n\r\n") { raw.push(socket.read_u8().await.unwrap()); } + let headers=String::from_utf8(raw).unwrap(); let len:usize=headers.lines().find_map(|s|s.strip_prefix("content-length: ")).unwrap().parse().unwrap(); + socket.read_exact(&mut vec![0;len]).await.unwrap(); + socket.write_all(format!("HTTP/1.1 401 Unauthorized\r\nContent-Length: {}\r\nConnection: close\r\n\r\n{}",body.len(),body).as_bytes()).await.unwrap(); + assert!(timeout(Duration::from_millis(50),listener.accept()).await.is_err()); + }); + let mut events=Vec::new(); + let result=prepared.send(&Transport::new().unwrap(),Limits{deadline:Instant::now()+Duration::from_secs(2),max_response_bytes:1024},&Cancellation::default(),|e|events.push(e)).await.unwrap(); + assert_eq!(json!(events),json!([{"type":"start"},{"type":"error","reason":"error"}])); + assert_eq!(result.result["stopReason"],"error"); + assert!(!result.result.to_string().contains("secret-marker")); server.await.unwrap(); + } + }); +} + +#[test] +fn executable_refuses_invalid_admission_before_events_and_does_not_echo_inputs() { + use std::{ + io::Write, + process::{Command, Stdio}, + }; + let case = &corpus()["cases"][0]; + let valid = json!({"overlay":case["overlay"],"provider":"anthropic","input":case["input"],"runtime":"secret-marker"}); + let mut inputs = Vec::new(); + for (key, value) in [ + ("timeoutMs", json!(0)), + ("timeoutMs", json!(30001)), + ("maxResponseBytes", json!(8388609)), + ("unexpected", json!("secret-marker")), + ] { + let mut input = valid.clone(); + input[key] = value; + inputs.push(input.to_string()); + } + inputs.push(" ".repeat(2 * 1024 * 1024 + 1)); + for input in inputs { + let mut child = Command::new(env!("CARGO_BIN_EXE_provider")) + .arg("stream") + .env_clear() + .stdin(Stdio::piped()) + .stdout(Stdio::piped()) + .stderr(Stdio::piped()) + .spawn() + .unwrap(); + child + .stdin + .take() + .unwrap() + .write_all(input.as_bytes()) + .unwrap(); + let output = child.wait_with_output().unwrap(); + assert!(!output.status.success()); + assert!(output.stdout.is_empty()); + let error = String::from_utf8(output.stderr).unwrap(); + assert!(error.starts_with("provider refused:")); + assert!(!error.contains("secret-marker")); + } +} diff --git a/native/omk-providers/tests/dispatch_stream.rs b/native/omk-providers/tests/dispatch_stream.rs new file mode 100644 index 0000000000..4aaa00791e --- /dev/null +++ b/native/omk-providers/tests/dispatch_stream.rs @@ -0,0 +1,112 @@ +use omk_providers::{ + auth::{KeySources, Snapshot}, + catalog::Catalog, + dispatch, + transport::{Cancellation, Limits, Transport}, +}; +use serde_json::{Value, json}; +use std::{ + io::{BufRead, BufReader, Read, Write}, + net::TcpListener, + process::{Command, Stdio}, + sync::mpsc, + time::Duration, +}; +#[test] +fn executable_flushes_text_delta_before_the_server_releases_eof() { + let corpus: Value = serde_json::from_str(include_str!("fixtures/dispatch.json")).unwrap(); + let case = &corpus["cases"][0]; + let streams: Value = serde_json::from_str(include_str!("fixtures/anthropic.json")).unwrap(); + let split = streams["cases"] + .as_array() + .unwrap() + .iter() + .find(|c| c["id"] == "cancel-mid") + .unwrap(); + let chunks: Vec> = serde_json::from_value(split["chunks"].clone()).unwrap(); + let prefix = chunks[0].len(); + let wire: Vec = chunks.into_iter().flatten().collect(); + let listener = TcpListener::bind("127.0.0.1:0").unwrap(); + let base = format!("http://{}", listener.local_addr().unwrap()); + let overlay = case["overlay"] + .as_str() + .unwrap() + .replace("https://synthetic.invalid/v1/", &base); + let (sent, received) = mpsc::channel(); + let server = std::thread::spawn(move || { + let (mut socket, _) = listener.accept().unwrap(); + socket + .set_read_timeout(Some(Duration::from_secs(3))) + .unwrap(); + let mut headers = Vec::new(); + let mut byte = [0]; + while !headers.ends_with(b"\r\n\r\n") { + socket.read_exact(&mut byte).unwrap(); + headers.push(byte[0]); + } + let len: usize = String::from_utf8(headers) + .unwrap() + .lines() + .find_map(|s| s.strip_prefix("content-length: ")) + .unwrap() + .parse() + .unwrap(); + socket.read_exact(&mut vec![0; len]).unwrap(); + write!(socket,"HTTP/1.1 200 OK\r\nContent-Type: text/event-stream\r\nContent-Length: {}\r\nConnection: close\r\n\r\n",wire.len()).unwrap(); + socket.write_all(&wire[..prefix]).unwrap(); + received + .recv_timeout(Duration::from_secs(3)) + .expect("CLI must flush text_delta before EOF"); + socket.write_all(&wire[prefix..]).unwrap(); + }); + let mut child = Command::new(env!("CARGO_BIN_EXE_provider")) + .arg("stream") + .env_clear() + .stdin(Stdio::piped()) + .stdout(Stdio::piped()) + .stderr(Stdio::piped()) + .spawn() + .unwrap(); + child.stdin.take().unwrap().write_all(json!({"overlay":overlay,"provider":"anthropic","input":case["input"],"runtime":"faux-key","timeoutMs":2000}).to_string().as_bytes()).unwrap(); + let mut sent = Some(sent); + let mut terminal = 0; + for line in BufReader::new(child.stdout.take().unwrap()).lines() { + let v: Value = serde_json::from_str(&line.unwrap()).unwrap(); + if v["event"]["type"] == "text_delta" + && let Some(sender) = sent.take() + { + sender.send(()).unwrap(); + } + if v["event"]["type"] == "done" || v["event"]["type"] == "error" { + terminal += 1; + } + } + assert!(child.wait().unwrap().success()); + assert_eq!(terminal, 1); + server.join().unwrap(); +} +#[test] +fn cancellation_after_partial_dispatch_retains_text_and_closes_the_socket() { + use tokio::{ + io::{AsyncReadExt, AsyncWriteExt}, + time::{Instant, timeout}, + }; + tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap().block_on(async { + let corpus:Value=serde_json::from_str(include_str!("fixtures/dispatch.json")).unwrap(); let case=&corpus["cases"][0]; + let streams:Value=serde_json::from_str(include_str!("fixtures/anthropic.json")).unwrap(); + let split=streams["cases"].as_array().unwrap().iter().find(|c|c["id"]=="cancel-mid").unwrap(); let chunks:Vec>=serde_json::from_value(split["chunks"].clone()).unwrap(); let prefix=chunks[0].clone(); + let listener=tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap(); let base=format!("http://{}",listener.local_addr().unwrap()); + let overlay=case["overlay"].as_str().unwrap().replace("https://synthetic.invalid/v1/",&base); + let server=tokio::spawn(async move { + let (mut socket,_)=listener.accept().await.unwrap(); let mut headers=Vec::new(); + while !headers.ends_with(b"\r\n\r\n") { headers.push(socket.read_u8().await.unwrap()); } + let len:usize=String::from_utf8(headers).unwrap().lines().find_map(|s|s.strip_prefix("content-length: ")).unwrap().parse().unwrap(); socket.read_exact(&mut vec![0;len]).await.unwrap(); + socket.write_all(b"HTTP/1.1 200 OK\r\nContent-Type: text/event-stream\r\nConnection: close\r\n\r\n").await.unwrap(); socket.write_all(&prefix).await.unwrap(); + let result=timeout(Duration::from_secs(2),socket.read(&mut [0])).await.unwrap(); assert!(matches!(result,Ok(0)) || result.is_err()); + }); + let prepared=dispatch::prepare(&Catalog::load(Some(&overlay)),"anthropic",&serde_json::from_value(case["input"].clone()).unwrap(),&Snapshot::from_json(Ok(None)),KeySources{runtime:Some("faux-key"),environment:None,fallback:None,include_fallback:false},|_|None).unwrap(); + let cancel=Cancellation::default(); let mut events=Vec::new(); + let result=prepared.send(&Transport::new().unwrap(),Limits{deadline:Instant::now()+Duration::from_secs(3),max_response_bytes:8192},&cancel,|e| { if e["type"]=="text_delta" { cancel.cancel(); } events.push(e); }).await.unwrap(); + assert_eq!(result.result["stopReason"],"aborted"); assert!(!result.result["content"].as_array().unwrap().is_empty()); assert_eq!(events.last().unwrap()["reason"],"aborted"); server.await.unwrap(); + }); +} diff --git a/native/omk-providers/tests/fixtures/anthropic-cache.json b/native/omk-providers/tests/fixtures/anthropic-cache.json new file mode 100644 index 0000000000..27ddcf13eb --- /dev/null +++ b/native/omk-providers/tests/fixtures/anthropic-cache.json @@ -0,0 +1,2632 @@ +{ + "schema": "omk.anthropic-cache.v1", + "source": { + "scripts/fixtures/anthropic-cache-recorder.ts": "b37fcb4b1eaa3926939db0cbaf5055106e42acf93f9f68fdb879e81291ceb589", + "scripts/fixtures/anthropic-provider-cases.ts": "c73097643a997be405d583bbdeb09e4fc7d9dc0bfa037f59f5965949c23d638f", + "packages/ai/src/providers/anthropic.ts": "38e1ca641ad118fb0f66e927979a0533f19ea3f64e37b1778888b1093aa90a46", + "packages/ai/src/providers/anthropic-compat.ts": "a636a7caec627915d187137228a0151e77b9242bcf0c0add996cf9bed984b017", + "packages/ai/src/providers/prompt-cache.ts": "d91900005c5a146e33b3276d02100a0da3dfe57f718301fc77c12cad23e8329d", + "packages/ai/src/providers/tool-schema.ts": "523a0642c2c62b48d84efd9c81e4a58e83f39a217dbcc5512ff3983bdedd9edb", + "packages/ai/src/providers/transform-messages.ts": "f60d2e3c7db909eb9d80d6b670bf0d7fed8aa318aac026d06f4f8a625f9a5610", + "packages/ai/src/utils/sanitize-unicode.ts": "5749c2cf0819a900e6d84f66e989562bdf4f6bb5fb45958a82b2192f73448bde", + "packages/coding-agent/src/core/model-registry.ts": "53fba00330a076d14b020ed242903387e5b16683ab39bb5048dcf7fc8b27b7ff", + "node_modules/@anthropic-ai/sdk/package.json": "fcfaedec125d8cdfa6174f2ffae129f0ad34c681cad90a2a9dc9118cd9caecfa" + }, + "cases": [ + { + "id": "none", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "Hello 🌍", + "history": [], + "tools": [], + "options": { + "cacheRetention": "none" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable: dynamic!\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "short", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "Hello 🌍", + "history": [], + "tools": [], + "options": { + "cacheRetention": "short" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Hello 🌍\",\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable: dynamic!\",\"cache_control\":{\"type\":\"ephemeral\"}}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "long", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "Hello 🌍", + "history": [], + "tools": [], + "options": { + "cacheRetention": "long" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Hello 🌍\",\"cache_control\":{\"type\":\"ephemeral\",\"ttl\":\"1h\"}}]}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable: dynamic!\",\"cache_control\":{\"type\":\"ephemeral\",\"ttl\":\"1h\"}}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "long-unsupported", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"],\"compat\":{\"supportsLongCacheRetention\":false}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "Hello 🌍", + "history": [], + "tools": [], + "options": { + "cacheRetention": "long" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Hello 🌍\",\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable: dynamic!\",\"cache_control\":{\"type\":\"ephemeral\"}}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "tools-short", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "Hello 🌍", + "history": [], + "tools": [ + { + "name": "read", + "description": "Synthetic read", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "write", + "description": "Synthetic write", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + } + ], + "options": { + "cacheRetention": "short" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Hello 🌍\",\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable: dynamic!\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"tools\":[{\"name\":\"read\",\"description\":\"Synthetic read\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}},{\"name\":\"write\",\"description\":\"Synthetic write\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]},\"cache_control\":{\"type\":\"ephemeral\"}}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "tools-long", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "Hello 🌍", + "history": [], + "tools": [ + { + "name": "read", + "description": "Synthetic read", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "write", + "description": "Synthetic write", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + } + ], + "options": { + "cacheRetention": "long" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Hello 🌍\",\"cache_control\":{\"type\":\"ephemeral\",\"ttl\":\"1h\"}}]}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable: dynamic!\",\"cache_control\":{\"type\":\"ephemeral\",\"ttl\":\"1h\"}}],\"tools\":[{\"name\":\"read\",\"description\":\"Synthetic read\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}},{\"name\":\"write\",\"description\":\"Synthetic write\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]},\"cache_control\":{\"type\":\"ephemeral\",\"ttl\":\"1h\"}}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "tools-no-cache-control", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"],\"compat\":{\"supportsCacheControlOnTools\":false}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "Hello 🌍", + "history": [], + "tools": [ + { + "name": "read", + "description": "Synthetic read", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "write", + "description": "Synthetic write", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + } + ], + "options": { + "cacheRetention": "short" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Hello 🌍\",\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable: dynamic!\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"tools\":[{\"name\":\"read\",\"description\":\"Synthetic read\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}},{\"name\":\"write\",\"description\":\"Synthetic write\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "fireworks-long", + "overlay": "{\"providers\":{\"fireworks\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "fireworks", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "Hello 🌍", + "history": [], + "tools": [ + { + "name": "read", + "description": "Synthetic read", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "write", + "description": "Synthetic write", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + } + ], + "options": { + "cacheRetention": "long" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "fine-grained-tool-streaming-2025-05-14,interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Hello 🌍\",\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable: dynamic!\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"tools\":[{\"name\":\"read\",\"description\":\"Synthetic read\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}},{\"name\":\"write\",\"description\":\"Synthetic write\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "fireworks", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "empty-system", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "", + "user": "Hello 🌍", + "history": [], + "tools": [], + "options": { + "cacheRetention": "short" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Hello 🌍\",\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"max_tokens\":64,\"stream\":true}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "no-user", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "", + "history": [], + "tools": [], + "options": { + "cacheRetention": "short" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable: dynamic!\",\"cache_control\":{\"type\":\"ephemeral\"}}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "last-assistant", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "", + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "answer" + } + ] + } + ], + "tools": [], + "options": { + "cacheRetention": "short" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"answer\"}]}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable: dynamic!\",\"cache_control\":{\"type\":\"ephemeral\"}}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "boundary-short", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "Hello 🌍", + "history": [], + "tools": [], + "options": { + "cacheRetention": "short" + }, + "systemPromptCacheBoundary": 6 + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Hello 🌍\",\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable\",\"cache_control\":{\"type\":\"ephemeral\"}},{\"type\":\"text\",\"text\":\": dynamic!\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "boundary-long", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "Hello 🌍", + "history": [], + "tools": [], + "options": { + "cacheRetention": "long" + }, + "systemPromptCacheBoundary": 6 + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Hello 🌍\",\"cache_control\":{\"type\":\"ephemeral\",\"ttl\":\"1h\"}}]}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable\",\"cache_control\":{\"type\":\"ephemeral\",\"ttl\":\"1h\"}},{\"type\":\"text\",\"text\":\": dynamic!\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "boundary-none", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "Hello 🌍", + "history": [], + "tools": [], + "options": { + "cacheRetention": "none" + }, + "systemPromptCacheBoundary": 6 + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable: dynamic!\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "boundary-end", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "Hello 🌍", + "history": [], + "tools": [], + "options": { + "cacheRetention": "short" + }, + "systemPromptCacheBoundary": 16 + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Hello 🌍\",\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable: dynamic!\",\"cache_control\":{\"type\":\"ephemeral\"}}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "boundary-surrogate", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "A🌍B", + "user": "Hello 🌍", + "history": [], + "tools": [], + "options": { + "cacheRetention": "short" + }, + "systemPromptCacheBoundary": 2 + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Hello 🌍\",\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"A\",\"cache_control\":{\"type\":\"ephemeral\"}},{\"type\":\"text\",\"text\":\"B\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "boundary-zero", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "Hello 🌍", + "history": [], + "tools": [], + "options": { + "cacheRetention": "short" + }, + "systemPromptCacheBoundary": 0 + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Hello 🌍\",\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable: dynamic!\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "boundary-negative", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "Hello 🌍", + "history": [], + "tools": [], + "options": { + "cacheRetention": "short" + }, + "systemPromptCacheBoundary": -1 + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Hello 🌍\",\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable: dynamic!\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "boundary-beyond", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "Hello 🌍", + "history": [], + "tools": [], + "options": { + "cacheRetention": "short" + }, + "systemPromptCacheBoundary": 999 + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Hello 🌍\",\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable: dynamic!\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "boundary-fraction", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "Hello 🌍", + "history": [], + "tools": [], + "options": { + "cacheRetention": "short" + }, + "systemPromptCacheBoundary": 1.5 + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Hello 🌍\",\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable: dynamic!\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "boundary-string", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "Hello 🌍", + "history": [], + "tools": [], + "options": { + "cacheRetention": "short" + }, + "systemPromptCacheBoundary": "6" + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Hello 🌍\",\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable: dynamic!\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "boundary-null", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "Hello 🌍", + "history": [], + "tools": [], + "options": { + "cacheRetention": "short" + }, + "systemPromptCacheBoundary": null + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Hello 🌍\",\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable: dynamic!\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "bypass-no-boundary", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "Hello 🌍", + "history": [], + "tools": [], + "options": { + "cacheRetention": "short" + }, + "systemPromptCacheBoundaryBypass": true + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Hello 🌍\",\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable: dynamic!\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "bypass-valid", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "Hello 🌍", + "history": [], + "tools": [], + "options": { + "cacheRetention": "short" + }, + "systemPromptCacheBoundary": 6, + "systemPromptCacheBoundaryBypass": true + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Hello 🌍\",\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable: dynamic!\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "bypass-false", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "Hello 🌍", + "history": [], + "tools": [], + "options": { + "cacheRetention": "short" + }, + "systemPromptCacheBoundary": 6, + "systemPromptCacheBoundaryBypass": false + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Hello 🌍\",\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable\",\"cache_control\":{\"type\":\"ephemeral\"}},{\"type\":\"text\",\"text\":\": dynamic!\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "history-text", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "", + "history": [ + { + "role": "user", + "text": "previous" + } + ], + "tools": [], + "options": { + "cacheRetention": "short" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"previous\",\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable: dynamic!\",\"cache_control\":{\"type\":\"ephemeral\"}}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "history-image", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "", + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "AAAA" + } + ] + } + ], + "tools": [], + "options": { + "cacheRetention": "short" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/png\",\"data\":\"AAAA\"},\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable: dynamic!\",\"cache_control\":{\"type\":\"ephemeral\"}}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "history-image-tail", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "", + "history": [ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "caption" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "AAAA" + } + ] + } + ], + "tools": [], + "options": { + "cacheRetention": "short" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"caption\"},{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/png\",\"data\":\"AAAA\"},\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable: dynamic!\",\"cache_control\":{\"type\":\"ephemeral\"}}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "tool-result", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "", + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "r1", + "name": "read", + "arguments": { + "path": "fixture" + } + } + ] + }, + { + "role": "toolResult", + "toolCallId": "r1", + "isError": false, + "content": [ + { + "type": "text", + "text": "result" + } + ] + } + ], + "tools": [], + "options": { + "cacheRetention": "short" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"r1\",\"name\":\"read\",\"input\":{\"path\":\"fixture\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"r1\",\"content\":\"result\",\"is_error\":false,\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable: dynamic!\",\"cache_control\":{\"type\":\"ephemeral\"}}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "missing-tool-result", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "", + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "r1", + "name": "read", + "arguments": { + "path": "fixture" + } + } + ] + } + ], + "tools": [], + "options": { + "cacheRetention": "short" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"r1\",\"name\":\"read\",\"input\":{\"path\":\"fixture\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"r1\",\"content\":\"No result provided\",\"is_error\":true,\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable: dynamic!\",\"cache_control\":{\"type\":\"ephemeral\"}}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "blocks-blank", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "", + "history": [ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "one" + }, + { + "type": "text", + "text": " " + } + ] + } + ], + "tools": [], + "options": { + "cacheRetention": "short" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"one\",\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable: dynamic!\",\"cache_control\":{\"type\":\"ephemeral\"}}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "empty-history-block", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-cache\",\"reasoning\":false,\"input\":[\"text\",\"image\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-cache", + "maxTokens": 64, + "system": "Stable: dynamic!", + "user": "", + "history": [ + { + "role": "user", + "content": [] + } + ], + "tools": [], + "options": { + "cacheRetention": "short" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-cache\",\"messages\":[],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Stable: dynamic!\",\"cache_control\":{\"type\":\"ephemeral\"}}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-cache", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + } + ] +} diff --git a/native/omk-providers/tests/fixtures/anthropic-content.json b/native/omk-providers/tests/fixtures/anthropic-content.json new file mode 100644 index 0000000000..cc85e342d7 --- /dev/null +++ b/native/omk-providers/tests/fixtures/anthropic-content.json @@ -0,0 +1,1233 @@ +{ + "schema": "omk.anthropic.content.v1", + "source": { + "scripts/fixtures/anthropic-content-recorder.ts": "35565f2817cf371625eb5f4d79fe65e4087a99c334123f4d31850dfee691350c", + "scripts/fixtures/anthropic-content-cases.ts": "cb2a683952b347019808df2ff64ff20b70a1e55ffe938ce0a36b64622f284544", + "scripts/fixtures/anthropic-provider-cases.ts": "c73097643a997be405d583bbdeb09e4fc7d9dc0bfa037f59f5965949c23d638f", + "packages/ai/src/providers/anthropic.ts": "38e1ca641ad118fb0f66e927979a0533f19ea3f64e37b1778888b1093aa90a46", + "packages/ai/src/providers/anthropic-client.ts": "6e6555d8d11e649c571060b5ee1042d6cc68c44d9f9250f99dc803fe725efd82", + "packages/ai/src/providers/anthropic-compat.ts": "a636a7caec627915d187137228a0151e77b9242bcf0c0add996cf9bed984b017", + "packages/ai/src/providers/transform-messages.ts": "f60d2e3c7db909eb9d80d6b670bf0d7fed8aa318aac026d06f4f8a625f9a5610", + "packages/ai/src/utils/sanitize-unicode.ts": "5749c2cf0819a900e6d84f66e989562bdf4f6bb5fb45958a82b2192f73448bde", + "packages/ai/src/providers/anthropic-image-guard.ts": "9ca6ebf22d2f83ca5c8b5daf73c50883f3589ff1c48ecbae6b761e40c937abd6", + "node_modules/@anthropic-ai/sdk/package.json": "fcfaedec125d8cdfa6174f2ffae129f0ad34c681cad90a2a9dc9118cd9caecfa" + }, + "projection": { + "headersExcluded": [ + "x-stainless-*", + "user-agent" + ], + "scope": "text-only model user arrays and image downgrade, same-model tool results, API key, cache disabled" + }, + "cases": [ + { + "id": "user-empty-array", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "user-blank-array", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "" + }, + { + "type": "text", + "text": " \t\n" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "user-text-array", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "First 한글" + }, + { + "type": "text", + "text": "Second 🌏" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"First 한글\"},{\"type\":\"text\",\"text\":\"Second 🌏\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "user-whitespace", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "text", + "text": " Keep " + }, + { + "type": "text", + "text": "" + }, + { + "type": "text", + "text": "\n" + }, + { + "type": "text", + "text": " Last " + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\" Keep \"},{\"type\":\"text\",\"text\":\" Last \"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "user-ecma-whitespace", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "…" + }, + { + "type": "text", + "text": "" + }, + { + "type": "text", + "text": " " + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"…\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "user-image", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "c3ludGhldGlj" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"(image omitted: model does not support images)\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "user-adjacent-images", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "c3ludGhldGlj" + }, + { + "type": "image", + "mimeType": "image/jpeg", + "data": "c3ludGhldGlj" + }, + { + "type": "image", + "mimeType": "image/webp", + "data": "c3ludGhldGlj" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"(image omitted: model does not support images)\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "user-separated-images", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "c3ludGhldGlj" + }, + { + "type": "text", + "text": "Middle" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "c3ludGhldGlj" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"(image omitted: model does not support images)\"},{\"type\":\"text\",\"text\":\"Middle\"},{\"type\":\"text\",\"text\":\"(image omitted: model does not support images)\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "user-placeholder-before", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "(image omitted: model does not support images)" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "c3ludGhldGlj" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"(image omitted: model does not support images)\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "user-placeholder-after", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "c3ludGhldGlj" + }, + { + "type": "text", + "text": "(image omitted: model does not support images)" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "c3ludGhldGlj" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"(image omitted: model does not support images)\"},{\"type\":\"text\",\"text\":\"(image omitted: model does not support images)\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "user-blank-between-images", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "c3ludGhldGlj" + }, + { + "type": "text", + "text": "" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "c3ludGhldGlj" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"(image omitted: model does not support images)\"},{\"type\":\"text\",\"text\":\"(image omitted: model does not support images)\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "user-mime-data-ignored", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "mimeType": "application/synthetic", + "data": "not base64 🌏" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"(image omitted: model does not support images)\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "tool-empty-array", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": {} + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"\",\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "tool-blank-array", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": {} + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "text", + "text": "" + }, + { + "type": "text", + "text": " \t\n" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"\\n \\t\\n\",\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "tool-text-array", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": {} + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "text", + "text": "First" + }, + { + "type": "text", + "text": "" + }, + { + "type": "text", + "text": "Last 한글" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"First\\n\\nLast 한글\",\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "tool-image", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": {} + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "c3ludGhldGlj" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"(tool image omitted: model does not support images)\",\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "tool-adjacent-images", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": {} + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "c3ludGhldGlj" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "c3ludGhldGlj" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"(tool image omitted: model does not support images)\",\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "tool-separated-images", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": {} + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "c3ludGhldGlj" + }, + { + "type": "text", + "text": "Middle" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "c3ludGhldGlj" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"(tool image omitted: model does not support images)\\nMiddle\\n(tool image omitted: model does not support images)\",\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "tool-placeholder-before", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": {} + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "text", + "text": "(tool image omitted: model does not support images)" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "c3ludGhldGlj" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"(tool image omitted: model does not support images)\",\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "tool-placeholder-after", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": {} + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "c3ludGhldGlj" + }, + { + "type": "text", + "text": "(tool image omitted: model does not support images)" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "c3ludGhldGlj" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"(tool image omitted: model does not support images)\\n(tool image omitted: model does not support images)\",\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "tool-blank-between-images", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": {} + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "c3ludGhldGlj" + }, + { + "type": "text", + "text": "" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "c3ludGhldGlj" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"(tool image omitted: model does not support images)\\n\\n(tool image omitted: model does not support images)\",\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "tool-grouped-images", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": {} + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "c3ludGhldGlj" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "c3ludGhldGlj" + }, + { + "type": "text", + "text": "Next" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"(tool image omitted: model does not support images)\",\"is_error\":false},{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"(tool image omitted: model does not support images)\\nNext\",\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "array-interrupts-tool", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": {} + } + ], + "stopReason": "toolUse" + }, + { + "role": "user", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "c3ludGhldGlj" + } + ] + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "c3ludGhldGlj" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"No result provided\",\"is_error\":true}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"(image omitted: model does not support images)\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"(tool image omitted: model does not support images)\",\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "blank-array-separates-results", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": {} + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "c3ludGhldGlj" + } + ], + "isError": false + }, + { + "role": "user", + "content": [] + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "c3ludGhldGlj" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"(tool image omitted: model does not support images)\",\"is_error\":false}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"(tool image omitted: model does not support images)\",\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "orphan-image", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "toolResult", + "toolCallId": "orphan", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "c3ludGhldGlj" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "failed-assistant-image", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": {} + } + ], + "stopReason": "error" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "c3ludGhldGlj" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + } + ] +} diff --git a/native/omk-providers/tests/fixtures/anthropic-policy.json b/native/omk-providers/tests/fixtures/anthropic-policy.json new file mode 100644 index 0000000000..cd20cc48bf --- /dev/null +++ b/native/omk-providers/tests/fixtures/anthropic-policy.json @@ -0,0 +1,2448 @@ +{ + "schema": "omk.anthropic-policy.v1", + "source": { + "scripts/fixtures/anthropic-policy-recorder.ts": "ec5f988bf32b225511f6d4a54138ba6261fc3360f58d9e9ea4b4dc64ad95376d", + "scripts/fixtures/anthropic-provider-cases.ts": "c73097643a997be405d583bbdeb09e4fc7d9dc0bfa037f59f5965949c23d638f", + "packages/ai/src/providers/anthropic.ts": "38e1ca641ad118fb0f66e927979a0533f19ea3f64e37b1778888b1093aa90a46", + "packages/ai/src/providers/anthropic-compat.ts": "a636a7caec627915d187137228a0151e77b9242bcf0c0add996cf9bed984b017", + "packages/coding-agent/src/core/model-registry.ts": "53fba00330a076d14b020ed242903387e5b16683ab39bb5048dcf7fc8b27b7ff" + }, + "cases": [ + { + "id": "default", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":false,\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [], + "options": {} + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "temperature-zero", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":false,\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [], + "options": { + "temperature": 0 + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"temperature\":0}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "temperature-half", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":false,\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [], + "options": { + "temperature": 0.5 + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"temperature\":0.5}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "temperature-one", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":false,\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [], + "options": { + "temperature": 1 + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"temperature\":1}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "temperature-unsupported", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":false,\"input\":[\"text\"],\"compat\":{\"supportsTemperature\":false}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [], + "options": { + "temperature": 0.5 + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "temperature-thinking-nonreasoning", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":false,\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [], + "options": { + "temperature": 0.5, + "thinkingEnabled": true + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "thinking-nonreasoning", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":false,\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [], + "options": { + "thinkingEnabled": true, + "thinkingBudgetTokens": 256 + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "thinking-default", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":true,\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [], + "options": { + "thinkingEnabled": true + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"thinking\":{\"type\":\"enabled\",\"budget_tokens\":1024,\"display\":\"summarized\"}}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "thinking-zero-budget", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":true,\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [], + "options": { + "thinkingEnabled": true, + "thinkingBudgetTokens": 0 + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"thinking\":{\"type\":\"enabled\",\"budget_tokens\":1024,\"display\":\"summarized\"}}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "thinking-budget", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":true,\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [], + "options": { + "thinkingEnabled": true, + "thinkingBudgetTokens": 256 + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"thinking\":{\"type\":\"enabled\",\"budget_tokens\":256,\"display\":\"summarized\"}}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "thinking-omitted", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":true,\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [], + "options": { + "thinkingEnabled": true, + "thinkingDisplay": "omitted" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"thinking\":{\"type\":\"enabled\",\"budget_tokens\":1024,\"display\":\"omitted\"}}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "thinking-disabled", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":true,\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [], + "options": { + "thinkingEnabled": false + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"thinking\":{\"type\":\"disabled\"}}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "disabled-unsupported", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":true,\"input\":[\"text\"],\"compat\":{\"supportsDisabledThinking\":false}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [], + "options": { + "thinkingEnabled": false + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "disabled-temperature", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":true,\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [], + "options": { + "thinkingEnabled": false, + "temperature": 0.5 + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"temperature\":0.5,\"thinking\":{\"type\":\"disabled\"}}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "enabled-temperature", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":true,\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [], + "options": { + "thinkingEnabled": true, + "temperature": 0.5 + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"thinking\":{\"type\":\"enabled\",\"budget_tokens\":1024,\"display\":\"summarized\"}}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "adaptive-default", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":true,\"input\":[\"text\"],\"compat\":{\"forceAdaptiveThinking\":true}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [], + "options": { + "thinkingEnabled": true + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"thinking\":{\"type\":\"adaptive\",\"display\":\"summarized\"}}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "adaptive-low", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":true,\"input\":[\"text\"],\"compat\":{\"forceAdaptiveThinking\":true}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [], + "options": { + "thinkingEnabled": true, + "effort": "low" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"thinking\":{\"type\":\"adaptive\",\"display\":\"summarized\"},\"output_config\":{\"effort\":\"low\"}}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "adaptive-medium", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":true,\"input\":[\"text\"],\"compat\":{\"forceAdaptiveThinking\":true}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [], + "options": { + "thinkingEnabled": true, + "effort": "medium" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"thinking\":{\"type\":\"adaptive\",\"display\":\"summarized\"},\"output_config\":{\"effort\":\"medium\"}}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "adaptive-high", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":true,\"input\":[\"text\"],\"compat\":{\"forceAdaptiveThinking\":true}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [], + "options": { + "thinkingEnabled": true, + "effort": "high" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"thinking\":{\"type\":\"adaptive\",\"display\":\"summarized\"},\"output_config\":{\"effort\":\"high\"}}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "adaptive-xhigh", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":true,\"input\":[\"text\"],\"compat\":{\"forceAdaptiveThinking\":true}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [], + "options": { + "thinkingEnabled": true, + "effort": "xhigh" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"thinking\":{\"type\":\"adaptive\",\"display\":\"summarized\"},\"output_config\":{\"effort\":\"xhigh\"}}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "adaptive-max", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":true,\"input\":[\"text\"],\"compat\":{\"forceAdaptiveThinking\":true}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [], + "options": { + "thinkingEnabled": true, + "effort": "max" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"thinking\":{\"type\":\"adaptive\",\"display\":\"summarized\"},\"output_config\":{\"effort\":\"max\"}}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "adaptive-omitted", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":true,\"input\":[\"text\"],\"compat\":{\"forceAdaptiveThinking\":true}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [], + "options": { + "thinkingEnabled": true, + "thinkingDisplay": "omitted", + "effort": "high" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"thinking\":{\"type\":\"adaptive\",\"display\":\"omitted\"},\"output_config\":{\"effort\":\"high\"}}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "adaptive-disabled", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":true,\"input\":[\"text\"],\"compat\":{\"forceAdaptiveThinking\":true}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [], + "options": { + "thinkingEnabled": false + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"thinking\":{\"type\":\"disabled\"}}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "classic-effort-ignored", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":true,\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [], + "options": { + "thinkingEnabled": true, + "effort": "high" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"thinking\":{\"type\":\"enabled\",\"budget_tokens\":1024,\"display\":\"summarized\"}}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "metadata", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":false,\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [], + "options": { + "metadata": { + "user_id": "synthetic-user" + } + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"metadata\":{\"user_id\":\"synthetic-user\"}}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "metadata-empty", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":false,\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [], + "options": { + "metadata": { + "user_id": "" + } + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"metadata\":{\"user_id\":\"\"}}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "metadata-unicode", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":false,\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [], + "options": { + "metadata": { + "user_id": "한글 🌍" + } + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"metadata\":{\"user_id\":\"한글 🌍\"}}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "metadata-other-ignored", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":false,\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [], + "options": { + "metadata": { + "other": "ignored" + } + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "tool-auto", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":false,\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [ + { + "name": "read", + "description": "Read synthetic file", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + } + ], + "options": { + "toolChoice": "auto" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"tools\":[{\"name\":\"read\",\"description\":\"Read synthetic file\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}}],\"tool_choice\":{\"type\":\"auto\"}}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "tool-any", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":false,\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [ + { + "name": "read", + "description": "Read synthetic file", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + } + ], + "options": { + "toolChoice": "any" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"tools\":[{\"name\":\"read\",\"description\":\"Read synthetic file\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}}],\"tool_choice\":{\"type\":\"any\"}}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "tool-none", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":false,\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [ + { + "name": "read", + "description": "Read synthetic file", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + } + ], + "options": { + "toolChoice": "none" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"tools\":[{\"name\":\"read\",\"description\":\"Read synthetic file\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}}],\"tool_choice\":{\"type\":\"none\"}}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "tool-named", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-policy\",\"reasoning\":false,\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-policy", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [ + { + "name": "read", + "description": "Read synthetic file", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + } + ], + "options": { + "toolChoice": { + "type": "tool", + "name": "read" + } + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-policy\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"tools\":[{\"name\":\"read\",\"description\":\"Read synthetic file\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}}],\"tool_choice\":{\"type\":\"tool\",\"name\":\"read\"}}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-policy", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + } + ] +} diff --git a/native/omk-providers/tests/fixtures/anthropic-signature.json b/native/omk-providers/tests/fixtures/anthropic-signature.json new file mode 100644 index 0000000000..b6c2e56351 --- /dev/null +++ b/native/omk-providers/tests/fixtures/anthropic-signature.json @@ -0,0 +1,1511 @@ +{ + "schema": "omk.anthropic-signature.v1", + "source": { + "scripts/fixtures/anthropic-signature-recorder.ts": "e242cc5f2baf5782475bb94dc52c9fd8835edda3a31859d2ffccda2dacbe2548", + "scripts/fixtures/anthropic-provider-cases.ts": "c73097643a997be405d583bbdeb09e4fc7d9dc0bfa037f59f5965949c23d638f", + "packages/ai/src/providers/anthropic.ts": "38e1ca641ad118fb0f66e927979a0533f19ea3f64e37b1778888b1093aa90a46", + "packages/ai/src/providers/anthropic-compat.ts": "a636a7caec627915d187137228a0151e77b9242bcf0c0add996cf9bed984b017", + "packages/ai/src/providers/transform-messages.ts": "f60d2e3c7db909eb9d80d6b670bf0d7fed8aa318aac026d06f4f8a625f9a5610", + "node_modules/@anthropic-ai/sdk/package.json": "fcfaedec125d8cdfa6174f2ffae129f0ad34c681cad90a2a9dc9118cd9caecfa" + }, + "cases": [ + { + "id": "false-missing", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid\",\"models\":[{\"id\":\"synthetic-signature\",\"input\":[\"text\"],\"compat\":{\"allowEmptySignature\":false}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-signature", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "thinking", + "thinking": "thought" + } + ] + } + ] + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-signature\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"thought\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-signature", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "false-empty", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid\",\"models\":[{\"id\":\"synthetic-signature\",\"input\":[\"text\"],\"compat\":{\"allowEmptySignature\":false}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-signature", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "thinking", + "thinking": "thought", + "thinkingSignature": "" + } + ] + } + ], + "options": {} + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-signature\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"thought\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-signature", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "false-space", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid\",\"models\":[{\"id\":\"synthetic-signature\",\"input\":[\"text\"],\"compat\":{\"allowEmptySignature\":false}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-signature", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "thinking", + "thinking": "thought", + "thinkingSignature": " " + } + ] + } + ] + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-signature\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"thought\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-signature", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "false-BOM", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid\",\"models\":[{\"id\":\"synthetic-signature\",\"input\":[\"text\"],\"compat\":{\"allowEmptySignature\":false}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-signature", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "thinking", + "thinking": "thought", + "thinkingSignature": "" + } + ] + } + ] + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-signature\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"thought\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-signature", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "false-NEL", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid\",\"models\":[{\"id\":\"synthetic-signature\",\"input\":[\"text\"],\"compat\":{\"allowEmptySignature\":false}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-signature", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "thinking", + "thinking": "thought", + "thinkingSignature": "…" + } + ] + } + ] + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-signature\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"thinking\",\"thinking\":\"thought\",\"signature\":\"…\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-signature", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "false-signed", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid\",\"models\":[{\"id\":\"synthetic-signature\",\"input\":[\"text\"],\"compat\":{\"allowEmptySignature\":false}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-signature", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "thinking", + "thinking": "thought", + "thinkingSignature": "signed" + } + ] + } + ] + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-signature\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"thinking\",\"thinking\":\"thought\",\"signature\":\"signed\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-signature", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "false-empty-text", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid\",\"models\":[{\"id\":\"synthetic-signature\",\"input\":[\"text\"],\"compat\":{\"allowEmptySignature\":false}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-signature", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "thinking", + "thinking": "", + "thinkingSignature": "signed" + } + ] + } + ] + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-signature\",\"messages\":[{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-signature", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "false-redacted", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid\",\"models\":[{\"id\":\"synthetic-signature\",\"input\":[\"text\"],\"compat\":{\"allowEmptySignature\":false}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-signature", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "thinking", + "thinking": "", + "redacted": true, + "thinkingSignature": "opaque" + } + ] + } + ] + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-signature\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"redacted_thinking\",\"data\":\"opaque\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-signature", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "false-redacted-empty", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid\",\"models\":[{\"id\":\"synthetic-signature\",\"input\":[\"text\"],\"compat\":{\"allowEmptySignature\":false}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-signature", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "thinking", + "thinking": "", + "redacted": true, + "thinkingSignature": "" + } + ] + } + ] + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-signature\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"redacted_thinking\",\"data\":\"\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-signature", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "true-missing", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid\",\"models\":[{\"id\":\"synthetic-signature\",\"input\":[\"text\"],\"compat\":{\"allowEmptySignature\":true}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-signature", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "thinking", + "thinking": "thought" + } + ] + } + ] + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-signature\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"thinking\",\"thinking\":\"thought\",\"signature\":\"\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-signature", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "true-empty", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid\",\"models\":[{\"id\":\"synthetic-signature\",\"input\":[\"text\"],\"compat\":{\"allowEmptySignature\":true}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-signature", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "thinking", + "thinking": "thought", + "thinkingSignature": "" + } + ] + } + ], + "options": {} + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-signature\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"thinking\",\"thinking\":\"thought\",\"signature\":\"\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-signature", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "true-space", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid\",\"models\":[{\"id\":\"synthetic-signature\",\"input\":[\"text\"],\"compat\":{\"allowEmptySignature\":true}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-signature", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "thinking", + "thinking": "thought", + "thinkingSignature": " " + } + ] + } + ] + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-signature\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"thinking\",\"thinking\":\"thought\",\"signature\":\"\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-signature", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "true-BOM", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid\",\"models\":[{\"id\":\"synthetic-signature\",\"input\":[\"text\"],\"compat\":{\"allowEmptySignature\":true}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-signature", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "thinking", + "thinking": "thought", + "thinkingSignature": "" + } + ] + } + ] + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-signature\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"thinking\",\"thinking\":\"thought\",\"signature\":\"\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-signature", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "true-NEL", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid\",\"models\":[{\"id\":\"synthetic-signature\",\"input\":[\"text\"],\"compat\":{\"allowEmptySignature\":true}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-signature", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "thinking", + "thinking": "thought", + "thinkingSignature": "…" + } + ] + } + ] + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-signature\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"thinking\",\"thinking\":\"thought\",\"signature\":\"…\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-signature", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "true-signed", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid\",\"models\":[{\"id\":\"synthetic-signature\",\"input\":[\"text\"],\"compat\":{\"allowEmptySignature\":true}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-signature", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "thinking", + "thinking": "thought", + "thinkingSignature": "signed" + } + ] + } + ] + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-signature\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"thinking\",\"thinking\":\"thought\",\"signature\":\"signed\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-signature", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "true-empty-text", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid\",\"models\":[{\"id\":\"synthetic-signature\",\"input\":[\"text\"],\"compat\":{\"allowEmptySignature\":true}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-signature", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "thinking", + "thinking": "", + "thinkingSignature": "signed" + } + ] + } + ] + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-signature\",\"messages\":[{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-signature", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "true-redacted", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid\",\"models\":[{\"id\":\"synthetic-signature\",\"input\":[\"text\"],\"compat\":{\"allowEmptySignature\":true}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-signature", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "thinking", + "thinking": "", + "redacted": true, + "thinkingSignature": "opaque" + } + ] + } + ] + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-signature\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"redacted_thinking\",\"data\":\"opaque\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-signature", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "true-redacted-empty", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid\",\"models\":[{\"id\":\"synthetic-signature\",\"input\":[\"text\"],\"compat\":{\"allowEmptySignature\":true}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-signature", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "thinking", + "thinking": "", + "redacted": true, + "thinkingSignature": "" + } + ] + } + ] + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-signature\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"redacted_thinking\",\"data\":\"\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-signature", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + } + ] +} diff --git a/native/omk-providers/tests/fixtures/anthropic-tool-history.json b/native/omk-providers/tests/fixtures/anthropic-tool-history.json new file mode 100644 index 0000000000..4f5833e949 --- /dev/null +++ b/native/omk-providers/tests/fixtures/anthropic-tool-history.json @@ -0,0 +1,1376 @@ +{ + "schema": "omk.anthropic.tool-history.v1", + "source": { + "scripts/fixtures/anthropic-tool-history-recorder.ts": "5f6038a847177afe15532a5d284b755aba7b5ea71e7e7d370b717903f4dea083", + "scripts/fixtures/anthropic-tool-history-cases.ts": "39116570dc6c49befa90a76cdc198b1cd797b25302572ca07a56294a87f7372d", + "scripts/fixtures/anthropic-provider-cases.ts": "c73097643a997be405d583bbdeb09e4fc7d9dc0bfa037f59f5965949c23d638f", + "packages/ai/src/providers/anthropic.ts": "38e1ca641ad118fb0f66e927979a0533f19ea3f64e37b1778888b1093aa90a46", + "packages/ai/src/providers/anthropic-client.ts": "6e6555d8d11e649c571060b5ee1042d6cc68c44d9f9250f99dc803fe725efd82", + "packages/ai/src/providers/anthropic-compat.ts": "a636a7caec627915d187137228a0151e77b9242bcf0c0add996cf9bed984b017", + "packages/ai/src/providers/transform-messages.ts": "f60d2e3c7db909eb9d80d6b670bf0d7fed8aa318aac026d06f4f8a625f9a5610", + "packages/ai/src/utils/sanitize-unicode.ts": "5749c2cf0819a900e6d84f66e989562bdf4f6bb5fb45958a82b2192f73448bde", + "packages/ai/src/providers/anthropic-image-guard.ts": "9ca6ebf22d2f83ca5c8b5daf73c50883f3589ff1c48ecbae6b761e40c937abd6", + "node_modules/@anthropic-ai/sdk/package.json": "fcfaedec125d8cdfa6174f2ffae129f0ad34c681cad90a2a9dc9118cd9caecfa" + }, + "projection": { + "headersExcluded": [ + "x-stainless-*", + "user-agent" + ], + "scope": "same-model tools, text results and thinking history, API key, cache disabled" + }, + "cases": [ + { + "id": "single-tool", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": { + "path": "한글/🌍.txt" + } + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "text", + "text": "Synthetic result" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{\"path\":\"한글/🌍.txt\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"Synthetic result\",\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "parallel-tools", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "Reading" + }, + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": { + "path": "한글/🌍.txt" + } + }, + { + "type": "toolCall", + "id": "call_2", + "name": "read", + "arguments": { + "path": "second.txt" + } + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "text", + "text": "Synthetic result" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call_2", + "content": [ + { + "type": "text", + "text": "Synthetic result" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"Reading\"},{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{\"path\":\"한글/🌍.txt\"}},{\"type\":\"tool_use\",\"id\":\"call_2\",\"name\":\"read\",\"input\":{\"path\":\"second.txt\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"Synthetic result\",\"is_error\":false},{\"type\":\"tool_result\",\"tool_use_id\":\"call_2\",\"content\":\"Synthetic result\",\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "reverse-results", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "Reading" + }, + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": { + "path": "한글/🌍.txt" + } + }, + { + "type": "toolCall", + "id": "call_2", + "name": "read", + "arguments": { + "path": "second.txt" + } + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_2", + "content": [ + { + "type": "text", + "text": "Synthetic result" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "text", + "text": "Synthetic result" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"Reading\"},{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{\"path\":\"한글/🌍.txt\"}},{\"type\":\"tool_use\",\"id\":\"call_2\",\"name\":\"read\",\"input\":{\"path\":\"second.txt\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_2\",\"content\":\"Synthetic result\",\"is_error\":false},{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"Synthetic result\",\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "missing-all-results", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "Reading" + }, + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": { + "path": "한글/🌍.txt" + } + }, + { + "type": "toolCall", + "id": "call_2", + "name": "read", + "arguments": { + "path": "second.txt" + } + } + ], + "stopReason": "toolUse" + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"Reading\"},{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{\"path\":\"한글/🌍.txt\"}},{\"type\":\"tool_use\",\"id\":\"call_2\",\"name\":\"read\",\"input\":{\"path\":\"second.txt\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"No result provided\",\"is_error\":true},{\"type\":\"tool_result\",\"tool_use_id\":\"call_2\",\"content\":\"No result provided\",\"is_error\":true}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "missing-one-result", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "Reading" + }, + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": { + "path": "한글/🌍.txt" + } + }, + { + "type": "toolCall", + "id": "call_2", + "name": "read", + "arguments": { + "path": "second.txt" + } + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_2", + "content": [ + { + "type": "text", + "text": "Synthetic result" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"Reading\"},{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{\"path\":\"한글/🌍.txt\"}},{\"type\":\"tool_use\",\"id\":\"call_2\",\"name\":\"read\",\"input\":{\"path\":\"second.txt\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_2\",\"content\":\"Synthetic result\",\"is_error\":false},{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"No result provided\",\"is_error\":true}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "missing-at-eof", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "Reading" + }, + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": { + "path": "한글/🌍.txt" + } + }, + { + "type": "toolCall", + "id": "call_2", + "name": "read", + "arguments": { + "path": "second.txt" + } + } + ], + "stopReason": "toolUse" + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"Reading\"},{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{\"path\":\"한글/🌍.txt\"}},{\"type\":\"tool_use\",\"id\":\"call_2\",\"name\":\"read\",\"input\":{\"path\":\"second.txt\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"No result provided\",\"is_error\":true},{\"type\":\"tool_result\",\"tool_use_id\":\"call_2\",\"content\":\"No result provided\",\"is_error\":true}]}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "interrupted-by-user", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "Reading" + }, + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": { + "path": "한글/🌍.txt" + } + }, + { + "type": "toolCall", + "id": "call_2", + "name": "read", + "arguments": { + "path": "second.txt" + } + } + ], + "stopReason": "toolUse" + }, + { + "role": "user", + "text": "Interrupt" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "text", + "text": "Synthetic result" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"Reading\"},{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{\"path\":\"한글/🌍.txt\"}},{\"type\":\"tool_use\",\"id\":\"call_2\",\"name\":\"read\",\"input\":{\"path\":\"second.txt\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"No result provided\",\"is_error\":true},{\"type\":\"tool_result\",\"tool_use_id\":\"call_2\",\"content\":\"No result provided\",\"is_error\":true}]},{\"role\":\"user\",\"content\":\"Interrupt\"},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"Synthetic result\",\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "interrupted-by-assistant", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "Reading" + }, + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": { + "path": "한글/🌍.txt" + } + }, + { + "type": "toolCall", + "id": "call_2", + "name": "read", + "arguments": { + "path": "second.txt" + } + } + ], + "stopReason": "toolUse" + }, + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "Next assistant" + } + ] + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "text", + "text": "Synthetic result" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"Reading\"},{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{\"path\":\"한글/🌍.txt\"}},{\"type\":\"tool_use\",\"id\":\"call_2\",\"name\":\"read\",\"input\":{\"path\":\"second.txt\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"No result provided\",\"is_error\":true},{\"type\":\"tool_result\",\"tool_use_id\":\"call_2\",\"content\":\"No result provided\",\"is_error\":true}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"Next assistant\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"Synthetic result\",\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "orphan-results", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "toolResult", + "toolCallId": "unknown", + "content": [ + { + "type": "text", + "text": "Synthetic result" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "", + "content": [ + { + "type": "text", + "text": "Synthetic result" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "error-assistant", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": { + "path": "한글/🌍.txt" + } + }, + { + "type": "text", + "text": "Incomplete" + } + ], + "stopReason": "error" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "text", + "text": "Synthetic result" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "aborted-assistant", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": { + "path": "한글/🌍.txt" + } + } + ], + "stopReason": "aborted" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "text", + "text": "Synthetic result" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "error-flushes-pending", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "Reading" + }, + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": { + "path": "한글/🌍.txt" + } + }, + { + "type": "toolCall", + "id": "call_2", + "name": "read", + "arguments": { + "path": "second.txt" + } + } + ], + "stopReason": "toolUse" + }, + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "failed", + "name": "read", + "arguments": { + "path": "한글/🌍.txt" + } + } + ], + "stopReason": "error" + }, + { + "role": "toolResult", + "toolCallId": "failed", + "content": [ + { + "type": "text", + "text": "Synthetic result" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"Reading\"},{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{\"path\":\"한글/🌍.txt\"}},{\"type\":\"tool_use\",\"id\":\"call_2\",\"name\":\"read\",\"input\":{\"path\":\"second.txt\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"No result provided\",\"is_error\":true},{\"type\":\"tool_result\",\"tool_use_id\":\"call_2\",\"content\":\"No result provided\",\"is_error\":true}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "trim-result-id", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": { + "path": "한글/🌍.txt" + } + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": " \tcall_1", + "content": [ + { + "type": "text", + "text": "Synthetic result" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{\"path\":\"한글/🌍.txt\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"Synthetic result\",\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "same-model-id-unchanged", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call|🌍", + "name": "read", + "arguments": { + "path": "한글/🌍.txt" + } + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call|🌍", + "content": [ + { + "type": "text", + "text": "Synthetic result" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call|🌍\",\"name\":\"read\",\"input\":{\"path\":\"한글/🌍.txt\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call|🌍\",\"content\":\"Synthetic result\",\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "duplicate-results", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": { + "path": "한글/🌍.txt" + } + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "text", + "text": "Synthetic result" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "text", + "text": "Synthetic result" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{\"path\":\"한글/🌍.txt\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"Synthetic result\",\"is_error\":false},{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"Synthetic result\",\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "empty-tool-result", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": { + "path": "한글/🌍.txt" + } + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{\"path\":\"한글/🌍.txt\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"\",\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "multiblock-error-result", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": { + "path": "한글/🌍.txt" + } + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "text", + "text": "First" + }, + { + "type": "text", + "text": "" + }, + { + "type": "text", + "text": "Last\n🌏" + } + ], + "isError": true + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{\"path\":\"한글/🌍.txt\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"First\\n\\nLast\\n🌏\",\"is_error\":true}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "argument-key-order", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": { + "2": 2, + "10": 10, + "z": 1, + "a": { + "second": [ + null, + false, + 0.25 + ], + "first": "quote: \" slash: \\ nul: \u0000" + } + } + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "text", + "text": "Synthetic result" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{\"2\":2,\"10\":10,\"z\":1,\"a\":{\"second\":[null,false,0.25],\"first\":\"quote: \\\" slash: \\\\ nul: \\u0000\"}}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"Synthetic result\",\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "signed-thinking", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "thinking", + "thinking": "Reasoning 한글", + "thinkingSignature": "synthetic-signature" + }, + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": { + "path": "한글/🌍.txt" + } + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "text", + "text": "Synthetic result" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"thinking\",\"thinking\":\"Reasoning 한글\",\"signature\":\"synthetic-signature\"},{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{\"path\":\"한글/🌍.txt\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"Synthetic result\",\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "unsigned-thinking", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "thinking", + "thinking": "Unsigned reasoning" + }, + { + "type": "text", + "text": "Reply" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"Unsigned reasoning\"},{\"type\":\"text\",\"text\":\"Reply\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "blank-signature", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "thinking", + "thinking": "Reasoning", + "thinkingSignature": " \t" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"Reasoning\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "empty-thinking", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "thinking", + "thinking": " ", + "thinkingSignature": "synthetic-signature" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "redacted-thinking", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "thinking", + "thinking": "", + "thinkingSignature": "synthetic-opaque", + "redacted": true + }, + { + "type": "text", + "text": "Reply" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"redacted_thinking\",\"data\":\"synthetic-opaque\"},{\"type\":\"text\",\"text\":\"Reply\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "blank-blocks", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": " \t" + }, + { + "type": "text", + "text": "…" + }, + { + "type": "text", + "text": " Keep " + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"…\"},{\"type\":\"text\",\"text\":\" Keep \"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "two-tool-turns", + "input": { + "model": "synthetic-anthropic", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": { + "path": "한글/🌍.txt" + } + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "text", + "text": "Synthetic result" + } + ], + "isError": false + }, + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_2", + "name": "read", + "arguments": { + "path": "한글/🌍.txt" + } + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_2", + "content": [ + { + "type": "text", + "text": "Synthetic result" + } + ], + "isError": false + }, + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "Done" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{\"path\":\"한글/🌍.txt\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"Synthetic result\",\"is_error\":false}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_2\",\"name\":\"read\",\"input\":{\"path\":\"한글/🌍.txt\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_2\",\"content\":\"Synthetic result\",\"is_error\":false}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"Done\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + } + ] +} diff --git a/native/omk-providers/tests/fixtures/anthropic-tool-schema.json b/native/omk-providers/tests/fixtures/anthropic-tool-schema.json new file mode 100644 index 0000000000..627be6cb0e --- /dev/null +++ b/native/omk-providers/tests/fixtures/anthropic-tool-schema.json @@ -0,0 +1,1266 @@ +{ + "schema": "omk.anthropic-tool-schema.v1", + "locale": "en-US", + "source": { + "scripts/fixtures/anthropic-tool-schema-recorder.ts": "b836fab42934a2437c4261b3225f1a86b37206b2223174ca582a228679e50ffc", + "scripts/fixtures/anthropic-provider-cases.ts": "c73097643a997be405d583bbdeb09e4fc7d9dc0bfa037f59f5965949c23d638f", + "packages/ai/src/providers/anthropic.ts": "38e1ca641ad118fb0f66e927979a0533f19ea3f64e37b1778888b1093aa90a46", + "packages/ai/src/providers/tool-schema.ts": "523a0642c2c62b48d84efd9c81e4a58e83f39a217dbcc5512ff3983bdedd9edb", + "node_modules/@anthropic-ai/sdk/package.json": "fcfaedec125d8cdfa6174f2ffae129f0ad34c681cad90a2a9dc9118cd9caecfa" + }, + "cases": [ + { + "id": "collation-chars", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid\",\"models\":[{\"id\":\"synthetic-tool-schema\",\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-tool-schema", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Use a tool", + "tools": [ + { + "name": "z", + "description": "Synthetic z", + "properties": {}, + "required": [] + }, + { + "name": "y", + "description": "Synthetic y", + "properties": {}, + "required": [] + }, + { + "name": "x", + "description": "Synthetic x", + "properties": {}, + "required": [] + }, + { + "name": "w", + "description": "Synthetic w", + "properties": {}, + "required": [] + }, + { + "name": "v", + "description": "Synthetic v", + "properties": {}, + "required": [] + }, + { + "name": "u", + "description": "Synthetic u", + "properties": {}, + "required": [] + }, + { + "name": "t", + "description": "Synthetic t", + "properties": {}, + "required": [] + }, + { + "name": "s", + "description": "Synthetic s", + "properties": {}, + "required": [] + }, + { + "name": "r", + "description": "Synthetic r", + "properties": {}, + "required": [] + }, + { + "name": "q", + "description": "Synthetic q", + "properties": {}, + "required": [] + }, + { + "name": "p", + "description": "Synthetic p", + "properties": {}, + "required": [] + }, + { + "name": "o", + "description": "Synthetic o", + "properties": {}, + "required": [] + }, + { + "name": "n", + "description": "Synthetic n", + "properties": {}, + "required": [] + }, + { + "name": "m", + "description": "Synthetic m", + "properties": {}, + "required": [] + }, + { + "name": "l", + "description": "Synthetic l", + "properties": {}, + "required": [] + }, + { + "name": "k", + "description": "Synthetic k", + "properties": {}, + "required": [] + }, + { + "name": "j", + "description": "Synthetic j", + "properties": {}, + "required": [] + }, + { + "name": "i", + "description": "Synthetic i", + "properties": {}, + "required": [] + }, + { + "name": "h", + "description": "Synthetic h", + "properties": {}, + "required": [] + }, + { + "name": "g", + "description": "Synthetic g", + "properties": {}, + "required": [] + }, + { + "name": "f", + "description": "Synthetic f", + "properties": {}, + "required": [] + }, + { + "name": "e", + "description": "Synthetic e", + "properties": {}, + "required": [] + }, + { + "name": "d", + "description": "Synthetic d", + "properties": {}, + "required": [] + }, + { + "name": "c", + "description": "Synthetic c", + "properties": {}, + "required": [] + }, + { + "name": "b", + "description": "Synthetic b", + "properties": {}, + "required": [] + }, + { + "name": "a", + "description": "Synthetic a", + "properties": {}, + "required": [] + }, + { + "name": "8", + "description": "Synthetic 8", + "properties": {}, + "required": [] + }, + { + "name": "6", + "description": "Synthetic 6", + "properties": {}, + "required": [] + }, + { + "name": "4", + "description": "Synthetic 4", + "properties": {}, + "required": [] + }, + { + "name": "2", + "description": "Synthetic 2", + "properties": {}, + "required": [] + }, + { + "name": "0", + "description": "Synthetic 0", + "properties": {}, + "required": [] + }, + { + "name": "_", + "description": "Synthetic _", + "properties": {}, + "required": [] + }, + { + "name": "Z", + "description": "Synthetic Z", + "properties": {}, + "required": [] + }, + { + "name": "Y", + "description": "Synthetic Y", + "properties": {}, + "required": [] + }, + { + "name": "X", + "description": "Synthetic X", + "properties": {}, + "required": [] + }, + { + "name": "W", + "description": "Synthetic W", + "properties": {}, + "required": [] + }, + { + "name": "V", + "description": "Synthetic V", + "properties": {}, + "required": [] + }, + { + "name": "U", + "description": "Synthetic U", + "properties": {}, + "required": [] + }, + { + "name": "T", + "description": "Synthetic T", + "properties": {}, + "required": [] + }, + { + "name": "S", + "description": "Synthetic S", + "properties": {}, + "required": [] + }, + { + "name": "R", + "description": "Synthetic R", + "properties": {}, + "required": [] + }, + { + "name": "Q", + "description": "Synthetic Q", + "properties": {}, + "required": [] + }, + { + "name": "P", + "description": "Synthetic P", + "properties": {}, + "required": [] + }, + { + "name": "O", + "description": "Synthetic O", + "properties": {}, + "required": [] + }, + { + "name": "N", + "description": "Synthetic N", + "properties": {}, + "required": [] + }, + { + "name": "M", + "description": "Synthetic M", + "properties": {}, + "required": [] + }, + { + "name": "L", + "description": "Synthetic L", + "properties": {}, + "required": [] + }, + { + "name": "K", + "description": "Synthetic K", + "properties": {}, + "required": [] + }, + { + "name": "J", + "description": "Synthetic J", + "properties": {}, + "required": [] + }, + { + "name": "I", + "description": "Synthetic I", + "properties": {}, + "required": [] + }, + { + "name": "H", + "description": "Synthetic H", + "properties": {}, + "required": [] + }, + { + "name": "G", + "description": "Synthetic G", + "properties": {}, + "required": [] + }, + { + "name": "F", + "description": "Synthetic F", + "properties": {}, + "required": [] + }, + { + "name": "E", + "description": "Synthetic E", + "properties": {}, + "required": [] + }, + { + "name": "D", + "description": "Synthetic D", + "properties": {}, + "required": [] + }, + { + "name": "C", + "description": "Synthetic C", + "properties": {}, + "required": [] + }, + { + "name": "B", + "description": "Synthetic B", + "properties": {}, + "required": [] + }, + { + "name": "A", + "description": "Synthetic A", + "properties": {}, + "required": [] + }, + { + "name": "9", + "description": "Synthetic 9", + "properties": {}, + "required": [] + }, + { + "name": "7", + "description": "Synthetic 7", + "properties": {}, + "required": [] + }, + { + "name": "5", + "description": "Synthetic 5", + "properties": {}, + "required": [] + }, + { + "name": "3", + "description": "Synthetic 3", + "properties": {}, + "required": [] + }, + { + "name": "1", + "description": "Synthetic 1", + "properties": {}, + "required": [] + }, + { + "name": "-", + "description": "Synthetic -", + "properties": {}, + "required": [] + } + ] + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-tool-schema\",\"messages\":[{\"role\":\"user\",\"content\":\"Use a tool\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"tools\":[{\"name\":\"_\",\"description\":\"Synthetic _\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"-\",\"description\":\"Synthetic -\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"0\",\"description\":\"Synthetic 0\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"1\",\"description\":\"Synthetic 1\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"2\",\"description\":\"Synthetic 2\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"3\",\"description\":\"Synthetic 3\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"4\",\"description\":\"Synthetic 4\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"5\",\"description\":\"Synthetic 5\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"6\",\"description\":\"Synthetic 6\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"7\",\"description\":\"Synthetic 7\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"8\",\"description\":\"Synthetic 8\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"9\",\"description\":\"Synthetic 9\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"a\",\"description\":\"Synthetic a\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"A\",\"description\":\"Synthetic A\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"b\",\"description\":\"Synthetic b\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"B\",\"description\":\"Synthetic B\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"c\",\"description\":\"Synthetic c\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"C\",\"description\":\"Synthetic C\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"d\",\"description\":\"Synthetic d\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"D\",\"description\":\"Synthetic D\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"e\",\"description\":\"Synthetic e\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"E\",\"description\":\"Synthetic E\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"f\",\"description\":\"Synthetic f\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"F\",\"description\":\"Synthetic F\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"g\",\"description\":\"Synthetic g\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"G\",\"description\":\"Synthetic G\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"h\",\"description\":\"Synthetic h\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"H\",\"description\":\"Synthetic H\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"i\",\"description\":\"Synthetic i\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"I\",\"description\":\"Synthetic I\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"j\",\"description\":\"Synthetic j\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"J\",\"description\":\"Synthetic J\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"k\",\"description\":\"Synthetic k\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"K\",\"description\":\"Synthetic K\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"l\",\"description\":\"Synthetic l\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"L\",\"description\":\"Synthetic L\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"m\",\"description\":\"Synthetic m\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"M\",\"description\":\"Synthetic M\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"n\",\"description\":\"Synthetic n\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"N\",\"description\":\"Synthetic N\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"o\",\"description\":\"Synthetic o\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"O\",\"description\":\"Synthetic O\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"p\",\"description\":\"Synthetic p\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"P\",\"description\":\"Synthetic P\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"q\",\"description\":\"Synthetic q\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"Q\",\"description\":\"Synthetic Q\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"r\",\"description\":\"Synthetic r\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"R\",\"description\":\"Synthetic R\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"s\",\"description\":\"Synthetic s\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"S\",\"description\":\"Synthetic S\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"t\",\"description\":\"Synthetic t\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"T\",\"description\":\"Synthetic T\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"u\",\"description\":\"Synthetic u\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"U\",\"description\":\"Synthetic U\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"v\",\"description\":\"Synthetic v\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"V\",\"description\":\"Synthetic V\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"w\",\"description\":\"Synthetic w\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"W\",\"description\":\"Synthetic W\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"x\",\"description\":\"Synthetic x\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"X\",\"description\":\"Synthetic X\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"y\",\"description\":\"Synthetic y\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"Y\",\"description\":\"Synthetic Y\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"z\",\"description\":\"Synthetic z\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"Z\",\"description\":\"Synthetic Z\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-tool-schema", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "collation-names", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid\",\"models\":[{\"id\":\"synthetic-tool-schema\",\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-tool-schema", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Use a tool", + "tools": [ + { + "name": "readFile", + "description": "Synthetic readFile", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "read_file", + "description": "Synthetic read_file", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "Read", + "description": "Synthetic Read", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "read", + "description": "Synthetic read", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "read-file", + "description": "Synthetic read-file", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "read10", + "description": "Synthetic read10", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "read2", + "description": "Synthetic read2", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "readfile", + "description": "Synthetic readfile", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "a", + "description": "Synthetic a", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "A", + "description": "Synthetic A", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "a_b", + "description": "Synthetic a_b", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "a-b", + "description": "Synthetic a-b", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "a1", + "description": "Synthetic a1", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "ab", + "description": "Synthetic ab", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "aB", + "description": "Synthetic aB", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "Ab", + "description": "Synthetic Ab", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "AB", + "description": "Synthetic AB", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "b", + "description": "Synthetic b", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "_x", + "description": "Synthetic _x", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "-x", + "description": "Synthetic -x", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "9z", + "description": "Synthetic 9z", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "Z", + "description": "Synthetic Z", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "Read_", + "description": "Synthetic Read_", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "READ", + "description": "Synthetic READ", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + } + ] + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-tool-schema\",\"messages\":[{\"role\":\"user\",\"content\":\"Use a tool\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"tools\":[{\"name\":\"_x\",\"description\":\"Synthetic _x\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}},{\"name\":\"-x\",\"description\":\"Synthetic -x\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}},{\"name\":\"9z\",\"description\":\"Synthetic 9z\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}},{\"name\":\"a\",\"description\":\"Synthetic a\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}},{\"name\":\"A\",\"description\":\"Synthetic A\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}},{\"name\":\"a_b\",\"description\":\"Synthetic a_b\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}},{\"name\":\"a-b\",\"description\":\"Synthetic a-b\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}},{\"name\":\"a1\",\"description\":\"Synthetic a1\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}},{\"name\":\"ab\",\"description\":\"Synthetic ab\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}},{\"name\":\"aB\",\"description\":\"Synthetic aB\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}},{\"name\":\"Ab\",\"description\":\"Synthetic Ab\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}},{\"name\":\"AB\",\"description\":\"Synthetic AB\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}},{\"name\":\"b\",\"description\":\"Synthetic b\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}},{\"name\":\"read\",\"description\":\"Synthetic read\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}},{\"name\":\"Read\",\"description\":\"Synthetic Read\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}},{\"name\":\"READ\",\"description\":\"Synthetic READ\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}},{\"name\":\"Read_\",\"description\":\"Synthetic Read_\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}},{\"name\":\"read_file\",\"description\":\"Synthetic read_file\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}},{\"name\":\"read-file\",\"description\":\"Synthetic read-file\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}},{\"name\":\"read10\",\"description\":\"Synthetic read10\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}},{\"name\":\"read2\",\"description\":\"Synthetic read2\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}},{\"name\":\"readfile\",\"description\":\"Synthetic readfile\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}},{\"name\":\"readFile\",\"description\":\"Synthetic readFile\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}},{\"name\":\"Z\",\"description\":\"Synthetic Z\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-tool-schema", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "schema-canonical", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid\",\"models\":[{\"id\":\"synthetic-tool-schema\",\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-tool-schema", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Use a tool", + "tools": [ + { + "name": "schema", + "description": "Synthetic schema", + "properties": { + "9": { + "type": "string" + }, + "10": { + "type": "string" + }, + "4294967294": { + "type": "string" + }, + "zeta": { + "type": "object", + "required": null, + "properties": { + "b": { + "type": "integer", + "maximum": 1e+21 + }, + "a": { + "type": "number", + "minimum": 1e-7, + "multipleOf": 0.000001 + } + } + }, + "01": { + "type": "string" + }, + "4294967295": { + "type": "string" + }, + "Alpha": { + "type": "array", + "items": [ + { + "required": null, + "y": 2.5e-8, + "x": 1e+300 + }, + null, + true, + "\u0001\u001f
/\"\\" + ], + "required": [ + "y", + "x" + ] + }, + "é": { + "enum": [ + 9007199254740992, + 0.5, + -3 + ] + }, + "😀": { + "const": "emoji" + }, + "�": { + "const": "replacement" + }, + "": { + "const": "empty" + }, + "__proto__": { + "const": "own" + }, + "required": null, + "kept": null + }, + "required": [ + "zeta", + "Alpha" + ] + } + ] + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-tool-schema\",\"messages\":[{\"role\":\"user\",\"content\":\"Use a tool\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"tools\":[{\"name\":\"schema\",\"description\":\"Synthetic schema\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"9\":{\"type\":\"string\"},\"10\":{\"type\":\"string\"},\"4294967294\":{\"type\":\"string\"},\"\":{\"const\":\"empty\"},\"01\":{\"type\":\"string\"},\"4294967295\":{\"type\":\"string\"},\"Alpha\":{\"items\":[{\"x\":1e+300,\"y\":2.5e-8},null,true,\"\\u0001\\u001f
/\\\"\\\\\"],\"required\":[\"y\",\"x\"],\"type\":\"array\"},\"__proto__\":{\"const\":\"own\"},\"kept\":null,\"zeta\":{\"properties\":{\"a\":{\"minimum\":1e-7,\"multipleOf\":0.000001,\"type\":\"number\"},\"b\":{\"maximum\":1e+21,\"type\":\"integer\"}},\"type\":\"object\"},\"é\":{\"enum\":[9007199254740992,0.5,-3]},\"😀\":{\"const\":\"emoji\"},\"�\":{\"const\":\"replacement\"}},\"required\":[\"zeta\",\"Alpha\"]}}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-tool-schema", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "properties-coerced", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid\",\"models\":[{\"id\":\"synthetic-tool-schema\",\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-tool-schema", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Use a tool", + "tools": [ + { + "name": "p_string", + "description": "Synthetic p_string", + "properties": "x", + "required": [] + }, + { + "name": "p_array", + "description": "Synthetic p_array", + "properties": [], + "required": [] + }, + { + "name": "p_null", + "description": "Synthetic p_null", + "properties": null, + "required": [] + } + ] + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-tool-schema\",\"messages\":[{\"role\":\"user\",\"content\":\"Use a tool\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"tools\":[{\"name\":\"p_array\",\"description\":\"Synthetic p_array\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"p_null\",\"description\":\"Synthetic p_null\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},{\"name\":\"p_string\",\"description\":\"Synthetic p_string\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-tool-schema", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "cache-last-sorted", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid\",\"models\":[{\"id\":\"synthetic-tool-schema\",\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-tool-schema", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Use a tool", + "tools": [ + { + "name": "write", + "description": "Synthetic write", + "properties": { + "path": { + "type": "string" + } + }, + "required": [] + }, + { + "name": "read", + "description": "Synthetic read", + "properties": { + "path": { + "type": "string" + } + }, + "required": [] + } + ], + "options": { + "cacheRetention": "short" + } + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-tool-schema\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Use a tool\",\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"tools\":[{\"name\":\"read\",\"description\":\"Synthetic read\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[]}},{\"name\":\"write\",\"description\":\"Synthetic write\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[]},\"cache_control\":{\"type\":\"ephemeral\"}}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-tool-schema", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + } + ], + "schemas": [ + { + "text": "{\"v\":1.0}", + "properties": "{\"v\":1}" + }, + { + "text": "{\"v\":1E2}", + "properties": "{\"v\":100}" + }, + { + "text": "{\"v\":-0}", + "properties": "{\"v\":0}" + }, + { + "text": "{\"v\":1e400}", + "properties": "{\"v\":null}" + }, + { + "text": "{\"v\":-1e400}", + "properties": "{\"v\":null}" + }, + { + "text": "{\"v\":1e-400}", + "properties": "{\"v\":0}" + }, + { + "text": "{\"v\":5e-324}", + "properties": "{\"v\":5e-324}" + }, + { + "text": "{\"v\":1.7976931348623157e308}", + "properties": "{\"v\":1.7976931348623157e+308}" + }, + { + "text": "{\"v\":123456789012345678901234567890}", + "properties": "{\"v\":1.2345678901234568e+29}" + }, + { + "text": "{\"v\":0.1}", + "properties": "{\"v\":0.1}" + }, + { + "text": "{\"v\":0.30000000000000004}", + "properties": "{\"v\":0.30000000000000004}" + }, + { + "text": "{\"v\":1e21}", + "properties": "{\"v\":1e+21}" + }, + { + "text": "{\"v\":1e-7}", + "properties": "{\"v\":1e-7}" + }, + { + "text": "{\"v\":0.000001}", + "properties": "{\"v\":0.000001}" + }, + { + "text": "{\"v\":1.5e300}", + "properties": "{\"v\":1.5e+300}" + }, + { + "text": "{\"v\":9007199254740993}", + "properties": "{\"v\":9007199254740992}" + }, + { + "text": "{\"v\":\"\\u0001\\u001f\\u007f\\u2028/\\\"\\\\\"}", + "properties": "{\"v\":\"\\u0001\\u001f
/\\\"\\\\\"}" + }, + { + "text": "{\"v\":\"\\ud800\"}", + "properties": "{\"v\":\"\\ud800\"}" + }, + { + "text": "{\"v\":[1,\"x\",true,false,null]}", + "properties": "{\"v\":[1,\"x\",true,false,null]}" + }, + { + "text": "{ \"b\" : 1 , \"a\" : { \"d\" : null , \"required\" : null , \"c\" : [ { \"required\" : null , \"z\" : 1 , \"y\" : 2 } ] } }", + "properties": "{\"a\":{\"c\":[{\"y\":2,\"z\":1}],\"d\":null},\"b\":1}" + }, + { + "text": "{\"a\":1,\"a\":2}", + "properties": "{\"a\":2}" + }, + { + "text": "[]", + "properties": "{}" + }, + { + "text": "null", + "properties": "{}" + }, + { + "text": "5", + "properties": "{}" + }, + { + "text": "{\"zeta\":{\"type\":\"object\",\"required\":null,\"properties\":{\"b\":{\"type\":\"integer\",\"maximum\":1e21},\"a\":{\"type\":\"number\",\"minimum\":1e-7,\"multipleOf\":0.000001}}},\"10\":{\"type\":\"string\"},\"9\":{\"type\":\"string\"},\"01\":{\"type\":\"string\"},\"4294967295\":{\"type\":\"string\"},\"4294967294\":{\"type\":\"string\"},\"Alpha\":{\"type\":\"array\",\"items\":[{\"required\":null,\"y\":2.5e-8,\"x\":1e300},null,true,\"\\u0001\\u001f\\u007f\\u2028/\\\"\\\\\"],\"required\":[\"y\",\"x\"]},\"é\":{\"enum\":[9007199254740992,0.5,-3]},\"😀\":{\"const\":\"emoji\"},\"\\uFFFD\":{\"const\":\"replacement\"},\"\":{\"const\":\"empty\"},\"__proto__\":{\"const\":\"own\"},\"required\":null,\"kept\":null}", + "properties": "{\"9\":{\"type\":\"string\"},\"10\":{\"type\":\"string\"},\"4294967294\":{\"type\":\"string\"},\"\":{\"const\":\"empty\"},\"01\":{\"type\":\"string\"},\"4294967295\":{\"type\":\"string\"},\"Alpha\":{\"items\":[{\"x\":1e+300,\"y\":2.5e-8},null,true,\"\\u0001\\u001f
/\\\"\\\\\"],\"required\":[\"y\",\"x\"],\"type\":\"array\"},\"__proto__\":{\"const\":\"own\"},\"kept\":null,\"zeta\":{\"properties\":{\"a\":{\"minimum\":1e-7,\"multipleOf\":0.000001,\"type\":\"number\"},\"b\":{\"maximum\":1e+21,\"type\":\"integer\"}},\"type\":\"object\"},\"é\":{\"enum\":[9007199254740992,0.5,-3]},\"😀\":{\"const\":\"emoji\"},\"�\":{\"const\":\"replacement\"}}" + } + ] +} diff --git a/native/omk-providers/tests/fixtures/anthropic-vision.json b/native/omk-providers/tests/fixtures/anthropic-vision.json new file mode 100644 index 0000000000..609f89d955 --- /dev/null +++ b/native/omk-providers/tests/fixtures/anthropic-vision.json @@ -0,0 +1,1948 @@ +{ + "schema": "omk.anthropic.vision.v1", + "source": { + "scripts/fixtures/anthropic-vision-recorder.ts": "e0b09531466304981aa0f151c06d7a18098ad6b16f43395b6a3bc99f03ada1d4", + "scripts/fixtures/anthropic-vision-cases.ts": "a7be13aebbd4a1471d71da8b904dd0049a1b8cf62a3f078c5e4667222011a11d", + "scripts/fixtures/anthropic-provider-cases.ts": "c73097643a997be405d583bbdeb09e4fc7d9dc0bfa037f59f5965949c23d638f", + "packages/ai/src/providers/anthropic.ts": "38e1ca641ad118fb0f66e927979a0533f19ea3f64e37b1778888b1093aa90a46", + "packages/ai/src/providers/anthropic-client.ts": "6e6555d8d11e649c571060b5ee1042d6cc68c44d9f9250f99dc803fe725efd82", + "packages/ai/src/providers/anthropic-compat.ts": "a636a7caec627915d187137228a0151e77b9242bcf0c0add996cf9bed984b017", + "packages/ai/src/providers/transform-messages.ts": "f60d2e3c7db909eb9d80d6b670bf0d7fed8aa318aac026d06f4f8a625f9a5610", + "packages/ai/src/utils/sanitize-unicode.ts": "5749c2cf0819a900e6d84f66e989562bdf4f6bb5fb45958a82b2192f73448bde", + "packages/ai/src/providers/anthropic-image-guard.ts": "9ca6ebf22d2f83ca5c8b5daf73c50883f3589ff1c48ecbae6b761e40c937abd6", + "node_modules/@anthropic-ai/sdk/package.json": "fcfaedec125d8cdfa6174f2ffae129f0ad34c681cad90a2a9dc9118cd9caecfa" + }, + "projection": { + "headersExcluded": [ + "x-stainless-*", + "user-agent" + ], + "scope": "synthetic vision model user/tool images and 1900px header guard, API key, cache disabled" + }, + "cases": [ + { + "id": "png-limit", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "iVBORwAAAAAAAAAAAAAAAAAAB2wAAAds", + "mimeType": "image/png" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/png\",\"data\":\"iVBORwAAAAAAAAAAAAAAAAAAB2wAAAds\"}}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "png-wide", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "iVBORwAAAAAAAAAAAAAAAAAAB20AAAAB", + "mimeType": "image/png" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"[image omitted: 1901x1 exceeds the Anthropic 1900px dimension limit. The image was replaced to keep the request valid — ask the user to resize and re-attach it if its content is needed.]\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "png-tall", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "iVBORwAAAAAAAAAAAAAAAAAAAAEAAAdt", + "mimeType": "image/png" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"[image omitted: 1x1901 exceeds the Anthropic 1900px dimension limit. The image was replaced to keep the request valid — ask the user to resize and re-attach it if its content is needed.]\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "png-u32", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "iVBORwAAAAAAAAAAAAAAAP////8AAAAC", + "mimeType": "image/png" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"[image omitted: 4294967295x2 exceeds the Anthropic 1900px dimension limit. The image was replaced to keep the request valid — ask the user to resize and re-attach it if its content is needed.]\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "png-short", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "iVBORwAAAAAAAAAAAAAAAAAAB20AAAA=", + "mimeType": "image/png" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/png\",\"data\":\"iVBORwAAAAAAAAAAAAAAAAAAB20AAAA=\"}}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "gif-limit", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "R0lGODlhbAdsBw==", + "mimeType": "image/gif" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/gif\",\"data\":\"R0lGODlhbAdsBw==\"}}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "gif-wide", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "R0lGODlh//8BAA==", + "mimeType": "image/gif" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"[image omitted: 65535x1 exceeds the Anthropic 1900px dimension limit. The image was replaced to keep the request valid — ask the user to resize and re-attach it if its content is needed.]\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "gif-short", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "R0lGODlhbQcB", + "mimeType": "image/gif" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/gif\",\"data\":\"R0lGODlhbQcB\"}}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "jpeg-limit", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "/9j/wAAKCAdsB2wA", + "mimeType": "image/jpeg" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/jpeg\",\"data\":\"/9j/wAAKCAdsB2wA\"}}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "jpeg-wide", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "/9j/wAAKCAABB20A", + "mimeType": "image/jpeg" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"[image omitted: 1901x1 exceeds the Anthropic 1900px dimension limit. The image was replaced to keep the request valid — ask the user to resize and re-attach it if its content is needed.]\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "jpeg-app", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "/9j/4QAEAAD/wAAKCAdtAAEA", + "mimeType": "image/jpeg" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"[image omitted: 1x1901 exceeds the Anthropic 1900px dimension limit. The image was replaced to keep the request valid — ask the user to resize and re-attach it if its content is needed.]\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "jpeg-no-sof", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "/9j/4QAAAAAAAAAA", + "mimeType": "image/jpeg" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/jpeg\",\"data\":\"/9j/4QAAAAAAAAAA\"}}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "jpeg-excluded-marker", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "/9j/xAAKCAABB20A", + "mimeType": "image/jpeg" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/jpeg\",\"data\":\"/9j/xAAKCAABB20A\"}}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "jpeg-noise", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "/9gA/8AACggAAQdtAA==", + "mimeType": "image/jpeg" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"[image omitted: 1901x1 exceeds the Anthropic 1900px dimension limit. The image was replaced to keep the request valid — ask the user to resize and re-attach it if its content is needed.]\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "jpeg-short", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "/9j/wAAKCAABB20=", + "mimeType": "image/jpeg" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/jpeg\",\"data\":\"/9j/wAAKCAABB20=\"}}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "webp-x-limit", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "UklGRgAAAABXRUJQVlA4WAAAAAAAAAAAawcAawcA", + "mimeType": "image/webp" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/webp\",\"data\":\"UklGRgAAAABXRUJQVlA4WAAAAAAAAAAAawcAawcA\"}}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "webp-x-wide", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "UklGRgAAAABXRUJQVlA4WAAAAAAAAAAAbAcAAAAA", + "mimeType": "image/webp" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"[image omitted: 1901x1 exceeds the Anthropic 1900px dimension limit. The image was replaced to keep the request valid — ask the user to resize and re-attach it if its content is needed.]\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "webp-x-u24", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "UklGRgAAAABXRUJQVlA4WAAAAAAAAAAA////AAAA", + "mimeType": "image/webp" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"[image omitted: 16777216x1 exceeds the Anthropic 1900px dimension limit. The image was replaced to keep the request valid — ask the user to resize and re-attach it if its content is needed.]\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "webp-lossy-flags", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "UklGRgAAAABXRUJQVlA4IAAAAAAAAAAAAABsx2zH", + "mimeType": "image/webp" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/webp\",\"data\":\"UklGRgAAAABXRUJQVlA4IAAAAAAAAAAAAABsx2zH\"}}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "webp-l-limit", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "UklGRgAAAABXRUJQVlA4TAAAAAAAa8faAQAAAAAA", + "mimeType": "image/webp" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/webp\",\"data\":\"UklGRgAAAABXRUJQVlA4TAAAAAAAa8faAQAAAAAA\"}}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "webp-l-wide", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "UklGRgAAAABXRUJQVlA4TAAAAAAAbAcAAAAAAAAA", + "mimeType": "image/webp" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"[image omitted: 1901x1 exceeds the Anthropic 1900px dimension limit. The image was replaced to keep the request valid — ask the user to resize and re-attach it if its content is needed.]\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "webp-unknown", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "UklGRgAAAABXRUJQTk9ORQAAAAAAAAAAAAAAAAAA", + "mimeType": "image/webp" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/webp\",\"data\":\"UklGRgAAAABXRUJQTk9ORQAAAAAAAAAAAAAAAAAA\"}}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "webp-short", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "UklGRgAAAABXRUJQVlA4TAAAAAAAbAcAAAAAAAA=", + "mimeType": "image/webp" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/webp\",\"data\":\"UklGRgAAAABXRUJQVlA4TAAAAAAAbAcAAAAAAAA=\"}}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "unknown-format", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "AAAAAAAAAAAAAAAA", + "mimeType": "application/synthetic" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"application/synthetic\",\"data\":\"AAAAAAAAAAAAAAAA\"}}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "empty-data", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "", + "mimeType": "image/png" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/png\",\"data\":\"\"}}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "invalid-base64", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "!not base64!", + "mimeType": "image/png" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/png\",\"data\":\"!not base64!\"}}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "base64-whitespace", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "iVBO \nRwAA \nAAAA \nAAAA \nAAAA \nAAAA \nB20A \nAAAB \n", + "mimeType": "image/png" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"[image omitted: 1901x1 exceeds the Anthropic 1900px dimension limit. The image was replaced to keep the request valid — ask the user to resize and re-attach it if its content is needed.]\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "base64-url", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "_9j_wAAKCAABB20A", + "mimeType": "image/jpeg" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"[image omitted: 1901x1 exceeds the Anthropic 1900px dimension limit. The image was replaced to keep the request valid — ask the user to resize and re-attach it if its content is needed.]\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "base64-unpadded", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "R0lGODlhbQcBAA", + "mimeType": "image/gif" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"[image omitted: 1901x1 exceeds the Anthropic 1900px dimension limit. The image was replaced to keep the request valid — ask the user to resize and re-attach it if its content is needed.]\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "base64-padding-stop", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "R0lGODlhbQcBAA==ignored", + "mimeType": "image/gif" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"[image omitted: 1901x1 exceeds the Anthropic 1900px dimension limit. The image was replaced to keep the request valid — ask the user to resize and re-attach it if its content is needed.]\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "base64-punctuation", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "iVBO!RwAA!AAAA!AAAA!AAAA!AAAA!B20A!AAAB!", + "mimeType": "image/png" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"[image omitted: 1901x1 exceeds the Anthropic 1900px dimension limit. The image was replaced to keep the request valid — ask the user to resize and re-attach it if its content is needed.]\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "jpeg-beyond-window", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "/9j/4f//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/AAAoIAAEHbQA=", + "mimeType": "image/jpeg" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/jpeg\",\"data\":\"/9j/4f//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/AAAoIAAEHbQA=\"}}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "jpeg-window-edge", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "/9j/4f/0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/wAAKCAABB20A", + "mimeType": "image/jpeg" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"[image omitted: 1901x1 exceeds the Anthropic 1900px dimension limit. The image was replaced to keep the request valid — ask the user to resize and re-attach it if its content is needed.]\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "base64-unicode", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "한글🌏iVBORwAAAAAAAAAAAAAAAAAAB20AAAAB", + "mimeType": "image/png" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"[image omitted: 1901x1 exceeds the Anthropic 1900px dimension limit. The image was replaced to keep the request valid — ask the user to resize and re-attach it if its content is needed.]\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "mime-sniff", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "iVBORwAAAAAAAAAAAAAAAAAAB20AAAAB", + "mimeType": "image/gif" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"[image omitted: 1901x1 exceeds the Anthropic 1900px dimension limit. The image was replaced to keep the request valid — ask the user to resize and re-attach it if its content is needed.]\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "tool-only-image", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": {} + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "image", + "data": "iVBORwAAAAAAAAAAAAAAAAAAB2wAAAds", + "mimeType": "image/png" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":[{\"type\":\"text\",\"text\":\"(see attached image)\"},{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/png\",\"data\":\"iVBORwAAAAAAAAAAAAAAAAAAB2wAAAds\"}}],\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "tool-empty-text-image", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": {} + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "text", + "text": "" + }, + { + "type": "image", + "data": "iVBORwAAAAAAAAAAAAAAAAAAB2wAAAds", + "mimeType": "image/png" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":[{\"type\":\"text\",\"text\":\"\"},{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/png\",\"data\":\"iVBORwAAAAAAAAAAAAAAAAAAB2wAAAds\"}}],\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "tool-mixed", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": {} + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "text", + "text": "First 한글" + }, + { + "type": "image", + "data": "iVBORwAAAAAAAAAAAAAAAAAAB2wAAAds", + "mimeType": "image/png" + }, + { + "type": "text", + "text": "Last 🌏" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":[{\"type\":\"text\",\"text\":\"First 한글\"},{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/png\",\"data\":\"iVBORwAAAAAAAAAAAAAAAAAAB2wAAAds\"}},{\"type\":\"text\",\"text\":\"Last 🌏\"}],\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "tool-two-images", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": {} + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "image", + "data": "iVBORwAAAAAAAAAAAAAAAAAAB2wAAAds", + "mimeType": "image/png" + }, + { + "type": "image", + "data": "iVBORwAAAAAAAAAAAAAAAAAAB2wAAAds", + "mimeType": "image/png" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":[{\"type\":\"text\",\"text\":\"(see attached image)\"},{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/png\",\"data\":\"iVBORwAAAAAAAAAAAAAAAAAAB2wAAAds\"}},{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/png\",\"data\":\"iVBORwAAAAAAAAAAAAAAAAAAB2wAAAds\"}}],\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "tool-oversize-only", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": {} + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "image", + "data": "iVBORwAAAAAAAAAAAAAAAAAAB20AAAAB", + "mimeType": "image/png" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"[image omitted: 1901x1 exceeds the Anthropic 1900px dimension limit. The image was replaced to keep the request valid — ask the user to resize and re-attach it if its content is needed.]\",\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "tool-oversize-and-image", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": {} + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "image", + "data": "iVBORwAAAAAAAAAAAAAAAAAAB20AAAAB", + "mimeType": "image/png" + }, + { + "type": "image", + "data": "iVBORwAAAAAAAAAAAAAAAAAAB2wAAAds", + "mimeType": "image/png" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":[{\"type\":\"text\",\"text\":\"[image omitted: 1901x1 exceeds the Anthropic 1900px dimension limit. The image was replaced to keep the request valid — ask the user to resize and re-attach it if its content is needed.]\"},{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/png\",\"data\":\"iVBORwAAAAAAAAAAAAAAAAAAB2wAAAds\"}}],\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "tool-adjacent-oversize", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": {} + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "image", + "data": "iVBORwAAAAAAAAAAAAAAAAAAB20AAAAB", + "mimeType": "image/png" + }, + { + "type": "image", + "data": "iVBORwAAAAAAAAAAAAAAAAAAB20AAAAB", + "mimeType": "image/png" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"[image omitted: 1901x1 exceeds the Anthropic 1900px dimension limit. The image was replaced to keep the request valid — ask the user to resize and re-attach it if its content is needed.]\\n[image omitted: 1901x1 exceeds the Anthropic 1900px dimension limit. The image was replaced to keep the request valid — ask the user to resize and re-attach it if its content is needed.]\",\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "tool-empty-array", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": {} + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"\",\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "user-adjacent-images", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "image", + "data": "iVBORwAAAAAAAAAAAAAAAAAAB2wAAAds", + "mimeType": "image/png" + }, + { + "type": "image", + "data": "iVBORwAAAAAAAAAAAAAAAAAAB2wAAAds", + "mimeType": "image/png" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/png\",\"data\":\"iVBORwAAAAAAAAAAAAAAAAAAB2wAAAds\"}},{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/png\",\"data\":\"iVBORwAAAAAAAAAAAAAAAAAAB2wAAAds\"}}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "user-blank-oversize", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "" + }, + { + "type": "image", + "data": "iVBORwAAAAAAAAAAAAAAAAAAB20AAAAB", + "mimeType": "image/png" + }, + { + "type": "text", + "text": "" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"[image omitted: 1901x1 exceeds the Anthropic 1900px dimension limit. The image was replaced to keep the request valid — ask the user to resize and re-attach it if its content is needed.]\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "tool-grouped-images", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": {} + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "image", + "data": "iVBORwAAAAAAAAAAAAAAAAAAB2wAAAds", + "mimeType": "image/png" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "image", + "data": "iVBORwAAAAAAAAAAAAAAAAAAB20AAAAB", + "mimeType": "image/png" + }, + { + "type": "image", + "data": "iVBORwAAAAAAAAAAAAAAAAAAB2wAAAds", + "mimeType": "image/png" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":[{\"type\":\"text\",\"text\":\"(see attached image)\"},{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/png\",\"data\":\"iVBORwAAAAAAAAAAAAAAAAAAB2wAAAds\"}}],\"is_error\":false},{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":[{\"type\":\"text\",\"text\":\"[image omitted: 1901x1 exceeds the Anthropic 1900px dimension limit. The image was replaced to keep the request valid — ask the user to resize and re-attach it if its content is needed.]\"},{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/png\",\"data\":\"iVBORwAAAAAAAAAAAAAAAAAAB2wAAAds\"}}],\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "user-interrupts-tool", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": {} + } + ], + "stopReason": "toolUse" + }, + { + "role": "user", + "content": [ + { + "type": "image", + "data": "iVBORwAAAAAAAAAAAAAAAAAAB2wAAAds", + "mimeType": "image/png" + } + ] + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "image", + "data": "iVBORwAAAAAAAAAAAAAAAAAAB2wAAAds", + "mimeType": "image/png" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"call_1\",\"name\":\"read\",\"input\":{}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":\"No result provided\",\"is_error\":true}]},{\"role\":\"user\",\"content\":[{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/png\",\"data\":\"iVBORwAAAAAAAAAAAAAAAAAAB2wAAAds\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_1\",\"content\":[{\"type\":\"text\",\"text\":\"(see attached image)\"},{\"type\":\"image\",\"source\":{\"type\":\"base64\",\"media_type\":\"image/png\",\"data\":\"iVBORwAAAAAAAAAAAAAAAAAAB2wAAAds\"}}],\"is_error\":false}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "orphan-oversize", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "toolResult", + "toolCallId": "orphan", + "content": [ + { + "type": "image", + "data": "iVBORwAAAAAAAAAAAAAAAAAAB20AAAAB", + "mimeType": "image/png" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "failed-assistant-image", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "call_1", + "name": "read", + "arguments": {} + } + ], + "stopReason": "error" + }, + { + "role": "toolResult", + "toolCallId": "call_1", + "content": [ + { + "type": "image", + "data": "iVBORwAAAAAAAAAAAAAAAAAAB2wAAAds", + "mimeType": "image/png" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + }, + { + "id": "vision-text-array", + "input": { + "model": "synthetic-anthropic-vision", + "maxTokens": 64, + "system": "", + "user": "Continue", + "tools": [], + "history": [ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "First" + }, + { + "type": "text", + "text": "" + }, + { + "type": "text", + "text": "Last" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-key" + }, + "body": "{\"model\":\"synthetic-anthropic-vision\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"First\"},{\"type\":\"text\",\"text\":\"Last\"}]},{\"role\":\"user\",\"content\":\"Continue\"}],\"max_tokens\":64,\"stream\":true}" + } + } + ] +} diff --git a/native/omk-providers/tests/fixtures/auth.json b/native/omk-providers/tests/fixtures/auth.json new file mode 100644 index 0000000000..26709e6ee6 --- /dev/null +++ b/native/omk-providers/tests/fixtures/auth.json @@ -0,0 +1,752 @@ +{ + "schema": "omk.auth-resolution.v1", + "source": { + "scripts/fixtures/auth-recorder.ts": "254ba0e91d93929964caac7c845bd469a56a554e8886c62c09cc8969fcc302ec", + "packages/coding-agent/src/core/auth-storage.ts": "37da040edcb5be847adde012a6c2250154da61c3e1b7e402a5764387ca2bd334", + "packages/coding-agent/src/core/auth-storage-backend.ts": "a19d4add44f19dfba259cc437540903f180b4e51f9dec38d9ac0be7813b141f4", + "packages/coding-agent/src/core/resolve-config-value.ts": "94db692e381c67b4cc8344d875345ef730525e22783575cf0c7b5cfe9dc9b7ce", + "packages/ai/src/env-api-keys.ts": "c47b8b6a257a10999505267c833aa10b1c36fb4821cf4c1aca5af454b9e4ecdf" + }, + "projection": "API-key config templates and credential priority; supplied in-memory store and environment, no OAuth/commands/files/network", + "cases": [ + { + "id": "template-0", + "input": { + "config": "", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": "", + "blocked": false + } + }, + { + "id": "template-1", + "input": { + "config": "faux-key", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": "faux-key", + "blocked": false + } + }, + { + "id": "template-2", + "input": { + "config": "SYN_KEY", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": "SYN_KEY", + "blocked": false + } + }, + { + "id": "template-3", + "input": { + "config": "$SYN_KEY", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": "faux-value", + "blocked": false + } + }, + { + "id": "template-4", + "input": { + "config": "${SYN_KEY}", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": "faux-value", + "blocked": false + } + }, + { + "id": "template-5", + "input": { + "config": "prefix-$SYN_KEY/suffix", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": "prefix-faux-value/suffix", + "blocked": false + } + }, + { + "id": "template-6", + "input": { + "config": "${SYN_KEY}${SECOND}", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": "faux-valuetwo", + "blocked": false + } + }, + { + "id": "template-7", + "input": { + "config": "$SYN_KEY$SECOND", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": "faux-valuetwo", + "blocked": false + } + }, + { + "id": "template-8", + "input": { + "config": "$MISSING", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": null, + "blocked": false + } + }, + { + "id": "template-9", + "input": { + "config": "$EMPTY", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": null, + "blocked": false + } + }, + { + "id": "template-10", + "input": { + "config": "${MISSING}", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": null, + "blocked": false + } + }, + { + "id": "template-11", + "input": { + "config": "prefix-${MISSING}", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": null, + "blocked": false + } + }, + { + "id": "template-12", + "input": { + "config": "$$SYN_KEY", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": "$SYN_KEY", + "blocked": false + } + }, + { + "id": "template-13", + "input": { + "config": "$!literal", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": "!literal", + "blocked": false + } + }, + { + "id": "template-14", + "input": { + "config": "$${SYN_KEY}", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": "${SYN_KEY}", + "blocked": false + } + }, + { + "id": "template-15", + "input": { + "config": "$$$SYN_KEY", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": "$faux-value", + "blocked": false + } + }, + { + "id": "template-16", + "input": { + "config": "${bad-name}", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": "${bad-name}", + "blocked": false + } + }, + { + "id": "template-17", + "input": { + "config": "${}", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": "${}", + "blocked": false + } + }, + { + "id": "template-18", + "input": { + "config": "${SYN_KEY", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": "${SYN_KEY", + "blocked": false + } + }, + { + "id": "template-19", + "input": { + "config": "$", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": "$", + "blocked": false + } + }, + { + "id": "template-20", + "input": { + "config": "$9", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": "$9", + "blocked": false + } + }, + { + "id": "template-21", + "input": { + "config": "$-", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": "$-", + "blocked": false + } + }, + { + "id": "template-22", + "input": { + "config": "${SYN_KEY}tail", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": "faux-valuetail", + "blocked": false + } + }, + { + "id": "template-23", + "input": { + "config": "$_KEY", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": "under", + "blocked": false + } + }, + { + "id": "template-24", + "input": { + "config": "$SYN_KEY_suffix", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": null, + "blocked": false + } + }, + { + "id": "template-25", + "input": { + "config": "$SYN_KEY.tail", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": "faux-value.tail", + "blocked": false + } + }, + { + "id": "template-26", + "input": { + "config": "한글-$SYN_KEY-🙂", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": "한글-faux-value-🙂", + "blocked": false + } + }, + { + "id": "template-27", + "input": { + "config": "line\n$SYN_KEY\r\n", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": "line\nfaux-value\r\n", + "blocked": false + } + }, + { + "id": "template-28", + "input": { + "config": "${SYN_KEY}${bad-name}", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": "faux-value${bad-name}", + "blocked": false + } + }, + { + "id": "template-29", + "input": { + "config": "$é", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": "$é", + "blocked": false + } + }, + { + "id": "template-30", + "input": { + "config": "${é}", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": "${é}", + "blocked": false + } + }, + { + "id": "template-31", + "input": { + "config": "$!$SYN_KEY", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": "!faux-value", + "blocked": false + } + }, + { + "id": "template-32", + "input": { + "config": "\u0000$SYN_KEY", + "env": { + "SYN_KEY": "faux-value", + "SECOND": "two", + "_KEY": "under", + "EMPTY": "" + } + }, + "expected": { + "key": "\u0000faux-value", + "blocked": false + } + }, + { + "id": "missing", + "input": {}, + "expected": { + "key": null, + "blocked": false + } + }, + { + "id": "environment", + "input": { + "environment": "faux-environment" + }, + "expected": { + "key": "faux-environment", + "blocked": false + } + }, + { + "id": "fallback", + "input": { + "fallback": "faux-fallback" + }, + "expected": { + "key": "faux-fallback", + "blocked": false + } + }, + { + "id": "environment-before-fallback", + "input": { + "environment": "faux-environment", + "fallback": "faux-fallback" + }, + "expected": { + "key": "faux-environment", + "blocked": false + } + }, + { + "id": "stored-before-environment", + "input": { + "store": "{\"anthropic\":{\"type\":\"api_key\",\"key\":\"faux-stored\"}}", + "environment": "faux-environment" + }, + "expected": { + "key": "faux-stored", + "blocked": false + } + }, + { + "id": "runtime-before-stored", + "input": { + "runtime": "faux-runtime", + "store": "{\"anthropic\":{\"type\":\"api_key\",\"key\":\"faux-stored\"}}" + }, + "expected": { + "key": "faux-runtime", + "blocked": false + } + }, + { + "id": "runtime-not-interpolated", + "input": { + "runtime": "$SYN_KEY", + "env": { + "SYN_KEY": "faux-value" + } + }, + "expected": { + "key": "$SYN_KEY", + "blocked": false + } + }, + { + "id": "runtime-empty-ignored", + "input": { + "runtime": "", + "environment": "faux-environment" + }, + "expected": { + "key": "faux-environment", + "blocked": false + } + }, + { + "id": "stored-empty-stops-fallback", + "input": { + "store": "{\"anthropic\":{\"type\":\"api_key\",\"key\":\"\"}}", + "environment": "faux-environment" + }, + "expected": { + "key": "", + "blocked": false + } + }, + { + "id": "stored-template", + "input": { + "store": "{\"anthropic\":{\"type\":\"api_key\",\"key\":\"key-${SYN_KEY}\"}}", + "env": { + "SYN_KEY": "faux-value" + } + }, + "expected": { + "key": "key-faux-value", + "blocked": false + } + }, + { + "id": "stored-unresolved-no-fallback", + "input": { + "store": "{\"anthropic\":{\"type\":\"api_key\",\"key\":\"$MISSING\"}}", + "environment": "faux-environment", + "fallback": "faux-fallback" + }, + "expected": { + "key": null, + "blocked": false + } + }, + { + "id": "fallback-disabled", + "input": { + "fallback": "faux-fallback", + "includeFallback": false + }, + "expected": { + "key": null, + "blocked": false + } + }, + { + "id": "fallback-empty", + "input": { + "fallback": "" + }, + "expected": { + "key": "", + "blocked": false + } + }, + { + "id": "fallback-template", + "input": { + "fallback": "${SYN_KEY}", + "env": { + "SYN_KEY": "faux-value" + } + }, + "expected": { + "key": "faux-value", + "blocked": false + } + }, + { + "id": "unreadable-no-substitution", + "input": { + "loadError": true, + "environment": "faux-environment", + "fallback": "faux-fallback" + }, + "expected": { + "key": null, + "blocked": true + } + }, + { + "id": "runtime-over-unreadable", + "input": { + "loadError": true, + "runtime": "faux-runtime" + }, + "expected": { + "key": "faux-runtime", + "blocked": false + } + }, + { + "id": "malformed-no-substitution", + "input": { + "store": "{broken", + "environment": "faux-environment" + }, + "expected": { + "key": null, + "blocked": true + } + }, + { + "id": "runtime-over-malformed", + "input": { + "store": "{broken", + "runtime": "faux-runtime" + }, + "expected": { + "key": "faux-runtime", + "blocked": false + } + }, + { + "id": "other-provider-ignored", + "input": { + "store": "{\"other\":{\"type\":\"api_key\",\"key\":\"faux-other\"}}", + "environment": "faux-environment" + }, + "expected": { + "key": "faux-environment", + "blocked": false + } + } + ] +} diff --git a/native/omk-providers/tests/fixtures/catalog.json b/native/omk-providers/tests/fixtures/catalog.json new file mode 100644 index 0000000000..349ab6ca3e --- /dev/null +++ b/native/omk-providers/tests/fixtures/catalog.json @@ -0,0 +1,7986 @@ +{ + "schema": "omk.model-overlay.v1", + "source": { + "scripts/fixtures/catalog-recorder.ts": "9f4bdd03305282699b57fefaef9811eea8a7dfdf639d91552dbd54131e74b1ee", + "packages/ai/src/models.generated.ts": "aea6840952e64f7a2a4f70ee80d457a3bbcd281e78746b213ef94fbaf2595a4e", + "packages/ai/src/models.ts": "5ba2350fc544a9b2e281f714d40e2eeaea179ffb0e1e0aaad246cb09cfb2b333", + "packages/ai/src/providers/grok-thinking.ts": "f4bc6166052f27deca753c134074125d36b183af0b66bd8b77fc6990fdd1fca2", + "packages/coding-agent/src/core/model-registry.ts": "53fba00330a076d14b020ed242903387e5b16683ab39bb5048dcf7fc8b27b7ff", + "packages/coding-agent/src/core/model-registry-schema.ts": "cc63f02dddf2a7835ed0971533e8b60e6a337bb0646cffeda321cd24a199ac4b", + "packages/coding-agent/src/utils/json.ts": "7ee95ee422abcc3610033e27d1e1da08ebadac0502b6326a1540b64843a084dd" + }, + "cases": [ + { + "id": "default", + "overlay": "{}", + "expected": { + "invalid": true, + "total": 2245, + "models": [ + { + "id": "claude-fable-5", + "name": "Claude Fable 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-1", + "name": "Claude Fable 5.1", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 0.25, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-2", + "name": "Claude Fable 5.2", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 8, + "output": 40, + "cacheRead": 0.2, + "cacheWrite": 10 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-haiku-4-5", + "name": "Claude Haiku 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-haiku-4-5-20251001", + "name": "Claude Haiku 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5", + "name": "Claude Opus 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5-20251101", + "name": "Claude Opus 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-6", + "name": "Claude Opus 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-7", + "name": "Claude Opus 4.7", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-8", + "name": "Claude Opus 4.8", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5", + "name": "Claude Opus 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-5", + "name": "Claude Opus 5.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.2, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-4-5", + "name": "Claude Sonnet 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-5-20250929", + "name": "Claude Sonnet 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5", + "name": "Claude Sonnet 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + } + ], + "available": [ + [ + "anthropic", + "claude-fable-5" + ], + [ + "anthropic", + "claude-fable-5-1" + ], + [ + "anthropic", + "claude-fable-5-2" + ], + [ + "anthropic", + "claude-haiku-4-5" + ], + [ + "anthropic", + "claude-haiku-4-5-20251001" + ], + [ + "anthropic", + "claude-opus-4-5" + ], + [ + "anthropic", + "claude-opus-4-5-20251101" + ], + [ + "anthropic", + "claude-opus-4-6" + ], + [ + "anthropic", + "claude-opus-4-7" + ], + [ + "anthropic", + "claude-opus-4-8" + ], + [ + "anthropic", + "claude-opus-5" + ], + [ + "anthropic", + "claude-opus-5-5" + ], + [ + "anthropic", + "claude-sonnet-4-5" + ], + [ + "anthropic", + "claude-sonnet-4-5-20250929" + ], + [ + "anthropic", + "claude-sonnet-4-6" + ], + [ + "anthropic", + "claude-sonnet-5" + ] + ] + } + }, + { + "id": "custom-defaults", + "overlay": "{\"providers\":{\"synthetic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v2/\",\"apiKey\":\"faux-key\",\"models\":[{\"id\":\"one\"},{\"id\":\"two\",\"maxTokens\":42,\"input\":[\"text\",\"image\"]}]}}}", + "expected": { + "invalid": false, + "total": 2247, + "models": [ + { + "id": "claude-fable-5", + "name": "Claude Fable 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-1", + "name": "Claude Fable 5.1", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 0.25, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-2", + "name": "Claude Fable 5.2", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 8, + "output": 40, + "cacheRead": 0.2, + "cacheWrite": 10 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-haiku-4-5", + "name": "Claude Haiku 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-haiku-4-5-20251001", + "name": "Claude Haiku 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5", + "name": "Claude Opus 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5-20251101", + "name": "Claude Opus 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-6", + "name": "Claude Opus 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-7", + "name": "Claude Opus 4.7", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-8", + "name": "Claude Opus 4.8", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5", + "name": "Claude Opus 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-5", + "name": "Claude Opus 5.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.2, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-4-5", + "name": "Claude Sonnet 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-5-20250929", + "name": "Claude Sonnet 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5", + "name": "Claude Sonnet 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "one", + "name": "one", + "api": "anthropic-messages", + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "two", + "name": "two", + "api": "anthropic-messages", + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid", + "reasoning": false, + "input": [ + "text", + "image" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 42 + } + ], + "available": [ + [ + "anthropic", + "claude-fable-5" + ], + [ + "anthropic", + "claude-fable-5-1" + ], + [ + "anthropic", + "claude-fable-5-2" + ], + [ + "anthropic", + "claude-haiku-4-5" + ], + [ + "anthropic", + "claude-haiku-4-5-20251001" + ], + [ + "anthropic", + "claude-opus-4-5" + ], + [ + "anthropic", + "claude-opus-4-5-20251101" + ], + [ + "anthropic", + "claude-opus-4-6" + ], + [ + "anthropic", + "claude-opus-4-7" + ], + [ + "anthropic", + "claude-opus-4-8" + ], + [ + "anthropic", + "claude-opus-5" + ], + [ + "anthropic", + "claude-opus-5-5" + ], + [ + "anthropic", + "claude-sonnet-4-5" + ], + [ + "anthropic", + "claude-sonnet-4-5-20250929" + ], + [ + "anthropic", + "claude-sonnet-4-6" + ], + [ + "anthropic", + "claude-sonnet-5" + ], + [ + "synthetic", + "one" + ], + [ + "synthetic", + "two" + ] + ] + } + }, + { + "id": "builtin-inheritance", + "overlay": "{\"providers\":{\"anthropic\":{\"models\":[{\"id\":\"synthetic-new\"}]}}}", + "expected": { + "invalid": false, + "total": 2246, + "models": [ + { + "id": "claude-fable-5", + "name": "Claude Fable 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-1", + "name": "Claude Fable 5.1", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 0.25, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-2", + "name": "Claude Fable 5.2", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 8, + "output": 40, + "cacheRead": 0.2, + "cacheWrite": 10 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-haiku-4-5", + "name": "Claude Haiku 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-haiku-4-5-20251001", + "name": "Claude Haiku 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5", + "name": "Claude Opus 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5-20251101", + "name": "Claude Opus 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-6", + "name": "Claude Opus 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-7", + "name": "Claude Opus 4.7", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-8", + "name": "Claude Opus 4.8", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5", + "name": "Claude Opus 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-5", + "name": "Claude Opus 5.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.2, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-4-5", + "name": "Claude Sonnet 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-5-20250929", + "name": "Claude Sonnet 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5", + "name": "Claude Sonnet 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "synthetic-new", + "name": "synthetic-new", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + } + ], + "available": [ + [ + "anthropic", + "claude-fable-5" + ], + [ + "anthropic", + "claude-fable-5-1" + ], + [ + "anthropic", + "claude-fable-5-2" + ], + [ + "anthropic", + "claude-haiku-4-5" + ], + [ + "anthropic", + "claude-haiku-4-5-20251001" + ], + [ + "anthropic", + "claude-opus-4-5" + ], + [ + "anthropic", + "claude-opus-4-5-20251101" + ], + [ + "anthropic", + "claude-opus-4-6" + ], + [ + "anthropic", + "claude-opus-4-7" + ], + [ + "anthropic", + "claude-opus-4-8" + ], + [ + "anthropic", + "claude-opus-5" + ], + [ + "anthropic", + "claude-opus-5-5" + ], + [ + "anthropic", + "claude-sonnet-4-5" + ], + [ + "anthropic", + "claude-sonnet-4-5-20250929" + ], + [ + "anthropic", + "claude-sonnet-4-6" + ], + [ + "anthropic", + "claude-sonnet-5" + ], + [ + "anthropic", + "synthetic-new" + ] + ] + } + }, + { + "id": "provider-overrides", + "overlay": "{\"providers\":{\"anthropic\":{\"baseUrl\":\"https://synthetic.invalid/route/V12/\",\"compat\":{\"supportsEagerToolInputStreaming\":false}}}}", + "expected": { + "invalid": false, + "total": 2245, + "models": [ + { + "id": "claude-fable-5", + "name": "Claude Fable 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid/route", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false, + "supportsEagerToolInputStreaming": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-1", + "name": "Claude Fable 5.1", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid/route", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false, + "supportsEagerToolInputStreaming": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 0.25, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-2", + "name": "Claude Fable 5.2", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid/route", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false, + "supportsEagerToolInputStreaming": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 8, + "output": 40, + "cacheRead": 0.2, + "cacheWrite": 10 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-haiku-4-5", + "name": "Claude Haiku 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid/route", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000, + "compat": { + "supportsEagerToolInputStreaming": false + } + }, + { + "id": "claude-haiku-4-5-20251001", + "name": "Claude Haiku 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid/route", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000, + "compat": { + "supportsEagerToolInputStreaming": false + } + }, + { + "id": "claude-opus-4-5", + "name": "Claude Opus 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid/route", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000, + "compat": { + "supportsEagerToolInputStreaming": false + } + }, + { + "id": "claude-opus-4-5-20251101", + "name": "Claude Opus 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid/route", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000, + "compat": { + "supportsEagerToolInputStreaming": false + } + }, + { + "id": "claude-opus-4-6", + "name": "Claude Opus 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid/route", + "compat": { + "forceAdaptiveThinking": true, + "supportsEagerToolInputStreaming": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-7", + "name": "Claude Opus 4.7", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid/route", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsEagerToolInputStreaming": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-8", + "name": "Claude Opus 4.8", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid/route", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsEagerToolInputStreaming": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5", + "name": "Claude Opus 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid/route", + "compat": { + "forceAdaptiveThinking": true, + "supportsEagerToolInputStreaming": false + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-5", + "name": "Claude Opus 5.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid/route", + "compat": { + "forceAdaptiveThinking": true, + "supportsDisabledThinking": false, + "supportsEagerToolInputStreaming": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.2, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-4-5", + "name": "Claude Sonnet 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid/route", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000, + "compat": { + "supportsEagerToolInputStreaming": false + } + }, + { + "id": "claude-sonnet-4-5-20250929", + "name": "Claude Sonnet 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid/route", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000, + "compat": { + "supportsEagerToolInputStreaming": false + } + }, + { + "id": "claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid/route", + "compat": { + "forceAdaptiveThinking": true, + "supportsEagerToolInputStreaming": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5", + "name": "Claude Sonnet 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid/route", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsEagerToolInputStreaming": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + } + ], + "available": [ + [ + "anthropic", + "claude-fable-5" + ], + [ + "anthropic", + "claude-fable-5-1" + ], + [ + "anthropic", + "claude-fable-5-2" + ], + [ + "anthropic", + "claude-haiku-4-5" + ], + [ + "anthropic", + "claude-haiku-4-5-20251001" + ], + [ + "anthropic", + "claude-opus-4-5" + ], + [ + "anthropic", + "claude-opus-4-5-20251101" + ], + [ + "anthropic", + "claude-opus-4-6" + ], + [ + "anthropic", + "claude-opus-4-7" + ], + [ + "anthropic", + "claude-opus-4-8" + ], + [ + "anthropic", + "claude-opus-5" + ], + [ + "anthropic", + "claude-opus-5-5" + ], + [ + "anthropic", + "claude-sonnet-4-5" + ], + [ + "anthropic", + "claude-sonnet-4-5-20250929" + ], + [ + "anthropic", + "claude-sonnet-4-6" + ], + [ + "anthropic", + "claude-sonnet-5" + ] + ] + } + }, + { + "id": "partial-model-override", + "overlay": "{\"providers\":{\"anthropic\":{\"modelOverrides\":{\"claude-fable-5\":{\"name\":\"Synthetic\",\"cost\":{\"output\":7},\"reasoning\":false,\"thinkingLevelMap\":{\"off\":null},\"input\":[\"text\"],\"maxTokens\":32}}}}}", + "expected": { + "invalid": false, + "total": 2245, + "models": [ + { + "id": "claude-fable-5", + "name": "Synthetic", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": false, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text" + ], + "cost": { + "input": 10, + "output": 7, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 32 + }, + { + "id": "claude-fable-5-1", + "name": "Claude Fable 5.1", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 0.25, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-2", + "name": "Claude Fable 5.2", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 8, + "output": 40, + "cacheRead": 0.2, + "cacheWrite": 10 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-haiku-4-5", + "name": "Claude Haiku 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-haiku-4-5-20251001", + "name": "Claude Haiku 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5", + "name": "Claude Opus 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5-20251101", + "name": "Claude Opus 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-6", + "name": "Claude Opus 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-7", + "name": "Claude Opus 4.7", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-8", + "name": "Claude Opus 4.8", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5", + "name": "Claude Opus 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-5", + "name": "Claude Opus 5.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.2, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-4-5", + "name": "Claude Sonnet 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-5-20250929", + "name": "Claude Sonnet 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5", + "name": "Claude Sonnet 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + } + ], + "available": [ + [ + "anthropic", + "claude-fable-5" + ], + [ + "anthropic", + "claude-fable-5-1" + ], + [ + "anthropic", + "claude-fable-5-2" + ], + [ + "anthropic", + "claude-haiku-4-5" + ], + [ + "anthropic", + "claude-haiku-4-5-20251001" + ], + [ + "anthropic", + "claude-opus-4-5" + ], + [ + "anthropic", + "claude-opus-4-5-20251101" + ], + [ + "anthropic", + "claude-opus-4-6" + ], + [ + "anthropic", + "claude-opus-4-7" + ], + [ + "anthropic", + "claude-opus-4-8" + ], + [ + "anthropic", + "claude-opus-5" + ], + [ + "anthropic", + "claude-opus-5-5" + ], + [ + "anthropic", + "claude-sonnet-4-5" + ], + [ + "anthropic", + "claude-sonnet-4-5-20250929" + ], + [ + "anthropic", + "claude-sonnet-4-6" + ], + [ + "anthropic", + "claude-sonnet-5" + ] + ] + } + }, + { + "id": "custom-replaces-builtin", + "overlay": "{\"providers\":{\"anthropic\":{\"models\":[{\"id\":\"claude-fable-5\",\"name\":\"Replacement\"}]}}}", + "expected": { + "invalid": false, + "total": 2245, + "models": [ + { + "id": "claude-fable-5", + "name": "Replacement", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + }, + { + "id": "claude-fable-5-1", + "name": "Claude Fable 5.1", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 0.25, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-2", + "name": "Claude Fable 5.2", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 8, + "output": 40, + "cacheRead": 0.2, + "cacheWrite": 10 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-haiku-4-5", + "name": "Claude Haiku 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-haiku-4-5-20251001", + "name": "Claude Haiku 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5", + "name": "Claude Opus 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5-20251101", + "name": "Claude Opus 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-6", + "name": "Claude Opus 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-7", + "name": "Claude Opus 4.7", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-8", + "name": "Claude Opus 4.8", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5", + "name": "Claude Opus 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-5", + "name": "Claude Opus 5.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.2, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-4-5", + "name": "Claude Sonnet 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-5-20250929", + "name": "Claude Sonnet 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5", + "name": "Claude Sonnet 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + } + ], + "available": [ + [ + "anthropic", + "claude-fable-5" + ], + [ + "anthropic", + "claude-fable-5-1" + ], + [ + "anthropic", + "claude-fable-5-2" + ], + [ + "anthropic", + "claude-haiku-4-5" + ], + [ + "anthropic", + "claude-haiku-4-5-20251001" + ], + [ + "anthropic", + "claude-opus-4-5" + ], + [ + "anthropic", + "claude-opus-4-5-20251101" + ], + [ + "anthropic", + "claude-opus-4-6" + ], + [ + "anthropic", + "claude-opus-4-7" + ], + [ + "anthropic", + "claude-opus-4-8" + ], + [ + "anthropic", + "claude-opus-5" + ], + [ + "anthropic", + "claude-opus-5-5" + ], + [ + "anthropic", + "claude-sonnet-4-5" + ], + [ + "anthropic", + "claude-sonnet-4-5-20250929" + ], + [ + "anthropic", + "claude-sonnet-4-6" + ], + [ + "anthropic", + "claude-sonnet-5" + ] + ] + } + }, + { + "id": "duplicate-last-wins", + "overlay": "{\"providers\":{\"synthetic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid\",\"apiKey\":\"faux-key\",\"models\":[{\"id\":\"one\",\"name\":\"First\"},{\"id\":\"one\",\"name\":\"Last\"}]}}}", + "expected": { + "invalid": false, + "total": 2246, + "models": [ + { + "id": "claude-fable-5", + "name": "Claude Fable 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-1", + "name": "Claude Fable 5.1", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 0.25, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-2", + "name": "Claude Fable 5.2", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 8, + "output": 40, + "cacheRead": 0.2, + "cacheWrite": 10 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-haiku-4-5", + "name": "Claude Haiku 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-haiku-4-5-20251001", + "name": "Claude Haiku 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5", + "name": "Claude Opus 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5-20251101", + "name": "Claude Opus 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-6", + "name": "Claude Opus 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-7", + "name": "Claude Opus 4.7", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-8", + "name": "Claude Opus 4.8", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5", + "name": "Claude Opus 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-5", + "name": "Claude Opus 5.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.2, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-4-5", + "name": "Claude Sonnet 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-5-20250929", + "name": "Claude Sonnet 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5", + "name": "Claude Sonnet 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "one", + "name": "Last", + "api": "anthropic-messages", + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + } + ], + "available": [ + [ + "anthropic", + "claude-fable-5" + ], + [ + "anthropic", + "claude-fable-5-1" + ], + [ + "anthropic", + "claude-fable-5-2" + ], + [ + "anthropic", + "claude-haiku-4-5" + ], + [ + "anthropic", + "claude-haiku-4-5-20251001" + ], + [ + "anthropic", + "claude-opus-4-5" + ], + [ + "anthropic", + "claude-opus-4-5-20251101" + ], + [ + "anthropic", + "claude-opus-4-6" + ], + [ + "anthropic", + "claude-opus-4-7" + ], + [ + "anthropic", + "claude-opus-4-8" + ], + [ + "anthropic", + "claude-opus-5" + ], + [ + "anthropic", + "claude-opus-5-5" + ], + [ + "anthropic", + "claude-sonnet-4-5" + ], + [ + "anthropic", + "claude-sonnet-4-5-20250929" + ], + [ + "anthropic", + "claude-sonnet-4-6" + ], + [ + "anthropic", + "claude-sonnet-5" + ], + [ + "synthetic", + "one" + ] + ] + } + }, + { + "id": "header-precedence", + "overlay": "{\"providers\":{\"anthropic\":{\"headers\":{\"x-test\":\"provider\",\"x-extra\":\"literal\"},\"modelOverrides\":{\"claude-fable-5\":{\"headers\":{\"x-test\":\"model\"}}}}}}", + "expected": { + "invalid": false, + "total": 2245, + "models": [ + { + "id": "claude-fable-5", + "name": "Claude Fable 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-1", + "name": "Claude Fable 5.1", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 0.25, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-2", + "name": "Claude Fable 5.2", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 8, + "output": 40, + "cacheRead": 0.2, + "cacheWrite": 10 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-haiku-4-5", + "name": "Claude Haiku 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-haiku-4-5-20251001", + "name": "Claude Haiku 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5", + "name": "Claude Opus 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5-20251101", + "name": "Claude Opus 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-6", + "name": "Claude Opus 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-7", + "name": "Claude Opus 4.7", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-8", + "name": "Claude Opus 4.8", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5", + "name": "Claude Opus 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-5", + "name": "Claude Opus 5.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.2, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-4-5", + "name": "Claude Sonnet 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-5-20250929", + "name": "Claude Sonnet 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5", + "name": "Claude Sonnet 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + } + ], + "available": [ + [ + "anthropic", + "claude-fable-5" + ], + [ + "anthropic", + "claude-fable-5-1" + ], + [ + "anthropic", + "claude-fable-5-2" + ], + [ + "anthropic", + "claude-haiku-4-5" + ], + [ + "anthropic", + "claude-haiku-4-5-20251001" + ], + [ + "anthropic", + "claude-opus-4-5" + ], + [ + "anthropic", + "claude-opus-4-5-20251101" + ], + [ + "anthropic", + "claude-opus-4-6" + ], + [ + "anthropic", + "claude-opus-4-7" + ], + [ + "anthropic", + "claude-opus-4-8" + ], + [ + "anthropic", + "claude-opus-5" + ], + [ + "anthropic", + "claude-opus-5-5" + ], + [ + "anthropic", + "claude-sonnet-4-5" + ], + [ + "anthropic", + "claude-sonnet-4-5-20250929" + ], + [ + "anthropic", + "claude-sonnet-4-6" + ], + [ + "anthropic", + "claude-sonnet-5" + ] + ] + } + }, + { + "id": "visibility", + "overlay": "{\"providers\":{},\"visibility\":{\"providers\":[\"anthropic\"],\"models\":{\"anthropic\":[\"claude-fable-5\"]}}}", + "expected": { + "invalid": false, + "total": 2245, + "models": [ + { + "id": "claude-fable-5", + "name": "Claude Fable 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-1", + "name": "Claude Fable 5.1", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 0.25, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-2", + "name": "Claude Fable 5.2", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 8, + "output": 40, + "cacheRead": 0.2, + "cacheWrite": 10 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-haiku-4-5", + "name": "Claude Haiku 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-haiku-4-5-20251001", + "name": "Claude Haiku 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5", + "name": "Claude Opus 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5-20251101", + "name": "Claude Opus 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-6", + "name": "Claude Opus 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-7", + "name": "Claude Opus 4.7", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-8", + "name": "Claude Opus 4.8", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5", + "name": "Claude Opus 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-5", + "name": "Claude Opus 5.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.2, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-4-5", + "name": "Claude Sonnet 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-5-20250929", + "name": "Claude Sonnet 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5", + "name": "Claude Sonnet 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + } + ], + "available": [ + [ + "anthropic", + "claude-fable-5" + ] + ] + } + }, + { + "id": "comments-trailing", + "overlay": "{// line\n\"providers\":{\"anthropic\":{\"baseUrl\":\"https://synthetic.invalid/v1\",},},}", + "expected": { + "invalid": false, + "total": 2245, + "models": [ + { + "id": "claude-fable-5", + "name": "Claude Fable 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-1", + "name": "Claude Fable 5.1", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 0.25, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-2", + "name": "Claude Fable 5.2", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 8, + "output": 40, + "cacheRead": 0.2, + "cacheWrite": 10 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-haiku-4-5", + "name": "Claude Haiku 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-haiku-4-5-20251001", + "name": "Claude Haiku 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5", + "name": "Claude Opus 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5-20251101", + "name": "Claude Opus 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-6", + "name": "Claude Opus 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-7", + "name": "Claude Opus 4.7", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-8", + "name": "Claude Opus 4.8", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5", + "name": "Claude Opus 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-5", + "name": "Claude Opus 5.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid", + "compat": { + "forceAdaptiveThinking": true, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.2, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-4-5", + "name": "Claude Sonnet 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-5-20250929", + "name": "Claude Sonnet 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5", + "name": "Claude Sonnet 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://synthetic.invalid", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + } + ], + "available": [ + [ + "anthropic", + "claude-fable-5" + ], + [ + "anthropic", + "claude-fable-5-1" + ], + [ + "anthropic", + "claude-fable-5-2" + ], + [ + "anthropic", + "claude-haiku-4-5" + ], + [ + "anthropic", + "claude-haiku-4-5-20251001" + ], + [ + "anthropic", + "claude-opus-4-5" + ], + [ + "anthropic", + "claude-opus-4-5-20251101" + ], + [ + "anthropic", + "claude-opus-4-6" + ], + [ + "anthropic", + "claude-opus-4-7" + ], + [ + "anthropic", + "claude-opus-4-8" + ], + [ + "anthropic", + "claude-opus-5" + ], + [ + "anthropic", + "claude-opus-5-5" + ], + [ + "anthropic", + "claude-sonnet-4-5" + ], + [ + "anthropic", + "claude-sonnet-4-5-20250929" + ], + [ + "anthropic", + "claude-sonnet-4-6" + ], + [ + "anthropic", + "claude-sonnet-5" + ] + ] + } + }, + { + "id": "non-anthropic-url", + "overlay": "{\"providers\":{\"synthetic\":{\"api\":\"openai-completions\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-key\",\"models\":[{\"id\":\"one\"}]}}}", + "expected": { + "invalid": false, + "total": 2246, + "models": [ + { + "id": "claude-fable-5", + "name": "Claude Fable 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-1", + "name": "Claude Fable 5.1", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 0.25, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-2", + "name": "Claude Fable 5.2", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 8, + "output": 40, + "cacheRead": 0.2, + "cacheWrite": 10 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-haiku-4-5", + "name": "Claude Haiku 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-haiku-4-5-20251001", + "name": "Claude Haiku 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5", + "name": "Claude Opus 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5-20251101", + "name": "Claude Opus 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-6", + "name": "Claude Opus 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-7", + "name": "Claude Opus 4.7", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-8", + "name": "Claude Opus 4.8", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5", + "name": "Claude Opus 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-5", + "name": "Claude Opus 5.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.2, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-4-5", + "name": "Claude Sonnet 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-5-20250929", + "name": "Claude Sonnet 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5", + "name": "Claude Sonnet 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "one", + "name": "one", + "api": "openai-completions", + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1/", + "reasoning": false, + "input": [ + "text" + ], + "cost": { + "input": 0, + "output": 0, + "cacheRead": 0, + "cacheWrite": 0 + }, + "contextWindow": 128000, + "maxTokens": 16384 + } + ], + "available": [ + [ + "anthropic", + "claude-fable-5" + ], + [ + "anthropic", + "claude-fable-5-1" + ], + [ + "anthropic", + "claude-fable-5-2" + ], + [ + "anthropic", + "claude-haiku-4-5" + ], + [ + "anthropic", + "claude-haiku-4-5-20251001" + ], + [ + "anthropic", + "claude-opus-4-5" + ], + [ + "anthropic", + "claude-opus-4-5-20251101" + ], + [ + "anthropic", + "claude-opus-4-6" + ], + [ + "anthropic", + "claude-opus-4-7" + ], + [ + "anthropic", + "claude-opus-4-8" + ], + [ + "anthropic", + "claude-opus-5" + ], + [ + "anthropic", + "claude-opus-5-5" + ], + [ + "anthropic", + "claude-sonnet-4-5" + ], + [ + "anthropic", + "claude-sonnet-4-5-20250929" + ], + [ + "anthropic", + "claude-sonnet-4-6" + ], + [ + "anthropic", + "claude-sonnet-5" + ], + [ + "synthetic", + "one" + ] + ] + } + }, + { + "id": "retired", + "overlay": "{\"providers\":{\"grok-oauth-proxy\":{\"baseUrl\":\"https://synthetic.invalid\",\"models\":[{\"id\":\"old\"}]}}}", + "expected": { + "invalid": false, + "total": 2245, + "models": [ + { + "id": "claude-fable-5", + "name": "Claude Fable 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-1", + "name": "Claude Fable 5.1", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 0.25, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-2", + "name": "Claude Fable 5.2", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 8, + "output": 40, + "cacheRead": 0.2, + "cacheWrite": 10 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-haiku-4-5", + "name": "Claude Haiku 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-haiku-4-5-20251001", + "name": "Claude Haiku 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5", + "name": "Claude Opus 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5-20251101", + "name": "Claude Opus 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-6", + "name": "Claude Opus 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-7", + "name": "Claude Opus 4.7", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-8", + "name": "Claude Opus 4.8", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5", + "name": "Claude Opus 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-5", + "name": "Claude Opus 5.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.2, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-4-5", + "name": "Claude Sonnet 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-5-20250929", + "name": "Claude Sonnet 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5", + "name": "Claude Sonnet 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + } + ], + "available": [ + [ + "anthropic", + "claude-fable-5" + ], + [ + "anthropic", + "claude-fable-5-1" + ], + [ + "anthropic", + "claude-fable-5-2" + ], + [ + "anthropic", + "claude-haiku-4-5" + ], + [ + "anthropic", + "claude-haiku-4-5-20251001" + ], + [ + "anthropic", + "claude-opus-4-5" + ], + [ + "anthropic", + "claude-opus-4-5-20251101" + ], + [ + "anthropic", + "claude-opus-4-6" + ], + [ + "anthropic", + "claude-opus-4-7" + ], + [ + "anthropic", + "claude-opus-4-8" + ], + [ + "anthropic", + "claude-opus-5" + ], + [ + "anthropic", + "claude-opus-5-5" + ], + [ + "anthropic", + "claude-sonnet-4-5" + ], + [ + "anthropic", + "claude-sonnet-4-5-20250929" + ], + [ + "anthropic", + "claude-sonnet-4-6" + ], + [ + "anthropic", + "claude-sonnet-5" + ] + ] + } + }, + { + "id": "invalid-json", + "overlay": "{", + "expected": { + "invalid": true, + "total": 2245, + "models": [ + { + "id": "claude-fable-5", + "name": "Claude Fable 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-1", + "name": "Claude Fable 5.1", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 0.25, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-2", + "name": "Claude Fable 5.2", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 8, + "output": 40, + "cacheRead": 0.2, + "cacheWrite": 10 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-haiku-4-5", + "name": "Claude Haiku 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-haiku-4-5-20251001", + "name": "Claude Haiku 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5", + "name": "Claude Opus 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5-20251101", + "name": "Claude Opus 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-6", + "name": "Claude Opus 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-7", + "name": "Claude Opus 4.7", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-8", + "name": "Claude Opus 4.8", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5", + "name": "Claude Opus 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-5", + "name": "Claude Opus 5.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.2, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-4-5", + "name": "Claude Sonnet 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-5-20250929", + "name": "Claude Sonnet 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5", + "name": "Claude Sonnet 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + } + ], + "available": [ + [ + "anthropic", + "claude-fable-5" + ], + [ + "anthropic", + "claude-fable-5-1" + ], + [ + "anthropic", + "claude-fable-5-2" + ], + [ + "anthropic", + "claude-haiku-4-5" + ], + [ + "anthropic", + "claude-haiku-4-5-20251001" + ], + [ + "anthropic", + "claude-opus-4-5" + ], + [ + "anthropic", + "claude-opus-4-5-20251101" + ], + [ + "anthropic", + "claude-opus-4-6" + ], + [ + "anthropic", + "claude-opus-4-7" + ], + [ + "anthropic", + "claude-opus-4-8" + ], + [ + "anthropic", + "claude-opus-5" + ], + [ + "anthropic", + "claude-opus-5-5" + ], + [ + "anthropic", + "claude-sonnet-4-5" + ], + [ + "anthropic", + "claude-sonnet-4-5-20250929" + ], + [ + "anthropic", + "claude-sonnet-4-6" + ], + [ + "anthropic", + "claude-sonnet-5" + ] + ] + } + }, + { + "id": "invalid-model-limit", + "overlay": "{\"providers\":{\"anthropic\":{\"models\":[{\"id\":\"broken\",\"maxTokens\":0}]}}}", + "expected": { + "invalid": true, + "total": 2245, + "models": [ + { + "id": "claude-fable-5", + "name": "Claude Fable 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-1", + "name": "Claude Fable 5.1", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 0.25, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-2", + "name": "Claude Fable 5.2", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 8, + "output": 40, + "cacheRead": 0.2, + "cacheWrite": 10 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-haiku-4-5", + "name": "Claude Haiku 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-haiku-4-5-20251001", + "name": "Claude Haiku 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5", + "name": "Claude Opus 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5-20251101", + "name": "Claude Opus 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-6", + "name": "Claude Opus 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-7", + "name": "Claude Opus 4.7", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-8", + "name": "Claude Opus 4.8", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5", + "name": "Claude Opus 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-5", + "name": "Claude Opus 5.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.2, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-4-5", + "name": "Claude Sonnet 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-5-20250929", + "name": "Claude Sonnet 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5", + "name": "Claude Sonnet 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + } + ], + "available": [ + [ + "anthropic", + "claude-fable-5" + ], + [ + "anthropic", + "claude-fable-5-1" + ], + [ + "anthropic", + "claude-fable-5-2" + ], + [ + "anthropic", + "claude-haiku-4-5" + ], + [ + "anthropic", + "claude-haiku-4-5-20251001" + ], + [ + "anthropic", + "claude-opus-4-5" + ], + [ + "anthropic", + "claude-opus-4-5-20251101" + ], + [ + "anthropic", + "claude-opus-4-6" + ], + [ + "anthropic", + "claude-opus-4-7" + ], + [ + "anthropic", + "claude-opus-4-8" + ], + [ + "anthropic", + "claude-opus-5" + ], + [ + "anthropic", + "claude-opus-5-5" + ], + [ + "anthropic", + "claude-sonnet-4-5" + ], + [ + "anthropic", + "claude-sonnet-4-5-20250929" + ], + [ + "anthropic", + "claude-sonnet-4-6" + ], + [ + "anthropic", + "claude-sonnet-5" + ] + ] + } + }, + { + "id": "missing-api", + "overlay": "{\"providers\":{\"synthetic\":{\"baseUrl\":\"https://synthetic.invalid\",\"apiKey\":\"faux-key\",\"models\":[{\"id\":\"one\"}]}}}", + "expected": { + "invalid": true, + "total": 2245, + "models": [ + { + "id": "claude-fable-5", + "name": "Claude Fable 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-1", + "name": "Claude Fable 5.1", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 0.25, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-2", + "name": "Claude Fable 5.2", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 8, + "output": 40, + "cacheRead": 0.2, + "cacheWrite": 10 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-haiku-4-5", + "name": "Claude Haiku 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-haiku-4-5-20251001", + "name": "Claude Haiku 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5", + "name": "Claude Opus 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5-20251101", + "name": "Claude Opus 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-6", + "name": "Claude Opus 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-7", + "name": "Claude Opus 4.7", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-8", + "name": "Claude Opus 4.8", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5", + "name": "Claude Opus 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-5", + "name": "Claude Opus 5.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.2, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-4-5", + "name": "Claude Sonnet 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-5-20250929", + "name": "Claude Sonnet 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5", + "name": "Claude Sonnet 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + } + ], + "available": [ + [ + "anthropic", + "claude-fable-5" + ], + [ + "anthropic", + "claude-fable-5-1" + ], + [ + "anthropic", + "claude-fable-5-2" + ], + [ + "anthropic", + "claude-haiku-4-5" + ], + [ + "anthropic", + "claude-haiku-4-5-20251001" + ], + [ + "anthropic", + "claude-opus-4-5" + ], + [ + "anthropic", + "claude-opus-4-5-20251101" + ], + [ + "anthropic", + "claude-opus-4-6" + ], + [ + "anthropic", + "claude-opus-4-7" + ], + [ + "anthropic", + "claude-opus-4-8" + ], + [ + "anthropic", + "claude-opus-5" + ], + [ + "anthropic", + "claude-opus-5-5" + ], + [ + "anthropic", + "claude-sonnet-4-5" + ], + [ + "anthropic", + "claude-sonnet-4-5-20250929" + ], + [ + "anthropic", + "claude-sonnet-4-6" + ], + [ + "anthropic", + "claude-sonnet-5" + ] + ] + } + }, + { + "id": "missing-auth", + "overlay": "{\"providers\":{\"synthetic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid\",\"models\":[{\"id\":\"one\"}]}}}", + "expected": { + "invalid": true, + "total": 2245, + "models": [ + { + "id": "claude-fable-5", + "name": "Claude Fable 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 1, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-1", + "name": "Claude Fable 5.1", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 10, + "output": 50, + "cacheRead": 0.25, + "cacheWrite": 12.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-fable-5-2", + "name": "Claude Fable 5.2", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 8, + "output": 40, + "cacheRead": 0.2, + "cacheWrite": 10 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-haiku-4-5", + "name": "Claude Haiku 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-haiku-4-5-20251001", + "name": "Claude Haiku 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 1, + "output": 5, + "cacheRead": 0.1, + "cacheWrite": 1.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5", + "name": "Claude Opus 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-5-20251101", + "name": "Claude Opus 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-opus-4-6", + "name": "Claude Opus 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-7", + "name": "Claude Opus 4.7", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-4-8", + "name": "Claude Opus 4.8", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5", + "name": "Claude Opus 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 5, + "output": 25, + "cacheRead": 0.5, + "cacheWrite": 6.25 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-opus-5-5", + "name": "Claude Opus 5.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsDisabledThinking": false + }, + "reasoning": true, + "thinkingLevelMap": { + "off": null, + "minimal": null, + "low": "low", + "medium": "medium", + "high": "high", + "xhigh": "xhigh", + "max": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 4, + "output": 20, + "cacheRead": 0.2, + "cacheWrite": 5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-4-5", + "name": "Claude Sonnet 4.5 (latest)", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-5-20250929", + "name": "Claude Sonnet 4.5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 200000, + "maxTokens": 64000 + }, + { + "id": "claude-sonnet-4-6", + "name": "Claude Sonnet 4.6", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true + }, + "reasoning": true, + "thinkingLevelMap": { + "xhigh": "max" + }, + "input": [ + "text", + "image" + ], + "cost": { + "input": 3, + "output": 15, + "cacheRead": 0.3, + "cacheWrite": 3.75 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + }, + { + "id": "claude-sonnet-5", + "name": "Claude Sonnet 5", + "api": "anthropic-messages", + "provider": "anthropic", + "baseUrl": "https://api.anthropic.com", + "compat": { + "forceAdaptiveThinking": true, + "supportsTemperature": false + }, + "reasoning": true, + "input": [ + "text", + "image" + ], + "cost": { + "input": 2, + "output": 10, + "cacheRead": 0.2, + "cacheWrite": 2.5 + }, + "contextWindow": 1000000, + "maxTokens": 128000 + } + ], + "available": [ + [ + "anthropic", + "claude-fable-5" + ], + [ + "anthropic", + "claude-fable-5-1" + ], + [ + "anthropic", + "claude-fable-5-2" + ], + [ + "anthropic", + "claude-haiku-4-5" + ], + [ + "anthropic", + "claude-haiku-4-5-20251001" + ], + [ + "anthropic", + "claude-opus-4-5" + ], + [ + "anthropic", + "claude-opus-4-5-20251101" + ], + [ + "anthropic", + "claude-opus-4-6" + ], + [ + "anthropic", + "claude-opus-4-7" + ], + [ + "anthropic", + "claude-opus-4-8" + ], + [ + "anthropic", + "claude-opus-5" + ], + [ + "anthropic", + "claude-opus-5-5" + ], + [ + "anthropic", + "claude-sonnet-4-5" + ], + [ + "anthropic", + "claude-sonnet-4-5-20250929" + ], + [ + "anthropic", + "claude-sonnet-4-6" + ], + [ + "anthropic", + "claude-sonnet-5" + ] + ] + } + } + ] +} diff --git a/native/omk-providers/tests/fixtures/dispatch.json b/native/omk-providers/tests/fixtures/dispatch.json new file mode 100644 index 0000000000..bda5e88f7d --- /dev/null +++ b/native/omk-providers/tests/fixtures/dispatch.json @@ -0,0 +1,756 @@ +{ + "schema": "omk.authenticated-dispatch.v1", + "source": { + "scripts/fixtures/dispatch-recorder.ts": "a644cf9acb8d1dab52d83d9d529de3b466aa0144d4d7caa6c9acdfac4e272700", + "scripts/fixtures/anthropic-provider-cases.ts": "c73097643a997be405d583bbdeb09e4fc7d9dc0bfa037f59f5965949c23d638f", + "packages/ai/src/providers/anthropic.ts": "38e1ca641ad118fb0f66e927979a0533f19ea3f64e37b1778888b1093aa90a46", + "packages/ai/src/providers/anthropic-compat.ts": "a636a7caec627915d187137228a0151e77b9242bcf0c0add996cf9bed984b017", + "packages/coding-agent/src/core/model-registry.ts": "53fba00330a076d14b020ed242903387e5b16683ab39bb5048dcf7fc8b27b7ff", + "packages/coding-agent/src/core/provider-request-key.ts": "da6e43e61d9e48ec49cc2355fdb76d17642ea5184e0744392ae3f817a91308af" + }, + "cases": [ + { + "id": "runtime", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-dispatch\",\"reasoning\":false,\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-dispatch", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [] + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-dispatch\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-dispatch", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "stored", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-dispatch\",\"reasoning\":false,\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-dispatch", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [] + }, + "store": "{\"anthropic\":{\"type\":\"api_key\",\"key\":\"$SYN_KEY\"}}", + "env": { + "SYN_KEY": "faux-stored" + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-stored" + }, + "body": "{\"model\":\"synthetic-dispatch\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-dispatch", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "environment", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-dispatch\",\"reasoning\":false,\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-dispatch", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [] + }, + "environment": "faux-environment", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-environment" + }, + "body": "{\"model\":\"synthetic-dispatch\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-dispatch", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "fallback", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-fallback\",\"models\":[{\"id\":\"synthetic-dispatch\",\"reasoning\":false,\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-dispatch", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [] + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-fallback" + }, + "body": "{\"model\":\"synthetic-dispatch\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-dispatch", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "provider-model-headers", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"headers\":{\"x-test\":\"provider\",\"x-provider\":\"$SYN_KEY\"},\"models\":[{\"id\":\"synthetic-dispatch\",\"reasoning\":false,\"input\":[\"text\"],\"headers\":{\"X-Test\":\"model\"}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-dispatch", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [] + }, + "runtime": "faux-runtime", + "env": { + "SYN_KEY": "header-value" + }, + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime", + "x-provider": "header-value", + "x-test": "model" + }, + "body": "{\"model\":\"synthetic-dispatch\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-dispatch", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "authorization-header", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"authHeader\":true,\"models\":[{\"id\":\"synthetic-dispatch\",\"reasoning\":false,\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-dispatch", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [] + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "authorization": "Bearer faux-runtime", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-dispatch\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-dispatch", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "eager-disabled", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-dispatch\",\"reasoning\":false,\"input\":[\"text\"],\"compat\":{\"supportsEagerToolInputStreaming\":false}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-dispatch", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [ + { + "name": "read", + "description": "Read synthetic file", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + } + ] + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "fine-grained-tool-streaming-2025-05-14,interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-dispatch\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"tools\":[{\"name\":\"read\",\"description\":\"Read synthetic file\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-dispatch", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "adaptive-beta", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-dispatch\",\"reasoning\":false,\"input\":[\"text\"],\"compat\":{\"forceAdaptiveThinking\":true}}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-dispatch", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [] + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-dispatch\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-dispatch", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "tools", + "overlay": "{\"providers\":{\"anthropic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-dispatch\",\"reasoning\":false,\"input\":[\"text\"]}]}}}", + "provider": "anthropic", + "input": { + "model": "synthetic-dispatch", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [ + { + "name": "read", + "description": "Read synthetic file", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + } + ] + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-dispatch\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}],\"tools\":[{\"name\":\"read\",\"description\":\"Read synthetic file\",\"eager_input_streaming\":true,\"input_schema\":{\"type\":\"object\",\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"]}}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "anthropic", + "model": "synthetic-dispatch", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + }, + { + "id": "custom-provider", + "overlay": "{\"providers\":{\"synthetic\":{\"api\":\"anthropic-messages\",\"baseUrl\":\"https://synthetic.invalid/v1/\",\"apiKey\":\"faux-config\",\"models\":[{\"id\":\"synthetic-dispatch\",\"reasoning\":false,\"input\":[\"text\"]}]}}}", + "provider": "synthetic", + "input": { + "model": "synthetic-dispatch", + "maxTokens": 64, + "system": "Synthetic system", + "user": "Hello 🌍", + "tools": [] + }, + "runtime": "faux-runtime", + "request": { + "url": "https://synthetic.invalid/v1/messages", + "headers": { + "accept": "application/json", + "anthropic-beta": "interleaved-thinking-2025-05-14", + "anthropic-dangerous-direct-browser-access": "true", + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": "faux-runtime" + }, + "body": "{\"model\":\"synthetic-dispatch\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"max_tokens\":64,\"stream\":true,\"system\":[{\"type\":\"text\",\"text\":\"Synthetic system\"}]}" + }, + "events": [ + { + "type": "start" + }, + { + "type": "text_start", + "contentIndex": 0 + }, + { + "type": "text_delta", + "contentIndex": 0, + "delta": "안녕 🌍" + }, + { + "type": "text_end", + "contentIndex": 0, + "content": "안녕 🌍" + }, + { + "type": "done", + "reason": "stop" + } + ], + "result": { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "안녕 🌍" + } + ], + "api": "anthropic-messages", + "provider": "synthetic", + "model": "synthetic-dispatch", + "stopReason": "stop", + "responseId": "msg_synthetic", + "usage": { + "input": 12, + "output": 5, + "cacheRead": 3, + "cacheWrite": 2, + "totalTokens": 22, + "cacheWrite1h": 0 + } + }, + "wire": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_synthetic\",\"usage\":{\"input_tokens\":12,\"output_tokens\":0,\"cache_read_input_tokens\":3,\"cache_creation_input_tokens\":2}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"안녕 🌍\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\"},\"usage\":{\"output_tokens\":5}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + } + ] +} diff --git a/native/omk-providers/tests/fixtures/openai-completions-affinity.json b/native/omk-providers/tests/fixtures/openai-completions-affinity.json new file mode 100644 index 0000000000..d13f8e4043 --- /dev/null +++ b/native/omk-providers/tests/fixtures/openai-completions-affinity.json @@ -0,0 +1,477 @@ +{ + "schema": "omk.openai-completions-affinity.v1", + "source": { + "scripts/fixtures/openai-completions-affinity-recorder.ts": "449bd6868ba09962b3aaa63514446cab5ecac4e4f07392be517977e127692665", + "packages/ai/src/providers/openai-completions.ts": "35213516c93dd6b8bb777a90a8a2b9f2f280a6ef005c12cbeda7f953ba73a658", + "packages/ai/src/providers/openai-completions-compat.ts": "455262725e7f9c0b1d3a5782d94d58c78770d9ef6a0f35be8706bd3ce539f182", + "packages/ai/src/providers/openai-prompt-cache.ts": "dc5ad893e8d895e5eb7b76102c9c0f045569c839ed8d7679b72d24965dbfaf8f", + "node_modules/openai/package.json": "3e84370c189c41e745700f55aa5535e38f6437a48d539d0e9ce02d0554863d9f" + }, + "cases": [ + { + "id": "affinity-session", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "sendSessionAffinityHeaders": true + }, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "sessionId": "sess-1" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "session_id": "sess-1", + "x-client-request-id": "sess-1", + "x-session-affinity": "sess-1" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "affinity-no-session", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "sendSessionAffinityHeaders": true + }, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64 + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "affinity-empty-session", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "sendSessionAffinityHeaders": true + }, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "sessionId": "" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "affinity-retention-none", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "sendSessionAffinityHeaders": true + }, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "none", + "sessionId": "sess-1" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "affinity-retention-short", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "sendSessionAffinityHeaders": true + }, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "short", + "sessionId": "sess-1" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "session_id": "sess-1", + "x-client-request-id": "sess-1", + "x-session-affinity": "sess-1" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "affinity-retention-long", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "sendSessionAffinityHeaders": true, + "supportsLongCacheRetention": true + }, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "long", + "sessionId": "sess-1" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "session_id": "sess-1", + "x-client-request-id": "sess-1", + "x-session-affinity": "sess-1" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"prompt_cache_key\":\"sess-1\",\"prompt_cache_retention\":\"24h\",\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "affinity-false-session", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "sendSessionAffinityHeaders": false + }, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "sessionId": "sess-1" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "affinity-absent-session", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "sessionId": "sess-1" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "affinity-openai-long-session", + "input": { + "provider": "synthetic", + "baseUrl": "https://api.openai.com/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "sendSessionAffinityHeaders": true + }, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "sessionId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + "request": { + "url": "https://api.openai.com/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "session_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "x-client-request-id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "x-session-affinity": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"prompt_cache_key\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "affinity-openai-none", + "input": { + "provider": "synthetic", + "baseUrl": "https://api.openai.com/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "sendSessionAffinityHeaders": true + }, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "none", + "sessionId": "sess-1" + }, + "request": { + "url": "https://api.openai.com/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "affinity-internal-space", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "sendSessionAffinityHeaders": true + }, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "sessionId": "a b\tc" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "session_id": "a b\tc", + "x-client-request-id": "a b\tc", + "x-session-affinity": "a b\tc" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "affinity-visible-ascii", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "sendSessionAffinityHeaders": true + }, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "sessionId": "A-z_0.9~!#$%&'*+^`|" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "session_id": "A-z_0.9~!#$%&'*+^`|", + "x-client-request-id": "A-z_0.9~!#$%&'*+^`|", + "x-session-affinity": "A-z_0.9~!#$%&'*+^`|" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + } + ] +} diff --git a/native/omk-providers/tests/fixtures/openai-completions-cache.json b/native/omk-providers/tests/fixtures/openai-completions-cache.json new file mode 100644 index 0000000000..22dd5eee5c --- /dev/null +++ b/native/omk-providers/tests/fixtures/openai-completions-cache.json @@ -0,0 +1,1403 @@ +{ + "schema": "omk.openai-completions-cache.v1", + "source": { + "scripts/fixtures/openai-completions-cache-recorder.ts": "52dfa6c0024aa81762544ca884b433dbf2e772ce4f2602349732b32b1132f76d", + "packages/ai/src/providers/openai-completions.ts": "35213516c93dd6b8bb777a90a8a2b9f2f280a6ef005c12cbeda7f953ba73a658", + "packages/ai/src/providers/openai-prompt-cache.ts": "dc5ad893e8d895e5eb7b76102c9c0f045569c839ed8d7679b72d24965dbfaf8f", + "packages/ai/src/providers/prompt-cache.ts": "d91900005c5a146e33b3276d02100a0da3dfe57f718301fc77c12cad23e8329d", + "packages/ai/src/providers/tool-schema.ts": "523a0642c2c62b48d84efd9c81e4a58e83f39a217dbcc5512ff3983bdedd9edb", + "packages/ai/src/utils/hash.ts": "2cdfce4af41810d1a92c7f0a55c78637a3173041038aafd85b378be345761ed8", + "node_modules/openai/package.json": "3e84370c189c41e745700f55aa5535e38f6437a48d539d0e9ce02d0554863d9f" + }, + "cases": [ + { + "id": "short-synthetic-session", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "short", + "sessionId": "s" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "none-openai-session", + "input": { + "provider": "synthetic", + "baseUrl": "https://api.openai.com/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "none", + "sessionId": "s" + }, + "request": { + "url": "https://api.openai.com/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "short-openai-session", + "input": { + "provider": "synthetic", + "baseUrl": "https://api.openai.com/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "short", + "sessionId": "sess-1" + }, + "request": { + "url": "https://api.openai.com/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"prompt_cache_key\":\"sess-1\",\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "default-openai-session", + "input": { + "provider": "synthetic", + "baseUrl": "https://api.openai.com/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "sessionId": "sess-default" + }, + "request": { + "url": "https://api.openai.com/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"prompt_cache_key\":\"sess-default\",\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "short-openai-no-session", + "input": { + "provider": "synthetic", + "baseUrl": "https://api.openai.com/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "short" + }, + "request": { + "url": "https://api.openai.com/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "short-openai-empty-session", + "input": { + "provider": "synthetic", + "baseUrl": "https://api.openai.com/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "short", + "sessionId": "" + }, + "request": { + "url": "https://api.openai.com/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"prompt_cache_key\":\"\",\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "short-openai-long-session", + "input": { + "provider": "synthetic", + "baseUrl": "https://api.openai.com/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "short", + "sessionId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + "request": { + "url": "https://api.openai.com/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"prompt_cache_key\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "short-openai-astral-session", + "input": { + "provider": "synthetic", + "baseUrl": "https://api.openai.com/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "short", + "sessionId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa😀😀" + }, + "request": { + "url": "https://api.openai.com/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"prompt_cache_key\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa😀\",\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "substring-host-session", + "input": { + "provider": "synthetic", + "baseUrl": "https://api.openai.com.synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "short", + "sessionId": "s" + }, + "request": { + "url": "https://api.openai.com.synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"prompt_cache_key\":\"s\",\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "long-supported-synthetic", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "supportsLongCacheRetention": true + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "long", + "sessionId": "s" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"prompt_cache_key\":\"s\",\"prompt_cache_retention\":\"24h\",\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "long-supported-no-session", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "supportsLongCacheRetention": true + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "long" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"prompt_cache_retention\":\"24h\",\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "long-unsupported-synthetic", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "supportsLongCacheRetention": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "long", + "sessionId": "s" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "long-unsupported-openai", + "input": { + "provider": "synthetic", + "baseUrl": "https://api.openai.com/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "supportsLongCacheRetention": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "long", + "sessionId": "s" + }, + "request": { + "url": "https://api.openai.com/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"prompt_cache_key\":\"s\",\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "long-supported-openai", + "input": { + "provider": "synthetic", + "baseUrl": "https://api.openai.com/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "supportsLongCacheRetention": true + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "long", + "sessionId": "s" + }, + "request": { + "url": "https://api.openai.com/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"prompt_cache_key\":\"s\",\"prompt_cache_retention\":\"24h\",\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "none-supported-flag", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "supportsLongCacheRetention": true + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "none", + "sessionId": "s" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "short-supported-flag-synthetic", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "supportsLongCacheRetention": true + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "short", + "sessionId": "s" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "content-key", + "input": { + "provider": "synthetic", + "baseUrl": "https://api.openai.com/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [ + { + "name": "read", + "description": "Read a file\n\"quoted\" 한글", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + } + ], + "maxTokens": 64, + "cacheRetention": "short", + "systemPromptCacheBoundary": 9 + }, + "request": { + "url": "https://api.openai.com/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"prompt_cache_key\":\"omk-wjaeobn4rfr1\",\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"read\",\"description\":\"Read a file\\n\\\"quoted\\\" 한글\",\"parameters\":{\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"strict\":false}}]}" + } + }, + { + "id": "content-key-no-tools", + "input": { + "provider": "synthetic", + "baseUrl": "https://api.openai.com/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "short", + "systemPromptCacheBoundary": 9 + }, + "request": { + "url": "https://api.openai.com/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"prompt_cache_key\":\"omk-lklfor1gdzfba\",\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "content-key-full-length", + "input": { + "provider": "synthetic", + "baseUrl": "https://api.openai.com/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "short", + "systemPromptCacheBoundary": 19 + }, + "request": { + "url": "https://api.openai.com/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"prompt_cache_key\":\"omk-1f53t7c18wzqo2\",\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "content-key-beats-session", + "input": { + "provider": "synthetic", + "baseUrl": "https://api.openai.com/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "short", + "sessionId": "s", + "systemPromptCacheBoundary": 4 + }, + "request": { + "url": "https://api.openai.com/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"prompt_cache_key\":\"omk-2efhf41qjr5q2\",\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "content-key-canonical-tools", + "input": { + "provider": "synthetic", + "baseUrl": "https://api.openai.com/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [ + { + "name": "read", + "description": "Read a file\n\"quoted\" 한글", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "Edit", + "description": "Edit", + "required": [ + "b", + "10" + ], + "properties": { + "2": {}, + "10": { + "type": "integer", + "minimum": 0 + }, + "b": { + "type": "object", + "required": null, + "properties": { + "z": {}, + "y": { + "enum": [ + 1, + 0, + 1e+21, + 0.1 + ] + } + } + }, + "a": { + "type": "string" + }, + "é": {}, + "😀": {}, + "": {} + } + } + ], + "maxTokens": 64, + "cacheRetention": "short", + "systemPromptCacheBoundary": 9 + }, + "request": { + "url": "https://api.openai.com/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"prompt_cache_key\":\"omk-1ce0fx9ch41a3\",\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"Edit\",\"description\":\"Edit\",\"parameters\":{\"properties\":{\"2\":{},\"10\":{\"minimum\":0,\"type\":\"integer\"},\"a\":{\"type\":\"string\"},\"b\":{\"properties\":{\"y\":{\"enum\":[1,0,1e+21,0.1]},\"z\":{}},\"type\":\"object\"},\"é\":{},\"😀\":{},\"\":{}},\"required\":[\"b\",\"10\"],\"type\":\"object\"},\"strict\":false}},{\"type\":\"function\",\"function\":{\"name\":\"read\",\"description\":\"Read a file\\n\\\"quoted\\\" 한글\",\"parameters\":{\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"strict\":false}}]}" + } + }, + { + "id": "content-key-scope", + "input": { + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "model": "gpt-synthetic", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "short", + "systemPromptCacheBoundary": 9 + }, + "request": { + "url": "https://api.openai.com/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"gpt-synthetic\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"prompt_cache_key\":\"omk-g320lz7v5p8z\",\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "content-key-long", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "supportsLongCacheRetention": true + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [ + { + "name": "read", + "description": "Read a file\n\"quoted\" 한글", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + } + ], + "maxTokens": 64, + "cacheRetention": "long", + "sessionId": "s", + "systemPromptCacheBoundary": 9 + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"prompt_cache_key\":\"omk-wjaeobn4rfr1\",\"prompt_cache_retention\":\"24h\",\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"read\",\"description\":\"Read a file\\n\\\"quoted\\\" 한글\",\"parameters\":{\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"strict\":false}}]}" + } + }, + { + "id": "content-key-astral-prefix", + "input": { + "provider": "synthetic", + "baseUrl": "https://api.openai.com/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "😀 cache 한글 tail", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "short", + "systemPromptCacheBoundary": 2 + }, + "request": { + "url": "https://api.openai.com/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"😀 cache 한글 tail\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"prompt_cache_key\":\"omk-1p8rsne1ct18kf\",\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "boundary-zero", + "input": { + "provider": "synthetic", + "baseUrl": "https://api.openai.com/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "short", + "sessionId": "s", + "systemPromptCacheBoundary": 0 + }, + "request": { + "url": "https://api.openai.com/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "boundary-negative", + "input": { + "provider": "synthetic", + "baseUrl": "https://api.openai.com/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "short", + "sessionId": "s", + "systemPromptCacheBoundary": -1 + }, + "request": { + "url": "https://api.openai.com/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "boundary-too-long", + "input": { + "provider": "synthetic", + "baseUrl": "https://api.openai.com/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "short", + "sessionId": "s", + "systemPromptCacheBoundary": 20 + }, + "request": { + "url": "https://api.openai.com/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "boundary-fraction", + "input": { + "provider": "synthetic", + "baseUrl": "https://api.openai.com/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "short", + "sessionId": "s", + "systemPromptCacheBoundary": 1.5 + }, + "request": { + "url": "https://api.openai.com/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "boundary-null", + "input": { + "provider": "synthetic", + "baseUrl": "https://api.openai.com/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "short", + "sessionId": "s", + "systemPromptCacheBoundary": null + }, + "request": { + "url": "https://api.openai.com/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "boundary-string", + "input": { + "provider": "synthetic", + "baseUrl": "https://api.openai.com/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "short", + "sessionId": "s", + "systemPromptCacheBoundary": "3" + }, + "request": { + "url": "https://api.openai.com/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "bypass-with-boundary", + "input": { + "provider": "synthetic", + "baseUrl": "https://api.openai.com/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "short", + "sessionId": "s", + "systemPromptCacheBoundary": 9, + "systemPromptCacheBoundaryBypass": true + }, + "request": { + "url": "https://api.openai.com/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "bypass-without-boundary", + "input": { + "provider": "synthetic", + "baseUrl": "https://api.openai.com/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "short", + "sessionId": "s", + "systemPromptCacheBoundaryBypass": true + }, + "request": { + "url": "https://api.openai.com/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "bypass-false", + "input": { + "provider": "synthetic", + "baseUrl": "https://api.openai.com/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "short", + "sessionId": "s", + "systemPromptCacheBoundaryBypass": false + }, + "request": { + "url": "https://api.openai.com/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"prompt_cache_key\":\"s\",\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "empty-system-boundary", + "input": { + "provider": "synthetic", + "baseUrl": "https://api.openai.com/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "short", + "sessionId": "s", + "systemPromptCacheBoundary": 1 + }, + "request": { + "url": "https://api.openai.com/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "boundary-without-key-policy", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "cacheRetention": "short", + "sessionId": "s", + "systemPromptCacheBoundary": 9 + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + } + ] +} diff --git a/native/omk-providers/tests/fixtures/openai-completions-cross.json b/native/omk-providers/tests/fixtures/openai-completions-cross.json new file mode 100644 index 0000000000..845f7994b4 --- /dev/null +++ b/native/omk-providers/tests/fixtures/openai-completions-cross.json @@ -0,0 +1,1894 @@ +{ + "schema": "omk.openai-completions-cross.v1", + "source": { + "scripts/fixtures/openai-completions-cross-recorder.ts": "054446acfaaa98484170ed9494d720acdc0c668d6d0cc3ed621c57311ac307f0", + "packages/ai/src/providers/openai-completions.ts": "35213516c93dd6b8bb777a90a8a2b9f2f280a6ef005c12cbeda7f953ba73a658", + "packages/ai/src/providers/openai-completions-compat.ts": "455262725e7f9c0b1d3a5782d94d58c78770d9ef6a0f35be8706bd3ce539f182", + "packages/ai/src/providers/transform-messages.ts": "f60d2e3c7db909eb9d80d6b670bf0d7fed8aa318aac026d06f4f8a625f9a5610", + "packages/ai/src/utils/hash.ts": "2cdfce4af41810d1a92c7f0a55c78637a3173041038aafd85b378be345761ed8", + "packages/ai/src/utils/sanitize-unicode.ts": "5749c2cf0819a900e6d84f66e989562bdf4f6bb5fb45958a82b2192f73448bde", + "node_modules/openai/package.json": "3e84370c189c41e745700f55aa5535e38f6437a48d539d0e9ce02d0554863d9f" + }, + "cases": [ + { + "id": "synthetic-none", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "provider": "synthetic", + "model": "m", + "system": "", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "messages": [ + { + "role": "assistant", + "source": { + "provider": "synthetic", + "api": "openai-completions", + "model": "m" + }, + "content": [ + { + "type": "text", + "text": "start" + }, + { + "type": "thinking", + "thinking": "visible", + "thinkingSignature": "reasoning_content" + }, + { + "type": "thinking", + "thinking": "opaque", + "thinkingSignature": "synthetic", + "redacted": true + }, + { + "type": "thinking", + "thinking": " \t" + }, + { + "type": "toolCall", + "id": "call+|it😀/1", + "name": "f", + "arguments": { + "z": 0, + "a": 1 + }, + "thoughtSignature": "{\"z\":1,\"a\":\"synthetic\"}" + }, + { + "type": "toolCall", + "id": "call+|it😀/2", + "name": "f", + "arguments": { + "z": 1, + "a": 1 + }, + "thoughtSignature": "false" + }, + { + "type": "toolCall", + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|A+/=😀", + "name": "f", + "arguments": { + "z": 2, + "a": 1 + }, + "thoughtSignature": "invalid" + }, + { + "type": "toolCall", + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "name": "f", + "arguments": { + "z": 3, + "a": 1 + }, + "thoughtSignature": "[]" + }, + { + "type": "toolCall", + "id": "plainplainplainplainplainplainplainplainplainplain", + "name": "f", + "arguments": { + "z": 4, + "a": 1 + }, + "thoughtSignature": "null" + }, + { + "type": "toolCall", + "id": "raw|", + "name": "f", + "arguments": { + "z": 5, + "a": 1 + }, + "thoughtSignature": "\"\"" + }, + { + "type": "toolCall", + "id": "|", + "name": "f", + "arguments": { + "z": 6, + "a": 1 + }, + "thoughtSignature": "0" + }, + { + "type": "toolCall", + "id": "a|b|c", + "name": "f", + "arguments": { + "z": 7, + "a": 1 + }, + "thoughtSignature": "\"detail\"" + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "a|b|c", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-7" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-6" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "raw|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-5" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "plainplainplainplainplainplainplainplainplainplain", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-4" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-3" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|A+/=😀", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-2" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call+|it😀/2", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-1" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call+|it😀/1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-0" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"m\",\"messages\":[{\"role\":\"assistant\",\"content\":\"start\",\"reasoning_content\":\"visible\\nopaque\",\"tool_calls\":[{\"id\":\"call+|it😀/1\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":0,\\\"a\\\":1}\"}},{\"id\":\"call+|it😀/2\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":1}\"}},{\"id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|A+/=😀\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":2,\\\"a\\\":1}\"}},{\"id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":3,\\\"a\\\":1}\"}},{\"id\":\"plainplainplainplainplainplainplainplainplainplain\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":4,\\\"a\\\":1}\"}},{\"id\":\"raw|\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":5,\\\"a\\\":1}\"}},{\"id\":\"|\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":6,\\\"a\\\":1}\"}},{\"id\":\"a|b|c\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":7,\\\"a\\\":1}\"}}],\"reasoning_details\":[{\"z\":1,\"a\":\"synthetic\"},[],\"detail\"]},{\"role\":\"tool\",\"content\":\"result-7\",\"tool_call_id\":\"a|b|c\"},{\"role\":\"tool\",\"content\":\"result-6\",\"tool_call_id\":\"|\"},{\"role\":\"tool\",\"content\":\"result-5\",\"tool_call_id\":\"raw|\"},{\"role\":\"tool\",\"content\":\"result-4\",\"tool_call_id\":\"plainplainplainplainplainplainplainplainplainplain\"},{\"role\":\"tool\",\"content\":\"result-3\",\"tool_call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀\"},{\"role\":\"tool\",\"content\":\"result-2\",\"tool_call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|A+/=😀\"},{\"role\":\"tool\",\"content\":\"result-1\",\"tool_call_id\":\"call+|it😀/2\"},{\"role\":\"tool\",\"content\":\"result-0\",\"tool_call_id\":\"call+|it😀/1\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"tools\":[]}" + } + }, + { + "id": "synthetic-provider", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "provider": "synthetic", + "model": "m", + "system": "", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "messages": [ + { + "role": "assistant", + "source": { + "provider": "foreign", + "api": "openai-completions", + "model": "m" + }, + "content": [ + { + "type": "text", + "text": "start" + }, + { + "type": "thinking", + "thinking": "visible", + "thinkingSignature": "reasoning_content" + }, + { + "type": "thinking", + "thinking": "opaque", + "thinkingSignature": "synthetic", + "redacted": true + }, + { + "type": "thinking", + "thinking": " \t" + }, + { + "type": "toolCall", + "id": "call+|it😀/1", + "name": "f", + "arguments": { + "z": 0, + "a": 1 + }, + "thoughtSignature": "{\"z\":1,\"a\":\"synthetic\"}" + }, + { + "type": "toolCall", + "id": "call+|it😀/2", + "name": "f", + "arguments": { + "z": 1, + "a": 1 + }, + "thoughtSignature": "false" + }, + { + "type": "toolCall", + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|A+/=😀", + "name": "f", + "arguments": { + "z": 2, + "a": 1 + }, + "thoughtSignature": "invalid" + }, + { + "type": "toolCall", + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "name": "f", + "arguments": { + "z": 3, + "a": 1 + }, + "thoughtSignature": "[]" + }, + { + "type": "toolCall", + "id": "plainplainplainplainplainplainplainplainplainplain", + "name": "f", + "arguments": { + "z": 4, + "a": 1 + }, + "thoughtSignature": "null" + }, + { + "type": "toolCall", + "id": "raw|", + "name": "f", + "arguments": { + "z": 5, + "a": 1 + }, + "thoughtSignature": "\"\"" + }, + { + "type": "toolCall", + "id": "|", + "name": "f", + "arguments": { + "z": 6, + "a": 1 + }, + "thoughtSignature": "0" + }, + { + "type": "toolCall", + "id": "a|b|c", + "name": "f", + "arguments": { + "z": 7, + "a": 1 + }, + "thoughtSignature": "\"detail\"" + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "a|b|c", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-7" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-6" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "raw|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-5" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "plainplainplainplainplainplainplainplainplainplain", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-4" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-3" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|A+/=😀", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-2" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call+|it😀/2", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-1" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call+|it😀/1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-0" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"m\",\"messages\":[{\"role\":\"assistant\",\"content\":\"startvisible\",\"tool_calls\":[{\"id\":\"call__it___1\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":0,\\\"a\\\":1}\"}},{\"id\":\"call__it___2\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":1}\"}},{\"id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_gq7ppno7\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":2,\\\"a\\\":1}\"}},{\"id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_dn63vi1u\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":3,\\\"a\\\":1}\"}},{\"id\":\"plainplainplainplainplainplainplainplainplainplain\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":4,\\\"a\\\":1}\"}},{\"id\":\"raw\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":5,\\\"a\\\":1}\"}},{\"id\":\"\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":6,\\\"a\\\":1}\"}},{\"id\":\"a_b_c\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":7,\\\"a\\\":1}\"}}]},{\"role\":\"tool\",\"content\":\"result-7\",\"tool_call_id\":\"a_b_c\"},{\"role\":\"tool\",\"content\":\"result-5\",\"tool_call_id\":\"raw\"},{\"role\":\"tool\",\"content\":\"result-4\",\"tool_call_id\":\"plainplainplainplainplainplainplainplainplainplain\"},{\"role\":\"tool\",\"content\":\"result-3\",\"tool_call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_dn63vi1u\"},{\"role\":\"tool\",\"content\":\"result-2\",\"tool_call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_gq7ppno7\"},{\"role\":\"tool\",\"content\":\"result-1\",\"tool_call_id\":\"call__it___2\"},{\"role\":\"tool\",\"content\":\"result-0\",\"tool_call_id\":\"call__it___1\"},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"tools\":[]}" + } + }, + { + "id": "synthetic-api", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "provider": "synthetic", + "model": "m", + "system": "", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "messages": [ + { + "role": "assistant", + "source": { + "provider": "synthetic", + "api": "openai-responses", + "model": "m" + }, + "content": [ + { + "type": "text", + "text": "start" + }, + { + "type": "thinking", + "thinking": "visible", + "thinkingSignature": "reasoning_content" + }, + { + "type": "thinking", + "thinking": "opaque", + "thinkingSignature": "synthetic", + "redacted": true + }, + { + "type": "thinking", + "thinking": " \t" + }, + { + "type": "toolCall", + "id": "call+|it😀/1", + "name": "f", + "arguments": { + "z": 0, + "a": 1 + }, + "thoughtSignature": "{\"z\":1,\"a\":\"synthetic\"}" + }, + { + "type": "toolCall", + "id": "call+|it😀/2", + "name": "f", + "arguments": { + "z": 1, + "a": 1 + }, + "thoughtSignature": "false" + }, + { + "type": "toolCall", + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|A+/=😀", + "name": "f", + "arguments": { + "z": 2, + "a": 1 + }, + "thoughtSignature": "invalid" + }, + { + "type": "toolCall", + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "name": "f", + "arguments": { + "z": 3, + "a": 1 + }, + "thoughtSignature": "[]" + }, + { + "type": "toolCall", + "id": "plainplainplainplainplainplainplainplainplainplain", + "name": "f", + "arguments": { + "z": 4, + "a": 1 + }, + "thoughtSignature": "null" + }, + { + "type": "toolCall", + "id": "raw|", + "name": "f", + "arguments": { + "z": 5, + "a": 1 + }, + "thoughtSignature": "\"\"" + }, + { + "type": "toolCall", + "id": "|", + "name": "f", + "arguments": { + "z": 6, + "a": 1 + }, + "thoughtSignature": "0" + }, + { + "type": "toolCall", + "id": "a|b|c", + "name": "f", + "arguments": { + "z": 7, + "a": 1 + }, + "thoughtSignature": "\"detail\"" + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "a|b|c", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-7" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-6" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "raw|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-5" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "plainplainplainplainplainplainplainplainplainplain", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-4" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-3" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|A+/=😀", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-2" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call+|it😀/2", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-1" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call+|it😀/1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-0" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"m\",\"messages\":[{\"role\":\"assistant\",\"content\":\"startvisible\",\"tool_calls\":[{\"id\":\"call__it___1\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":0,\\\"a\\\":1}\"}},{\"id\":\"call__it___2\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":1}\"}},{\"id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_gq7ppno7\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":2,\\\"a\\\":1}\"}},{\"id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_dn63vi1u\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":3,\\\"a\\\":1}\"}},{\"id\":\"plainplainplainplainplainplainplainplainplainplain\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":4,\\\"a\\\":1}\"}},{\"id\":\"raw\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":5,\\\"a\\\":1}\"}},{\"id\":\"\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":6,\\\"a\\\":1}\"}},{\"id\":\"a_b_c\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":7,\\\"a\\\":1}\"}}]},{\"role\":\"tool\",\"content\":\"result-7\",\"tool_call_id\":\"a_b_c\"},{\"role\":\"tool\",\"content\":\"result-5\",\"tool_call_id\":\"raw\"},{\"role\":\"tool\",\"content\":\"result-4\",\"tool_call_id\":\"plainplainplainplainplainplainplainplainplainplain\"},{\"role\":\"tool\",\"content\":\"result-3\",\"tool_call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_dn63vi1u\"},{\"role\":\"tool\",\"content\":\"result-2\",\"tool_call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_gq7ppno7\"},{\"role\":\"tool\",\"content\":\"result-1\",\"tool_call_id\":\"call__it___2\"},{\"role\":\"tool\",\"content\":\"result-0\",\"tool_call_id\":\"call__it___1\"},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"tools\":[]}" + } + }, + { + "id": "synthetic-model", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "provider": "synthetic", + "model": "m", + "system": "", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "messages": [ + { + "role": "assistant", + "source": { + "provider": "synthetic", + "api": "openai-completions", + "model": "other" + }, + "content": [ + { + "type": "text", + "text": "start" + }, + { + "type": "thinking", + "thinking": "visible", + "thinkingSignature": "reasoning_content" + }, + { + "type": "thinking", + "thinking": "opaque", + "thinkingSignature": "synthetic", + "redacted": true + }, + { + "type": "thinking", + "thinking": " \t" + }, + { + "type": "toolCall", + "id": "call+|it😀/1", + "name": "f", + "arguments": { + "z": 0, + "a": 1 + }, + "thoughtSignature": "{\"z\":1,\"a\":\"synthetic\"}" + }, + { + "type": "toolCall", + "id": "call+|it😀/2", + "name": "f", + "arguments": { + "z": 1, + "a": 1 + }, + "thoughtSignature": "false" + }, + { + "type": "toolCall", + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|A+/=😀", + "name": "f", + "arguments": { + "z": 2, + "a": 1 + }, + "thoughtSignature": "invalid" + }, + { + "type": "toolCall", + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "name": "f", + "arguments": { + "z": 3, + "a": 1 + }, + "thoughtSignature": "[]" + }, + { + "type": "toolCall", + "id": "plainplainplainplainplainplainplainplainplainplain", + "name": "f", + "arguments": { + "z": 4, + "a": 1 + }, + "thoughtSignature": "null" + }, + { + "type": "toolCall", + "id": "raw|", + "name": "f", + "arguments": { + "z": 5, + "a": 1 + }, + "thoughtSignature": "\"\"" + }, + { + "type": "toolCall", + "id": "|", + "name": "f", + "arguments": { + "z": 6, + "a": 1 + }, + "thoughtSignature": "0" + }, + { + "type": "toolCall", + "id": "a|b|c", + "name": "f", + "arguments": { + "z": 7, + "a": 1 + }, + "thoughtSignature": "\"detail\"" + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "a|b|c", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-7" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-6" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "raw|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-5" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "plainplainplainplainplainplainplainplainplainplain", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-4" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-3" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|A+/=😀", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-2" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call+|it😀/2", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-1" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call+|it😀/1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-0" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"m\",\"messages\":[{\"role\":\"assistant\",\"content\":\"startvisible\",\"tool_calls\":[{\"id\":\"call__it___1\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":0,\\\"a\\\":1}\"}},{\"id\":\"call__it___2\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":1}\"}},{\"id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_gq7ppno7\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":2,\\\"a\\\":1}\"}},{\"id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_dn63vi1u\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":3,\\\"a\\\":1}\"}},{\"id\":\"plainplainplainplainplainplainplainplainplainplain\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":4,\\\"a\\\":1}\"}},{\"id\":\"raw\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":5,\\\"a\\\":1}\"}},{\"id\":\"\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":6,\\\"a\\\":1}\"}},{\"id\":\"a_b_c\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":7,\\\"a\\\":1}\"}}]},{\"role\":\"tool\",\"content\":\"result-7\",\"tool_call_id\":\"a_b_c\"},{\"role\":\"tool\",\"content\":\"result-5\",\"tool_call_id\":\"raw\"},{\"role\":\"tool\",\"content\":\"result-4\",\"tool_call_id\":\"plainplainplainplainplainplainplainplainplainplain\"},{\"role\":\"tool\",\"content\":\"result-3\",\"tool_call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_dn63vi1u\"},{\"role\":\"tool\",\"content\":\"result-2\",\"tool_call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_gq7ppno7\"},{\"role\":\"tool\",\"content\":\"result-1\",\"tool_call_id\":\"call__it___2\"},{\"role\":\"tool\",\"content\":\"result-0\",\"tool_call_id\":\"call__it___1\"},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"tools\":[]}" + } + }, + { + "id": "openai-none", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "provider": "openai", + "model": "m", + "system": "", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "messages": [ + { + "role": "assistant", + "source": { + "provider": "openai", + "api": "openai-completions", + "model": "m" + }, + "content": [ + { + "type": "text", + "text": "start" + }, + { + "type": "thinking", + "thinking": "visible", + "thinkingSignature": "reasoning_content" + }, + { + "type": "thinking", + "thinking": "opaque", + "thinkingSignature": "synthetic", + "redacted": true + }, + { + "type": "thinking", + "thinking": " \t" + }, + { + "type": "toolCall", + "id": "call+|it😀/1", + "name": "f", + "arguments": { + "z": 0, + "a": 1 + }, + "thoughtSignature": "{\"z\":1,\"a\":\"synthetic\"}" + }, + { + "type": "toolCall", + "id": "call+|it😀/2", + "name": "f", + "arguments": { + "z": 1, + "a": 1 + }, + "thoughtSignature": "false" + }, + { + "type": "toolCall", + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|A+/=😀", + "name": "f", + "arguments": { + "z": 2, + "a": 1 + }, + "thoughtSignature": "invalid" + }, + { + "type": "toolCall", + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "name": "f", + "arguments": { + "z": 3, + "a": 1 + }, + "thoughtSignature": "[]" + }, + { + "type": "toolCall", + "id": "plainplainplainplainplainplainplainplainplainplain", + "name": "f", + "arguments": { + "z": 4, + "a": 1 + }, + "thoughtSignature": "null" + }, + { + "type": "toolCall", + "id": "raw|", + "name": "f", + "arguments": { + "z": 5, + "a": 1 + }, + "thoughtSignature": "\"\"" + }, + { + "type": "toolCall", + "id": "|", + "name": "f", + "arguments": { + "z": 6, + "a": 1 + }, + "thoughtSignature": "0" + }, + { + "type": "toolCall", + "id": "a|b|c", + "name": "f", + "arguments": { + "z": 7, + "a": 1 + }, + "thoughtSignature": "\"detail\"" + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "a|b|c", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-7" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-6" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "raw|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-5" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "plainplainplainplainplainplainplainplainplainplain", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-4" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-3" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|A+/=😀", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-2" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call+|it😀/2", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-1" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call+|it😀/1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-0" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"m\",\"messages\":[{\"role\":\"assistant\",\"content\":\"start\",\"reasoning_content\":\"visible\\nopaque\",\"tool_calls\":[{\"id\":\"call+|it😀/1\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":0,\\\"a\\\":1}\"}},{\"id\":\"call+|it😀/2\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":1}\"}},{\"id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|A+/=😀\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":2,\\\"a\\\":1}\"}},{\"id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":3,\\\"a\\\":1}\"}},{\"id\":\"plainplainplainplainplainplainplainplainplainplain\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":4,\\\"a\\\":1}\"}},{\"id\":\"raw|\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":5,\\\"a\\\":1}\"}},{\"id\":\"|\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":6,\\\"a\\\":1}\"}},{\"id\":\"a|b|c\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":7,\\\"a\\\":1}\"}}],\"reasoning_details\":[{\"z\":1,\"a\":\"synthetic\"},[],\"detail\"]},{\"role\":\"tool\",\"content\":\"result-7\",\"tool_call_id\":\"a|b|c\"},{\"role\":\"tool\",\"content\":\"result-6\",\"tool_call_id\":\"|\"},{\"role\":\"tool\",\"content\":\"result-5\",\"tool_call_id\":\"raw|\"},{\"role\":\"tool\",\"content\":\"result-4\",\"tool_call_id\":\"plainplainplainplainplainplainplainplainplainplain\"},{\"role\":\"tool\",\"content\":\"result-3\",\"tool_call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀\"},{\"role\":\"tool\",\"content\":\"result-2\",\"tool_call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|A+/=😀\"},{\"role\":\"tool\",\"content\":\"result-1\",\"tool_call_id\":\"call+|it😀/2\"},{\"role\":\"tool\",\"content\":\"result-0\",\"tool_call_id\":\"call+|it😀/1\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"tools\":[]}" + } + }, + { + "id": "openai-provider", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "provider": "openai", + "model": "m", + "system": "", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "messages": [ + { + "role": "assistant", + "source": { + "provider": "foreign", + "api": "openai-completions", + "model": "m" + }, + "content": [ + { + "type": "text", + "text": "start" + }, + { + "type": "thinking", + "thinking": "visible", + "thinkingSignature": "reasoning_content" + }, + { + "type": "thinking", + "thinking": "opaque", + "thinkingSignature": "synthetic", + "redacted": true + }, + { + "type": "thinking", + "thinking": " \t" + }, + { + "type": "toolCall", + "id": "call+|it😀/1", + "name": "f", + "arguments": { + "z": 0, + "a": 1 + }, + "thoughtSignature": "{\"z\":1,\"a\":\"synthetic\"}" + }, + { + "type": "toolCall", + "id": "call+|it😀/2", + "name": "f", + "arguments": { + "z": 1, + "a": 1 + }, + "thoughtSignature": "false" + }, + { + "type": "toolCall", + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|A+/=😀", + "name": "f", + "arguments": { + "z": 2, + "a": 1 + }, + "thoughtSignature": "invalid" + }, + { + "type": "toolCall", + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "name": "f", + "arguments": { + "z": 3, + "a": 1 + }, + "thoughtSignature": "[]" + }, + { + "type": "toolCall", + "id": "plainplainplainplainplainplainplainplainplainplain", + "name": "f", + "arguments": { + "z": 4, + "a": 1 + }, + "thoughtSignature": "null" + }, + { + "type": "toolCall", + "id": "raw|", + "name": "f", + "arguments": { + "z": 5, + "a": 1 + }, + "thoughtSignature": "\"\"" + }, + { + "type": "toolCall", + "id": "|", + "name": "f", + "arguments": { + "z": 6, + "a": 1 + }, + "thoughtSignature": "0" + }, + { + "type": "toolCall", + "id": "a|b|c", + "name": "f", + "arguments": { + "z": 7, + "a": 1 + }, + "thoughtSignature": "\"detail\"" + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "a|b|c", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-7" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-6" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "raw|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-5" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "plainplainplainplainplainplainplainplainplainplain", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-4" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-3" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|A+/=😀", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-2" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call+|it😀/2", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-1" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call+|it😀/1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-0" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"m\",\"messages\":[{\"role\":\"assistant\",\"content\":\"startvisible\",\"tool_calls\":[{\"id\":\"call__it___1\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":0,\\\"a\\\":1}\"}},{\"id\":\"call__it___2\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":1}\"}},{\"id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_gq7ppno7\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":2,\\\"a\\\":1}\"}},{\"id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_dn63vi1u\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":3,\\\"a\\\":1}\"}},{\"id\":\"plainplainplainplainplainplainplainplain\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":4,\\\"a\\\":1}\"}},{\"id\":\"raw\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":5,\\\"a\\\":1}\"}},{\"id\":\"\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":6,\\\"a\\\":1}\"}},{\"id\":\"a_b_c\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":7,\\\"a\\\":1}\"}}]},{\"role\":\"tool\",\"content\":\"result-7\",\"tool_call_id\":\"a_b_c\"},{\"role\":\"tool\",\"content\":\"result-5\",\"tool_call_id\":\"raw\"},{\"role\":\"tool\",\"content\":\"result-4\",\"tool_call_id\":\"plainplainplainplainplainplainplainplain\"},{\"role\":\"tool\",\"content\":\"result-3\",\"tool_call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_dn63vi1u\"},{\"role\":\"tool\",\"content\":\"result-2\",\"tool_call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_gq7ppno7\"},{\"role\":\"tool\",\"content\":\"result-1\",\"tool_call_id\":\"call__it___2\"},{\"role\":\"tool\",\"content\":\"result-0\",\"tool_call_id\":\"call__it___1\"},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"tools\":[]}" + } + }, + { + "id": "openai-api", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "provider": "openai", + "model": "m", + "system": "", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "messages": [ + { + "role": "assistant", + "source": { + "provider": "openai", + "api": "openai-responses", + "model": "m" + }, + "content": [ + { + "type": "text", + "text": "start" + }, + { + "type": "thinking", + "thinking": "visible", + "thinkingSignature": "reasoning_content" + }, + { + "type": "thinking", + "thinking": "opaque", + "thinkingSignature": "synthetic", + "redacted": true + }, + { + "type": "thinking", + "thinking": " \t" + }, + { + "type": "toolCall", + "id": "call+|it😀/1", + "name": "f", + "arguments": { + "z": 0, + "a": 1 + }, + "thoughtSignature": "{\"z\":1,\"a\":\"synthetic\"}" + }, + { + "type": "toolCall", + "id": "call+|it😀/2", + "name": "f", + "arguments": { + "z": 1, + "a": 1 + }, + "thoughtSignature": "false" + }, + { + "type": "toolCall", + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|A+/=😀", + "name": "f", + "arguments": { + "z": 2, + "a": 1 + }, + "thoughtSignature": "invalid" + }, + { + "type": "toolCall", + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "name": "f", + "arguments": { + "z": 3, + "a": 1 + }, + "thoughtSignature": "[]" + }, + { + "type": "toolCall", + "id": "plainplainplainplainplainplainplainplainplainplain", + "name": "f", + "arguments": { + "z": 4, + "a": 1 + }, + "thoughtSignature": "null" + }, + { + "type": "toolCall", + "id": "raw|", + "name": "f", + "arguments": { + "z": 5, + "a": 1 + }, + "thoughtSignature": "\"\"" + }, + { + "type": "toolCall", + "id": "|", + "name": "f", + "arguments": { + "z": 6, + "a": 1 + }, + "thoughtSignature": "0" + }, + { + "type": "toolCall", + "id": "a|b|c", + "name": "f", + "arguments": { + "z": 7, + "a": 1 + }, + "thoughtSignature": "\"detail\"" + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "a|b|c", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-7" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-6" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "raw|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-5" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "plainplainplainplainplainplainplainplainplainplain", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-4" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-3" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|A+/=😀", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-2" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call+|it😀/2", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-1" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call+|it😀/1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-0" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"m\",\"messages\":[{\"role\":\"assistant\",\"content\":\"startvisible\",\"tool_calls\":[{\"id\":\"call__it___1\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":0,\\\"a\\\":1}\"}},{\"id\":\"call__it___2\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":1}\"}},{\"id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_gq7ppno7\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":2,\\\"a\\\":1}\"}},{\"id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_dn63vi1u\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":3,\\\"a\\\":1}\"}},{\"id\":\"plainplainplainplainplainplainplainplain\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":4,\\\"a\\\":1}\"}},{\"id\":\"raw\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":5,\\\"a\\\":1}\"}},{\"id\":\"\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":6,\\\"a\\\":1}\"}},{\"id\":\"a_b_c\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":7,\\\"a\\\":1}\"}}]},{\"role\":\"tool\",\"content\":\"result-7\",\"tool_call_id\":\"a_b_c\"},{\"role\":\"tool\",\"content\":\"result-5\",\"tool_call_id\":\"raw\"},{\"role\":\"tool\",\"content\":\"result-4\",\"tool_call_id\":\"plainplainplainplainplainplainplainplain\"},{\"role\":\"tool\",\"content\":\"result-3\",\"tool_call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_dn63vi1u\"},{\"role\":\"tool\",\"content\":\"result-2\",\"tool_call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_gq7ppno7\"},{\"role\":\"tool\",\"content\":\"result-1\",\"tool_call_id\":\"call__it___2\"},{\"role\":\"tool\",\"content\":\"result-0\",\"tool_call_id\":\"call__it___1\"},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"tools\":[]}" + } + }, + { + "id": "openai-model", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "provider": "openai", + "model": "m", + "system": "", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "messages": [ + { + "role": "assistant", + "source": { + "provider": "openai", + "api": "openai-completions", + "model": "other" + }, + "content": [ + { + "type": "text", + "text": "start" + }, + { + "type": "thinking", + "thinking": "visible", + "thinkingSignature": "reasoning_content" + }, + { + "type": "thinking", + "thinking": "opaque", + "thinkingSignature": "synthetic", + "redacted": true + }, + { + "type": "thinking", + "thinking": " \t" + }, + { + "type": "toolCall", + "id": "call+|it😀/1", + "name": "f", + "arguments": { + "z": 0, + "a": 1 + }, + "thoughtSignature": "{\"z\":1,\"a\":\"synthetic\"}" + }, + { + "type": "toolCall", + "id": "call+|it😀/2", + "name": "f", + "arguments": { + "z": 1, + "a": 1 + }, + "thoughtSignature": "false" + }, + { + "type": "toolCall", + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|A+/=😀", + "name": "f", + "arguments": { + "z": 2, + "a": 1 + }, + "thoughtSignature": "invalid" + }, + { + "type": "toolCall", + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "name": "f", + "arguments": { + "z": 3, + "a": 1 + }, + "thoughtSignature": "[]" + }, + { + "type": "toolCall", + "id": "plainplainplainplainplainplainplainplainplainplain", + "name": "f", + "arguments": { + "z": 4, + "a": 1 + }, + "thoughtSignature": "null" + }, + { + "type": "toolCall", + "id": "raw|", + "name": "f", + "arguments": { + "z": 5, + "a": 1 + }, + "thoughtSignature": "\"\"" + }, + { + "type": "toolCall", + "id": "|", + "name": "f", + "arguments": { + "z": 6, + "a": 1 + }, + "thoughtSignature": "0" + }, + { + "type": "toolCall", + "id": "a|b|c", + "name": "f", + "arguments": { + "z": 7, + "a": 1 + }, + "thoughtSignature": "\"detail\"" + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "a|b|c", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-7" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-6" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "raw|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-5" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "plainplainplainplainplainplainplainplainplainplain", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-4" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-3" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|A+/=😀", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-2" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call+|it😀/2", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-1" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call+|it😀/1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-0" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"m\",\"messages\":[{\"role\":\"assistant\",\"content\":\"startvisible\",\"tool_calls\":[{\"id\":\"call__it___1\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":0,\\\"a\\\":1}\"}},{\"id\":\"call__it___2\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":1}\"}},{\"id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_gq7ppno7\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":2,\\\"a\\\":1}\"}},{\"id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_dn63vi1u\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":3,\\\"a\\\":1}\"}},{\"id\":\"plainplainplainplainplainplainplainplain\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":4,\\\"a\\\":1}\"}},{\"id\":\"raw\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":5,\\\"a\\\":1}\"}},{\"id\":\"\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":6,\\\"a\\\":1}\"}},{\"id\":\"a_b_c\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{\\\"z\\\":7,\\\"a\\\":1}\"}}]},{\"role\":\"tool\",\"content\":\"result-7\",\"tool_call_id\":\"a_b_c\"},{\"role\":\"tool\",\"content\":\"result-5\",\"tool_call_id\":\"raw\"},{\"role\":\"tool\",\"content\":\"result-4\",\"tool_call_id\":\"plainplainplainplainplainplainplainplain\"},{\"role\":\"tool\",\"content\":\"result-3\",\"tool_call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_dn63vi1u\"},{\"role\":\"tool\",\"content\":\"result-2\",\"tool_call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_gq7ppno7\"},{\"role\":\"tool\",\"content\":\"result-1\",\"tool_call_id\":\"call__it___2\"},{\"role\":\"tool\",\"content\":\"result-0\",\"tool_call_id\":\"call__it___1\"},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"tools\":[]}" + } + } + ] +} diff --git a/native/omk-providers/tests/fixtures/openai-completions-effort.json b/native/omk-providers/tests/fixtures/openai-completions-effort.json new file mode 100644 index 0000000000..9bdf8f6ae6 --- /dev/null +++ b/native/omk-providers/tests/fixtures/openai-completions-effort.json @@ -0,0 +1,1815 @@ +{ + "schema": "omk.openai-completions-effort.v1", + "source": { + "scripts/fixtures/openai-completions-effort-recorder.ts": "cd9b62dc151db939deeba35fea7b0058922d8fe9e67c49857e65ccc46034f839", + "packages/ai/src/providers/openai-completions.ts": "35213516c93dd6b8bb777a90a8a2b9f2f280a6ef005c12cbeda7f953ba73a658", + "packages/ai/src/providers/openai-completions-compat.ts": "455262725e7f9c0b1d3a5782d94d58c78770d9ef6a0f35be8706bd3ce539f182", + "node_modules/openai/package.json": "3e84370c189c41e745700f55aa5535e38f6437a48d539d0e9ce02d0554863d9f" + }, + "cases": [ + { + "id": "openai-effort", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "openai", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "reasoningEffort": "high" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"reasoning_effort\":\"high\"}" + } + }, + { + "id": "openai-effort-tools", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "openai", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [ + { + "name": "read", + "description": "Synthetic read", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + } + ], + "maxTokens": 64, + "toolChoice": "auto", + "reasoningEffort": "low" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"read\",\"description\":\"Synthetic read\",\"parameters\":{\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"strict\":false}}],\"tool_choice\":\"auto\",\"reasoning_effort\":\"low\"}" + } + }, + { + "id": "openai-mapped", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "openai", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "reasoningEffort": "high", + "thinkingLevelMap": { + "high": "max-x" + } + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"reasoning_effort\":\"max-x\"}" + } + }, + { + "id": "openai-mapped-null", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "openai", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "reasoningEffort": "high", + "thinkingLevelMap": { + "high": null + } + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"reasoning_effort\":\"high\"}" + } + }, + { + "id": "openai-off-string", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "openai", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "thinkingLevelMap": { + "off": "none" + } + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"reasoning_effort\":\"none\"}" + } + }, + { + "id": "openai-off-null", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "openai", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "thinkingLevelMap": { + "off": null + } + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "openai-unsupported", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "openai", + "supportsReasoningEffort": false + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "reasoningEffort": "high" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "openai-unsupported-off", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "openai", + "supportsReasoningEffort": false + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "thinkingLevelMap": { + "off": "none" + } + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "openai-not-reasoning", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "openai", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "reasoningEffort": "high" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "openai-ultra", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "openai", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "reasoningEffort": "ultra" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"reasoning_effort\":\"ultra\"}" + } + }, + { + "id": "openrouter-effort", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "openrouter", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [ + { + "name": "read", + "description": "Synthetic read", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + } + ], + "maxTokens": 64, + "toolChoice": "auto", + "reasoningEffort": "medium" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"read\",\"description\":\"Synthetic read\",\"parameters\":{\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"strict\":false}}],\"tool_choice\":\"auto\",\"reasoning\":{\"effort\":\"medium\"}}" + } + }, + { + "id": "openrouter-mapped", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "openrouter", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "reasoningEffort": "xhigh", + "thinkingLevelMap": { + "xhigh": "high" + } + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"reasoning\":{\"effort\":\"high\"}}" + } + }, + { + "id": "openrouter-off-default", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "openrouter", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64 + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"reasoning\":{\"enabled\":false}}" + } + }, + { + "id": "openrouter-off-string", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "openrouter", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "thinkingLevelMap": { + "off": "minimal" + } + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"reasoning\":{\"effort\":\"minimal\"}}" + } + }, + { + "id": "openrouter-off-none", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "openrouter", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "thinkingLevelMap": { + "off": "none" + } + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"reasoning\":{\"enabled\":false}}" + } + }, + { + "id": "openrouter-off-null", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "openrouter", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "thinkingLevelMap": { + "off": null + } + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "openrouter-unsupported", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "openrouter", + "supportsReasoningEffort": false + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "reasoningEffort": "low" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"reasoning\":{\"effort\":\"low\"}}" + } + }, + { + "id": "openrouter-not-reasoning", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "openrouter", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "reasoningEffort": "low" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "deepseek-effort", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "deepseek", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [ + { + "name": "read", + "description": "Synthetic read", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + } + ], + "maxTokens": 64, + "toolChoice": "auto", + "reasoningEffort": "max" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"read\",\"description\":\"Synthetic read\",\"parameters\":{\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"strict\":false}}],\"tool_choice\":\"auto\",\"thinking\":{\"type\":\"enabled\"},\"reasoning_effort\":\"max\"}" + } + }, + { + "id": "deepseek-unsupported", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "deepseek", + "supportsReasoningEffort": false + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "reasoningEffort": "high" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"thinking\":{\"type\":\"enabled\"}}" + } + }, + { + "id": "deepseek-off", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "deepseek", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64 + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"thinking\":{\"type\":\"disabled\"}}" + } + }, + { + "id": "deepseek-not-reasoning", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "deepseek", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "reasoningEffort": "high" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "together-effort", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "together", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "reasoningEffort": "minimal", + "thinkingLevelMap": { + "minimal": "low" + } + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"reasoning\":{\"enabled\":true},\"reasoning_effort\":\"low\"}" + } + }, + { + "id": "together-unsupported", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "together", + "supportsReasoningEffort": false + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "reasoningEffort": "minimal" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"reasoning\":{\"enabled\":true}}" + } + }, + { + "id": "together-off", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "together", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64 + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"reasoning\":{\"enabled\":false}}" + } + }, + { + "id": "zai-effort", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "zai", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "reasoningEffort": "high" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"enable_thinking\":true,\"reasoning_effort\":\"high\"}" + } + }, + { + "id": "zai-unsupported", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "zai", + "supportsReasoningEffort": false + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "reasoningEffort": "high" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"enable_thinking\":true}" + } + }, + { + "id": "zai-off", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "zai", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "thinkingLevelMap": { + "off": "none" + } + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"enable_thinking\":false}" + } + }, + { + "id": "qwen-effort-generic-host", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "qwen", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "reasoningEffort": "high" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"enable_thinking\":true}" + } + }, + { + "id": "qwen-effort-studio", + "input": { + "provider": "synthetic", + "baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "qwen", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [ + { + "name": "read", + "description": "Synthetic read", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + } + ], + "maxTokens": 64, + "toolChoice": "auto", + "reasoningEffort": "high" + }, + "request": { + "url": "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"read\",\"description\":\"Synthetic read\",\"parameters\":{\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"strict\":false}}],\"tool_choice\":\"auto\",\"enable_thinking\":true,\"reasoning_effort\":\"high\"}" + } + }, + { + "id": "qwen-studio-unsupported", + "input": { + "provider": "synthetic", + "baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "qwen", + "supportsReasoningEffort": false + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "reasoningEffort": "high" + }, + "request": { + "url": "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"enable_thinking\":true}" + } + }, + { + "id": "qwen-studio-deepseek-minimal", + "input": { + "provider": "synthetic", + "baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1", + "model": "deepseek-v4-flash", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "qwen", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "reasoningEffort": "minimal" + }, + "request": { + "url": "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"deepseek-v4-flash\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"enable_thinking\":true,\"reasoning_effort\":\"low\"}" + } + }, + { + "id": "qwen-studio-deepseek-minimal-mapped", + "input": { + "provider": "synthetic", + "baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1", + "model": "deepseek-v4-flash", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "qwen", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "reasoningEffort": "minimal", + "thinkingLevelMap": { + "minimal": "tiny" + } + }, + "request": { + "url": "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"deepseek-v4-flash\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"enable_thinking\":true,\"reasoning_effort\":\"tiny\"}" + } + }, + { + "id": "qwen-studio-other-minimal", + "input": { + "provider": "synthetic", + "baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "qwen", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "reasoningEffort": "minimal" + }, + "request": { + "url": "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"enable_thinking\":true,\"reasoning_effort\":\"minimal\"}" + } + }, + { + "id": "qwen-off", + "input": { + "provider": "synthetic", + "baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "qwen", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64 + }, + "request": { + "url": "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"enable_thinking\":false}" + } + }, + { + "id": "qwen-chat-template-effort", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "qwen-chat-template", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "reasoningEffort": "low" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"chat_template_kwargs\":{\"enable_thinking\":true,\"preserve_thinking\":true}}" + } + }, + { + "id": "qwen-chat-template-off", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "qwen-chat-template", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64 + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"chat_template_kwargs\":{\"enable_thinking\":false,\"preserve_thinking\":true}}" + } + }, + { + "id": "string-thinking-effort", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "string-thinking", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "reasoningEffort": "high", + "thinkingLevelMap": { + "high": "deep" + } + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"thinking\":\"deep\"}" + } + }, + { + "id": "string-thinking-off-default", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "string-thinking", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64 + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"thinking\":\"none\"}" + } + }, + { + "id": "string-thinking-off-string", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "string-thinking", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "thinkingLevelMap": { + "off": "low" + } + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"thinking\":\"low\"}" + } + }, + { + "id": "string-thinking-off-null", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "string-thinking", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "thinkingLevelMap": { + "off": null + } + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "ant-ling-mapped", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "ant-ling", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "reasoningEffort": "high", + "thinkingLevelMap": { + "high": "high" + } + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"reasoning\":{\"effort\":\"high\"}}" + } + }, + { + "id": "ant-ling-unmapped", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "ant-ling", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "reasoningEffort": "high" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "ant-ling-null", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "ant-ling", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "reasoningEffort": "high", + "thinkingLevelMap": { + "high": null + } + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "ant-ling-off", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "thinkingFormat": "ant-ling", + "supportsReasoningEffort": true + }, + "system": "Synthetic", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64, + "thinkingLevelMap": { + "off": "none" + } + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic\"},{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"reasoning_effort\":\"none\"}" + } + } + ] +} diff --git a/native/omk-providers/tests/fixtures/openai-completions-images.json b/native/omk-providers/tests/fixtures/openai-completions-images.json new file mode 100644 index 0000000000..7361645bc6 --- /dev/null +++ b/native/omk-providers/tests/fixtures/openai-completions-images.json @@ -0,0 +1,441 @@ +{ + "schema": "omk.openai-completions-images.v1", + "source": { + "scripts/fixtures/openai-completions-images-recorder.ts": "5d163a462460e5285bb6441e1c0d030d72f2cd893c53a845973f1d96389acf23", + "packages/ai/src/providers/openai-completions.ts": "35213516c93dd6b8bb777a90a8a2b9f2f280a6ef005c12cbeda7f953ba73a658", + "packages/ai/src/providers/openai-completions-compat.ts": "455262725e7f9c0b1d3a5782d94d58c78770d9ef6a0f35be8706bd3ce539f182", + "packages/ai/src/providers/transform-messages.ts": "f60d2e3c7db909eb9d80d6b670bf0d7fed8aa318aac026d06f4f8a625f9a5610", + "packages/ai/src/utils/sanitize-unicode.ts": "5749c2cf0819a900e6d84f66e989562bdf4f6bb5fb45958a82b2192f73448bde", + "node_modules/openai/package.json": "3e84370c189c41e745700f55aa5535e38f6437a48d539d0e9ce02d0554863d9f" + }, + "cases": [ + { + "id": "vision-only", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "vision": true, + "system": "", + "messages": [ + { + "role": "user", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,cG5n\"}}]}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false}" + } + }, + { + "id": "vision-ordered", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "vision": true, + "system": "", + "messages": [ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "앞" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + }, + { + "type": "image", + "mimeType": "image/webp", + "data": "not normalized+/=\n" + }, + { + "type": "text", + "text": "" + }, + { + "type": "image", + "mimeType": "image/webp", + "data": "not normalized+/=\n" + }, + { + "type": "text", + "text": "끝" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"앞\"},{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,cG5n\"}},{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/webp;base64,not normalized+/=\\n\"}},{\"type\":\"text\",\"text\":\"\"},{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/webp;base64,not normalized+/=\\n\"}},{\"type\":\"text\",\"text\":\"끝\"}]}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false}" + } + }, + { + "id": "vision-literal-marker", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "vision": true, + "system": "", + "messages": [ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "(image omitted: model does not support images)" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + }, + { + "type": "text", + "text": "(image omitted: model does not support images)" + }, + { + "type": "text", + "text": " " + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"(image omitted: model does not support images)\"},{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,cG5n\"}},{\"type\":\"text\",\"text\":\"(image omitted: model does not support images)\"},{\"type\":\"text\",\"text\":\" \"},{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,cG5n\"}}]}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false}" + } + }, + { + "id": "vision-per-turn", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "vision": true, + "system": "", + "messages": [ + { + "role": "user", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + } + ] + }, + { + "role": "user", + "content": [] + }, + { + "role": "user", + "content": [ + { + "type": "image", + "mimeType": "image/webp", + "data": "not normalized+/=\n" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,cG5n\"}},{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,cG5n\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/webp;base64,not normalized+/=\\n\"}}]}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false}" + } + }, + { + "id": "text-only", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "vision": false, + "system": "", + "messages": [ + { + "role": "user", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"(image omitted: model does not support images)\"}]}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false}" + } + }, + { + "id": "text-ordered", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "vision": false, + "system": "", + "messages": [ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "앞" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + }, + { + "type": "image", + "mimeType": "image/webp", + "data": "not normalized+/=\n" + }, + { + "type": "text", + "text": "" + }, + { + "type": "image", + "mimeType": "image/webp", + "data": "not normalized+/=\n" + }, + { + "type": "text", + "text": "끝" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"앞\"},{\"type\":\"text\",\"text\":\"(image omitted: model does not support images)\"},{\"type\":\"text\",\"text\":\"\"},{\"type\":\"text\",\"text\":\"(image omitted: model does not support images)\"},{\"type\":\"text\",\"text\":\"끝\"}]}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false}" + } + }, + { + "id": "text-literal-marker", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "vision": false, + "system": "", + "messages": [ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "(image omitted: model does not support images)" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + }, + { + "type": "text", + "text": "(image omitted: model does not support images)" + }, + { + "type": "text", + "text": " " + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"(image omitted: model does not support images)\"},{\"type\":\"text\",\"text\":\"(image omitted: model does not support images)\"},{\"type\":\"text\",\"text\":\" \"},{\"type\":\"text\",\"text\":\"(image omitted: model does not support images)\"}]}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false}" + } + }, + { + "id": "text-per-turn", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "vision": false, + "system": "", + "messages": [ + { + "role": "user", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + } + ] + }, + { + "role": "user", + "content": [] + }, + { + "role": "user", + "content": [ + { + "type": "image", + "mimeType": "image/webp", + "data": "not normalized+/=\n" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"(image omitted: model does not support images)\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"(image omitted: model does not support images)\"}]}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false}" + } + } + ] +} diff --git a/native/omk-providers/tests/fixtures/openai-completions-reasoning.json b/native/omk-providers/tests/fixtures/openai-completions-reasoning.json new file mode 100644 index 0000000000..c1dd4f0696 --- /dev/null +++ b/native/omk-providers/tests/fixtures/openai-completions-reasoning.json @@ -0,0 +1,1269 @@ +{ + "schema": "omk.openai-completions-reasoning.v1", + "source": { + "scripts/fixtures/openai-completions-reasoning-recorder.ts": "62a11ff9aeaa48ec5b69caf656a5c96fd21a922ded265b635c97f0d95c2536c8", + "packages/ai/src/providers/openai-completions.ts": "35213516c93dd6b8bb777a90a8a2b9f2f280a6ef005c12cbeda7f953ba73a658", + "packages/ai/src/providers/openai-completions-compat.ts": "455262725e7f9c0b1d3a5782d94d58c78770d9ef6a0f35be8706bd3ce539f182", + "packages/ai/src/providers/transform-messages.ts": "f60d2e3c7db909eb9d80d6b670bf0d7fed8aa318aac026d06f4f8a625f9a5610", + "packages/ai/src/utils/sanitize-unicode.ts": "5749c2cf0819a900e6d84f66e989562bdf4f6bb5fb45958a82b2192f73448bde", + "node_modules/openai/package.json": "3e84370c189c41e745700f55aa5535e38f6437a48d539d0e9ce02d0554863d9f" + }, + "cases": [ + { + "id": "reasoning-false-as-text-false-required-false", + "input": { + "provider": "synthetic", + "model": "m", + "baseUrl": "https://synthetic.invalid/v1", + "reasoning": false, + "system": "", + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "requiresThinkingAsText": false, + "requiresReasoningContentOnAssistantMessages": false + }, + "messages": [ + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "first", + "thinkingSignature": "reasoning" + }, + { + "type": "text", + "text": "one " + }, + { + "type": "thinking", + "thinking": " \t" + }, + { + "type": "thinking", + "thinking": "second" + }, + { + "type": "text", + "text": " " + }, + { + "type": "text", + "text": "two" + }, + { + "type": "toolCall", + "id": "a", + "name": "f", + "arguments": {}, + "thoughtSignature": "{\"z\":1,\"a\":2}" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "kept", + "thinkingSignature": "reasoning_content" + }, + { + "type": "text", + "text": "answer" + }, + { + "type": "toolCall", + "id": "a", + "name": "f", + "arguments": {}, + "thoughtSignature": "{\"z\":1,\"a\":2}" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "only" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "" + }, + { + "type": "text", + "text": "alone" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "toolCall", + "id": "a", + "name": "f", + "arguments": {}, + "thoughtSignature": "{\"z\":1,\"a\":2}" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"m\",\"messages\":[{\"role\":\"assistant\",\"content\":\"one two\",\"reasoning\":\"first\\nsecond\",\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{}\"}}],\"reasoning_details\":[{\"z\":1,\"a\":2}]},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"a\"},{\"role\":\"assistant\",\"content\":\"answer\",\"reasoning_content\":\"kept\",\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{}\"}}],\"reasoning_details\":[{\"z\":1,\"a\":2}]},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"a\"},{\"role\":\"assistant\",\"content\":\"alone\"},{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{}\"}}],\"reasoning_details\":[{\"z\":1,\"a\":2}]},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"a\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"tools\":[]}" + } + }, + { + "id": "reasoning-false-as-text-false-required-true", + "input": { + "provider": "synthetic", + "model": "m", + "baseUrl": "https://synthetic.invalid/v1", + "reasoning": false, + "system": "", + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "requiresThinkingAsText": false, + "requiresReasoningContentOnAssistantMessages": true + }, + "messages": [ + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "first", + "thinkingSignature": "reasoning" + }, + { + "type": "text", + "text": "one " + }, + { + "type": "thinking", + "thinking": " \t" + }, + { + "type": "thinking", + "thinking": "second" + }, + { + "type": "text", + "text": " " + }, + { + "type": "text", + "text": "two" + }, + { + "type": "toolCall", + "id": "a", + "name": "f", + "arguments": {}, + "thoughtSignature": "{\"z\":1,\"a\":2}" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "kept", + "thinkingSignature": "reasoning_content" + }, + { + "type": "text", + "text": "answer" + }, + { + "type": "toolCall", + "id": "a", + "name": "f", + "arguments": {}, + "thoughtSignature": "{\"z\":1,\"a\":2}" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "only" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "" + }, + { + "type": "text", + "text": "alone" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "toolCall", + "id": "a", + "name": "f", + "arguments": {}, + "thoughtSignature": "{\"z\":1,\"a\":2}" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"m\",\"messages\":[{\"role\":\"assistant\",\"content\":\"one two\",\"reasoning\":\"first\\nsecond\",\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{}\"}}],\"reasoning_details\":[{\"z\":1,\"a\":2}]},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"a\"},{\"role\":\"assistant\",\"content\":\"answer\",\"reasoning_content\":\"kept\",\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{}\"}}],\"reasoning_details\":[{\"z\":1,\"a\":2}]},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"a\"},{\"role\":\"assistant\",\"content\":\"alone\"},{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{}\"}}],\"reasoning_details\":[{\"z\":1,\"a\":2}]},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"a\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"tools\":[]}" + } + }, + { + "id": "reasoning-false-as-text-true-required-false", + "input": { + "provider": "synthetic", + "model": "m", + "baseUrl": "https://synthetic.invalid/v1", + "reasoning": false, + "system": "", + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "requiresThinkingAsText": true, + "requiresReasoningContentOnAssistantMessages": false + }, + "messages": [ + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "first", + "thinkingSignature": "reasoning" + }, + { + "type": "text", + "text": "one " + }, + { + "type": "thinking", + "thinking": " \t" + }, + { + "type": "thinking", + "thinking": "second" + }, + { + "type": "text", + "text": " " + }, + { + "type": "text", + "text": "two" + }, + { + "type": "toolCall", + "id": "a", + "name": "f", + "arguments": {}, + "thoughtSignature": "{\"z\":1,\"a\":2}" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "kept", + "thinkingSignature": "reasoning_content" + }, + { + "type": "text", + "text": "answer" + }, + { + "type": "toolCall", + "id": "a", + "name": "f", + "arguments": {}, + "thoughtSignature": "{\"z\":1,\"a\":2}" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "only" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "" + }, + { + "type": "text", + "text": "alone" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "toolCall", + "id": "a", + "name": "f", + "arguments": {}, + "thoughtSignature": "{\"z\":1,\"a\":2}" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"m\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"first\\n\\nsecond\"},{\"type\":\"text\",\"text\":\"one \"},{\"type\":\"text\",\"text\":\"two\"}],\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{}\"}}],\"reasoning_details\":[{\"z\":1,\"a\":2}]},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"a\"},{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"kept\"},{\"type\":\"text\",\"text\":\"answer\"}],\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{}\"}}],\"reasoning_details\":[{\"z\":1,\"a\":2}]},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"a\"},{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"only\"}]},{\"role\":\"assistant\",\"content\":\"alone\"},{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{}\"}}],\"reasoning_details\":[{\"z\":1,\"a\":2}]},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"a\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"tools\":[]}" + } + }, + { + "id": "reasoning-false-as-text-true-required-true", + "input": { + "provider": "synthetic", + "model": "m", + "baseUrl": "https://synthetic.invalid/v1", + "reasoning": false, + "system": "", + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "requiresThinkingAsText": true, + "requiresReasoningContentOnAssistantMessages": true + }, + "messages": [ + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "first", + "thinkingSignature": "reasoning" + }, + { + "type": "text", + "text": "one " + }, + { + "type": "thinking", + "thinking": " \t" + }, + { + "type": "thinking", + "thinking": "second" + }, + { + "type": "text", + "text": " " + }, + { + "type": "text", + "text": "two" + }, + { + "type": "toolCall", + "id": "a", + "name": "f", + "arguments": {}, + "thoughtSignature": "{\"z\":1,\"a\":2}" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "kept", + "thinkingSignature": "reasoning_content" + }, + { + "type": "text", + "text": "answer" + }, + { + "type": "toolCall", + "id": "a", + "name": "f", + "arguments": {}, + "thoughtSignature": "{\"z\":1,\"a\":2}" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "only" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "" + }, + { + "type": "text", + "text": "alone" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "toolCall", + "id": "a", + "name": "f", + "arguments": {}, + "thoughtSignature": "{\"z\":1,\"a\":2}" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"m\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"first\\n\\nsecond\"},{\"type\":\"text\",\"text\":\"one \"},{\"type\":\"text\",\"text\":\"two\"}],\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{}\"}}],\"reasoning_details\":[{\"z\":1,\"a\":2}]},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"a\"},{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"kept\"},{\"type\":\"text\",\"text\":\"answer\"}],\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{}\"}}],\"reasoning_details\":[{\"z\":1,\"a\":2}]},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"a\"},{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"only\"}]},{\"role\":\"assistant\",\"content\":\"alone\"},{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{}\"}}],\"reasoning_details\":[{\"z\":1,\"a\":2}]},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"a\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"tools\":[]}" + } + }, + { + "id": "reasoning-true-as-text-false-required-false", + "input": { + "provider": "synthetic", + "model": "m", + "baseUrl": "https://synthetic.invalid/v1", + "reasoning": true, + "system": "", + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "requiresThinkingAsText": false, + "requiresReasoningContentOnAssistantMessages": false + }, + "messages": [ + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "first", + "thinkingSignature": "reasoning" + }, + { + "type": "text", + "text": "one " + }, + { + "type": "thinking", + "thinking": " \t" + }, + { + "type": "thinking", + "thinking": "second" + }, + { + "type": "text", + "text": " " + }, + { + "type": "text", + "text": "two" + }, + { + "type": "toolCall", + "id": "a", + "name": "f", + "arguments": {}, + "thoughtSignature": "{\"z\":1,\"a\":2}" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "kept", + "thinkingSignature": "reasoning_content" + }, + { + "type": "text", + "text": "answer" + }, + { + "type": "toolCall", + "id": "a", + "name": "f", + "arguments": {}, + "thoughtSignature": "{\"z\":1,\"a\":2}" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "only" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "" + }, + { + "type": "text", + "text": "alone" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "toolCall", + "id": "a", + "name": "f", + "arguments": {}, + "thoughtSignature": "{\"z\":1,\"a\":2}" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"m\",\"messages\":[{\"role\":\"assistant\",\"content\":\"one two\",\"reasoning\":\"first\\nsecond\",\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{}\"}}],\"reasoning_details\":[{\"z\":1,\"a\":2}]},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"a\"},{\"role\":\"assistant\",\"content\":\"answer\",\"reasoning_content\":\"kept\",\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{}\"}}],\"reasoning_details\":[{\"z\":1,\"a\":2}]},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"a\"},{\"role\":\"assistant\",\"content\":\"alone\"},{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{}\"}}],\"reasoning_details\":[{\"z\":1,\"a\":2}]},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"a\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"tools\":[]}" + } + }, + { + "id": "reasoning-true-as-text-false-required-true", + "input": { + "provider": "synthetic", + "model": "m", + "baseUrl": "https://synthetic.invalid/v1", + "reasoning": true, + "system": "", + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "requiresThinkingAsText": false, + "requiresReasoningContentOnAssistantMessages": true + }, + "messages": [ + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "first", + "thinkingSignature": "reasoning" + }, + { + "type": "text", + "text": "one " + }, + { + "type": "thinking", + "thinking": " \t" + }, + { + "type": "thinking", + "thinking": "second" + }, + { + "type": "text", + "text": " " + }, + { + "type": "text", + "text": "two" + }, + { + "type": "toolCall", + "id": "a", + "name": "f", + "arguments": {}, + "thoughtSignature": "{\"z\":1,\"a\":2}" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "kept", + "thinkingSignature": "reasoning_content" + }, + { + "type": "text", + "text": "answer" + }, + { + "type": "toolCall", + "id": "a", + "name": "f", + "arguments": {}, + "thoughtSignature": "{\"z\":1,\"a\":2}" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "only" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "" + }, + { + "type": "text", + "text": "alone" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "toolCall", + "id": "a", + "name": "f", + "arguments": {}, + "thoughtSignature": "{\"z\":1,\"a\":2}" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"m\",\"messages\":[{\"role\":\"assistant\",\"content\":\"one two\",\"reasoning\":\"first\\nsecond\",\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{}\"}}],\"reasoning_details\":[{\"z\":1,\"a\":2}],\"reasoning_content\":\"\"},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"a\"},{\"role\":\"assistant\",\"content\":\"answer\",\"reasoning_content\":\"kept\",\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{}\"}}],\"reasoning_details\":[{\"z\":1,\"a\":2}]},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"a\"},{\"role\":\"assistant\",\"content\":\"alone\",\"reasoning_content\":\"\"},{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{}\"}}],\"reasoning_details\":[{\"z\":1,\"a\":2}],\"reasoning_content\":\"\"},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"a\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"tools\":[]}" + } + }, + { + "id": "reasoning-true-as-text-true-required-false", + "input": { + "provider": "synthetic", + "model": "m", + "baseUrl": "https://synthetic.invalid/v1", + "reasoning": true, + "system": "", + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "requiresThinkingAsText": true, + "requiresReasoningContentOnAssistantMessages": false + }, + "messages": [ + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "first", + "thinkingSignature": "reasoning" + }, + { + "type": "text", + "text": "one " + }, + { + "type": "thinking", + "thinking": " \t" + }, + { + "type": "thinking", + "thinking": "second" + }, + { + "type": "text", + "text": " " + }, + { + "type": "text", + "text": "two" + }, + { + "type": "toolCall", + "id": "a", + "name": "f", + "arguments": {}, + "thoughtSignature": "{\"z\":1,\"a\":2}" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "kept", + "thinkingSignature": "reasoning_content" + }, + { + "type": "text", + "text": "answer" + }, + { + "type": "toolCall", + "id": "a", + "name": "f", + "arguments": {}, + "thoughtSignature": "{\"z\":1,\"a\":2}" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "only" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "" + }, + { + "type": "text", + "text": "alone" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "toolCall", + "id": "a", + "name": "f", + "arguments": {}, + "thoughtSignature": "{\"z\":1,\"a\":2}" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"m\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"first\\n\\nsecond\"},{\"type\":\"text\",\"text\":\"one \"},{\"type\":\"text\",\"text\":\"two\"}],\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{}\"}}],\"reasoning_details\":[{\"z\":1,\"a\":2}]},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"a\"},{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"kept\"},{\"type\":\"text\",\"text\":\"answer\"}],\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{}\"}}],\"reasoning_details\":[{\"z\":1,\"a\":2}]},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"a\"},{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"only\"}]},{\"role\":\"assistant\",\"content\":\"alone\"},{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{}\"}}],\"reasoning_details\":[{\"z\":1,\"a\":2}]},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"a\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"tools\":[]}" + } + }, + { + "id": "reasoning-true-as-text-true-required-true", + "input": { + "provider": "synthetic", + "model": "m", + "baseUrl": "https://synthetic.invalid/v1", + "reasoning": true, + "system": "", + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "requiresThinkingAsText": true, + "requiresReasoningContentOnAssistantMessages": true + }, + "messages": [ + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "first", + "thinkingSignature": "reasoning" + }, + { + "type": "text", + "text": "one " + }, + { + "type": "thinking", + "thinking": " \t" + }, + { + "type": "thinking", + "thinking": "second" + }, + { + "type": "text", + "text": " " + }, + { + "type": "text", + "text": "two" + }, + { + "type": "toolCall", + "id": "a", + "name": "f", + "arguments": {}, + "thoughtSignature": "{\"z\":1,\"a\":2}" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "kept", + "thinkingSignature": "reasoning_content" + }, + { + "type": "text", + "text": "answer" + }, + { + "type": "toolCall", + "id": "a", + "name": "f", + "arguments": {}, + "thoughtSignature": "{\"z\":1,\"a\":2}" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "only" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "thinking", + "thinking": "" + }, + { + "type": "text", + "text": "alone" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [ + { + "type": "toolCall", + "id": "a", + "name": "f", + "arguments": {}, + "thoughtSignature": "{\"z\":1,\"a\":2}" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "model": "m", + "api": "openai-completions" + }, + "content": [] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"m\",\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"first\\n\\nsecond\"},{\"type\":\"text\",\"text\":\"one \"},{\"type\":\"text\",\"text\":\"two\"}],\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{}\"}}],\"reasoning_details\":[{\"z\":1,\"a\":2}],\"reasoning_content\":\"\"},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"a\"},{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"kept\"},{\"type\":\"text\",\"text\":\"answer\"}],\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{}\"}}],\"reasoning_details\":[{\"z\":1,\"a\":2}],\"reasoning_content\":\"\"},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"a\"},{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"only\"}],\"reasoning_content\":\"\"},{\"role\":\"assistant\",\"content\":\"alone\",\"reasoning_content\":\"\"},{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"f\",\"arguments\":\"{}\"}}],\"reasoning_details\":[{\"z\":1,\"a\":2}],\"reasoning_content\":\"\"},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"a\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"tools\":[]}" + } + } + ] +} diff --git a/native/omk-providers/tests/fixtures/openai-completions-tools.json b/native/omk-providers/tests/fixtures/openai-completions-tools.json new file mode 100644 index 0000000000..c7c55cf87b --- /dev/null +++ b/native/omk-providers/tests/fixtures/openai-completions-tools.json @@ -0,0 +1,1207 @@ +{ + "schema": "omk.openai-completions-tools.v1", + "source": { + "scripts/fixtures/openai-completions-tools-recorder.ts": "74356656e92680e1ee337a144ac524442f9e127f1c94c678db53473d1cc53a2a", + "packages/ai/src/providers/openai-completions.ts": "35213516c93dd6b8bb777a90a8a2b9f2f280a6ef005c12cbeda7f953ba73a658", + "packages/ai/src/providers/openai-completions-compat.ts": "455262725e7f9c0b1d3a5782d94d58c78770d9ef6a0f35be8706bd3ce539f182", + "packages/ai/src/providers/transform-messages.ts": "f60d2e3c7db909eb9d80d6b670bf0d7fed8aa318aac026d06f4f8a625f9a5610", + "packages/ai/src/utils/sanitize-unicode.ts": "5749c2cf0819a900e6d84f66e989562bdf4f6bb5fb45958a82b2192f73448bde", + "node_modules/openai/package.json": "3e84370c189c41e745700f55aa5535e38f6437a48d539d0e9ce02d0554863d9f" + }, + "cases": [ + { + "id": "pair-false", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic", + "reasoning": false, + "system": "", + "vision": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "requiresToolResultName": false, + "requiresAssistantAfterToolResult": false + }, + "messages": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "a", + "name": "fn_a", + "arguments": { + "2": 3, + "10": 4, + "z": [ + "\n한글", + { + "b": 1e-7, + "a": false + } + ], + "a": null, + "required": null + } + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "a", + "toolName": "result_name", + "content": [ + { + "type": "text", + "text": "first" + }, + { + "type": "text", + "text": "" + }, + { + "type": "text", + "text": "second" + } + ], + "isError": true + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic\",\"messages\":[{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"fn_a\",\"arguments\":\"{\\\"2\\\":3,\\\"10\\\":4,\\\"z\\\":[\\\"\\\\n한글\\\",{\\\"b\\\":1e-7,\\\"a\\\":false}],\\\"a\\\":null,\\\"required\\\":null}\"}}]},{\"role\":\"tool\",\"content\":\"first\\n\\nsecond\",\"tool_call_id\":\"a\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"tools\":[]}" + } + }, + { + "id": "parallel-false", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic", + "reasoning": false, + "system": "", + "vision": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "requiresToolResultName": false, + "requiresAssistantAfterToolResult": false + }, + "messages": [ + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "before" + }, + { + "type": "toolCall", + "id": "a", + "name": "fn_a", + "arguments": { + "2": 3, + "10": 4, + "z": [ + "\n한글", + { + "b": 1e-7, + "a": false + } + ], + "a": null, + "required": null + } + }, + { + "type": "text", + "text": " " + }, + { + "type": "toolCall", + "id": "b", + "name": "fn_b", + "arguments": { + "2": 3, + "10": 4, + "z": [ + "\n한글", + { + "b": 1e-7, + "a": false + } + ], + "a": null, + "required": null + } + }, + { + "type": "text", + "text": "after" + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "b ", + "toolName": "result_name", + "content": [], + "isError": true + }, + { + "role": "toolResult", + "toolCallId": "a", + "toolName": "", + "content": [ + { + "type": "text", + "text": "" + } + ], + "isError": true + }, + { + "role": "user", + "content": "next" + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic\",\"messages\":[{\"role\":\"assistant\",\"content\":\"beforeafter\",\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"fn_a\",\"arguments\":\"{\\\"2\\\":3,\\\"10\\\":4,\\\"z\\\":[\\\"\\\\n한글\\\",{\\\"b\\\":1e-7,\\\"a\\\":false}],\\\"a\\\":null,\\\"required\\\":null}\"}},{\"id\":\"b\",\"type\":\"function\",\"function\":{\"name\":\"fn_b\",\"arguments\":\"{\\\"2\\\":3,\\\"10\\\":4,\\\"z\\\":[\\\"\\\\n한글\\\",{\\\"b\\\":1e-7,\\\"a\\\":false}],\\\"a\\\":null,\\\"required\\\":null}\"}}]},{\"role\":\"tool\",\"content\":\"(see attached image)\",\"tool_call_id\":\"b\"},{\"role\":\"tool\",\"content\":\"(see attached image)\",\"tool_call_id\":\"a\"},{\"role\":\"user\",\"content\":\"next\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"tools\":[]}" + } + }, + { + "id": "missing-false", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic", + "reasoning": false, + "system": "", + "vision": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "requiresToolResultName": false, + "requiresAssistantAfterToolResult": false + }, + "messages": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "a", + "name": "fn_a", + "arguments": { + "2": 3, + "10": 4, + "z": [ + "\n한글", + { + "b": 1e-7, + "a": false + } + ], + "a": null, + "required": null + } + }, + { + "type": "toolCall", + "id": "b", + "name": "fn_b", + "arguments": { + "2": 3, + "10": 4, + "z": [ + "\n한글", + { + "b": 1e-7, + "a": false + } + ], + "a": null, + "required": null + } + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "b", + "toolName": "result_name", + "content": [ + { + "type": "text", + "text": "ok" + } + ], + "isError": true + }, + { + "role": "user", + "content": "next" + }, + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "c", + "name": "fn_c", + "arguments": { + "2": 3, + "10": 4, + "z": [ + "\n한글", + { + "b": 1e-7, + "a": false + } + ], + "a": null, + "required": null + } + } + ], + "stopReason": "toolUse" + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic\",\"messages\":[{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"fn_a\",\"arguments\":\"{\\\"2\\\":3,\\\"10\\\":4,\\\"z\\\":[\\\"\\\\n한글\\\",{\\\"b\\\":1e-7,\\\"a\\\":false}],\\\"a\\\":null,\\\"required\\\":null}\"}},{\"id\":\"b\",\"type\":\"function\",\"function\":{\"name\":\"fn_b\",\"arguments\":\"{\\\"2\\\":3,\\\"10\\\":4,\\\"z\\\":[\\\"\\\\n한글\\\",{\\\"b\\\":1e-7,\\\"a\\\":false}],\\\"a\\\":null,\\\"required\\\":null}\"}}]},{\"role\":\"tool\",\"content\":\"ok\",\"tool_call_id\":\"b\"},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"a\"},{\"role\":\"user\",\"content\":\"next\"},{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"id\":\"c\",\"type\":\"function\",\"function\":{\"name\":\"fn_c\",\"arguments\":\"{\\\"2\\\":3,\\\"10\\\":4,\\\"z\\\":[\\\"\\\\n한글\\\",{\\\"b\\\":1e-7,\\\"a\\\":false}],\\\"a\\\":null,\\\"required\\\":null}\"}}]},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"c\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"tools\":[]}" + } + }, + { + "id": "dropped-false", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic", + "reasoning": false, + "system": "", + "vision": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "requiresToolResultName": false, + "requiresAssistantAfterToolResult": false + }, + "messages": [ + { + "role": "toolResult", + "toolCallId": "orphan", + "toolName": "result_name", + "content": [], + "isError": true + }, + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "a", + "name": "fn_a", + "arguments": { + "2": 3, + "10": 4, + "z": [ + "\n한글", + { + "b": 1e-7, + "a": false + } + ], + "a": null, + "required": null + } + } + ], + "stopReason": "error" + }, + { + "role": "toolResult", + "toolCallId": "a", + "toolName": "result_name", + "content": [], + "isError": true + }, + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "b", + "name": "fn_b", + "arguments": { + "2": 3, + "10": 4, + "z": [ + "\n한글", + { + "b": 1e-7, + "a": false + } + ], + "a": null, + "required": null + } + } + ], + "stopReason": "aborted" + }, + { + "role": "toolResult", + "toolCallId": "b", + "toolName": "result_name", + "content": [], + "isError": true + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic\",\"messages\":[],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"tools\":[]}" + } + }, + { + "id": "late-false", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic", + "reasoning": false, + "system": "", + "vision": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "requiresToolResultName": false, + "requiresAssistantAfterToolResult": false + }, + "messages": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "a", + "name": "fn_a", + "arguments": { + "2": 3, + "10": 4, + "z": [ + "\n한글", + { + "b": 1e-7, + "a": false + } + ], + "a": null, + "required": null + } + } + ], + "stopReason": "toolUse" + }, + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "next" + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "a", + "toolName": "result_name", + "content": [ + { + "type": "text", + "text": "late" + } + ], + "isError": true + }, + { + "role": "toolResult", + "toolCallId": "a", + "toolName": "result_name", + "content": [ + { + "type": "text", + "text": "again" + } + ], + "isError": true + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic\",\"messages\":[{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"fn_a\",\"arguments\":\"{\\\"2\\\":3,\\\"10\\\":4,\\\"z\\\":[\\\"\\\\n한글\\\",{\\\"b\\\":1e-7,\\\"a\\\":false}],\\\"a\\\":null,\\\"required\\\":null}\"}}]},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"a\"},{\"role\":\"assistant\",\"content\":\"next\"},{\"role\":\"tool\",\"content\":\"late\",\"tool_call_id\":\"a\"},{\"role\":\"tool\",\"content\":\"again\",\"tool_call_id\":\"a\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"tools\":[]}" + } + }, + { + "id": "images-false", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic", + "reasoning": false, + "system": "", + "vision": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "requiresToolResultName": false, + "requiresAssistantAfterToolResult": false + }, + "messages": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "a", + "name": "fn_a", + "arguments": { + "2": 3, + "10": 4, + "z": [ + "\n한글", + { + "b": 1e-7, + "a": false + } + ], + "a": null, + "required": null + } + }, + { + "type": "toolCall", + "id": "b", + "name": "fn_b", + "arguments": { + "2": 3, + "10": 4, + "z": [ + "\n한글", + { + "b": 1e-7, + "a": false + } + ], + "a": null, + "required": null + } + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "b", + "toolName": "result_name", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "eA==" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "eA==" + } + ], + "isError": true + }, + { + "role": "toolResult", + "toolCallId": "a", + "toolName": "result_name", + "content": [ + { + "type": "text", + "text": "mixed" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "eA==" + } + ], + "isError": true + }, + { + "role": "user", + "content": "next" + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic\",\"messages\":[{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"fn_a\",\"arguments\":\"{\\\"2\\\":3,\\\"10\\\":4,\\\"z\\\":[\\\"\\\\n한글\\\",{\\\"b\\\":1e-7,\\\"a\\\":false}],\\\"a\\\":null,\\\"required\\\":null}\"}},{\"id\":\"b\",\"type\":\"function\",\"function\":{\"name\":\"fn_b\",\"arguments\":\"{\\\"2\\\":3,\\\"10\\\":4,\\\"z\\\":[\\\"\\\\n한글\\\",{\\\"b\\\":1e-7,\\\"a\\\":false}],\\\"a\\\":null,\\\"required\\\":null}\"}}]},{\"role\":\"tool\",\"content\":\"(tool image omitted: model does not support images)\",\"tool_call_id\":\"b\"},{\"role\":\"tool\",\"content\":\"mixed\\n(tool image omitted: model does not support images)\",\"tool_call_id\":\"a\"},{\"role\":\"user\",\"content\":\"next\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"tools\":[]}" + } + }, + { + "id": "pair-true", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic", + "reasoning": false, + "system": "", + "vision": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "requiresToolResultName": true, + "requiresAssistantAfterToolResult": true + }, + "messages": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "a", + "name": "fn_a", + "arguments": { + "2": 3, + "10": 4, + "z": [ + "\n한글", + { + "b": 1e-7, + "a": false + } + ], + "a": null, + "required": null + } + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "a", + "toolName": "result_name", + "content": [ + { + "type": "text", + "text": "first" + }, + { + "type": "text", + "text": "" + }, + { + "type": "text", + "text": "second" + } + ], + "isError": true + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic\",\"messages\":[{\"role\":\"assistant\",\"content\":\"\",\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"fn_a\",\"arguments\":\"{\\\"2\\\":3,\\\"10\\\":4,\\\"z\\\":[\\\"\\\\n한글\\\",{\\\"b\\\":1e-7,\\\"a\\\":false}],\\\"a\\\":null,\\\"required\\\":null}\"}}]},{\"role\":\"tool\",\"content\":\"first\\n\\nsecond\",\"tool_call_id\":\"a\",\"name\":\"result_name\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"tools\":[]}" + } + }, + { + "id": "parallel-true", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic", + "reasoning": false, + "system": "", + "vision": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "requiresToolResultName": true, + "requiresAssistantAfterToolResult": true + }, + "messages": [ + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "before" + }, + { + "type": "toolCall", + "id": "a", + "name": "fn_a", + "arguments": { + "2": 3, + "10": 4, + "z": [ + "\n한글", + { + "b": 1e-7, + "a": false + } + ], + "a": null, + "required": null + } + }, + { + "type": "text", + "text": " " + }, + { + "type": "toolCall", + "id": "b", + "name": "fn_b", + "arguments": { + "2": 3, + "10": 4, + "z": [ + "\n한글", + { + "b": 1e-7, + "a": false + } + ], + "a": null, + "required": null + } + }, + { + "type": "text", + "text": "after" + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "b ", + "toolName": "result_name", + "content": [], + "isError": true + }, + { + "role": "toolResult", + "toolCallId": "a", + "toolName": "", + "content": [ + { + "type": "text", + "text": "" + } + ], + "isError": true + }, + { + "role": "user", + "content": "next" + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic\",\"messages\":[{\"role\":\"assistant\",\"content\":\"beforeafter\",\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"fn_a\",\"arguments\":\"{\\\"2\\\":3,\\\"10\\\":4,\\\"z\\\":[\\\"\\\\n한글\\\",{\\\"b\\\":1e-7,\\\"a\\\":false}],\\\"a\\\":null,\\\"required\\\":null}\"}},{\"id\":\"b\",\"type\":\"function\",\"function\":{\"name\":\"fn_b\",\"arguments\":\"{\\\"2\\\":3,\\\"10\\\":4,\\\"z\\\":[\\\"\\\\n한글\\\",{\\\"b\\\":1e-7,\\\"a\\\":false}],\\\"a\\\":null,\\\"required\\\":null}\"}}]},{\"role\":\"tool\",\"content\":\"(see attached image)\",\"tool_call_id\":\"b\",\"name\":\"result_name\"},{\"role\":\"tool\",\"content\":\"(see attached image)\",\"tool_call_id\":\"a\"},{\"role\":\"assistant\",\"content\":\"I have processed the tool results.\"},{\"role\":\"user\",\"content\":\"next\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"tools\":[]}" + } + }, + { + "id": "missing-true", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic", + "reasoning": false, + "system": "", + "vision": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "requiresToolResultName": true, + "requiresAssistantAfterToolResult": true + }, + "messages": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "a", + "name": "fn_a", + "arguments": { + "2": 3, + "10": 4, + "z": [ + "\n한글", + { + "b": 1e-7, + "a": false + } + ], + "a": null, + "required": null + } + }, + { + "type": "toolCall", + "id": "b", + "name": "fn_b", + "arguments": { + "2": 3, + "10": 4, + "z": [ + "\n한글", + { + "b": 1e-7, + "a": false + } + ], + "a": null, + "required": null + } + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "b", + "toolName": "result_name", + "content": [ + { + "type": "text", + "text": "ok" + } + ], + "isError": true + }, + { + "role": "user", + "content": "next" + }, + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "c", + "name": "fn_c", + "arguments": { + "2": 3, + "10": 4, + "z": [ + "\n한글", + { + "b": 1e-7, + "a": false + } + ], + "a": null, + "required": null + } + } + ], + "stopReason": "toolUse" + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic\",\"messages\":[{\"role\":\"assistant\",\"content\":\"\",\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"fn_a\",\"arguments\":\"{\\\"2\\\":3,\\\"10\\\":4,\\\"z\\\":[\\\"\\\\n한글\\\",{\\\"b\\\":1e-7,\\\"a\\\":false}],\\\"a\\\":null,\\\"required\\\":null}\"}},{\"id\":\"b\",\"type\":\"function\",\"function\":{\"name\":\"fn_b\",\"arguments\":\"{\\\"2\\\":3,\\\"10\\\":4,\\\"z\\\":[\\\"\\\\n한글\\\",{\\\"b\\\":1e-7,\\\"a\\\":false}],\\\"a\\\":null,\\\"required\\\":null}\"}}]},{\"role\":\"tool\",\"content\":\"ok\",\"tool_call_id\":\"b\",\"name\":\"result_name\"},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"a\",\"name\":\"fn_a\"},{\"role\":\"assistant\",\"content\":\"I have processed the tool results.\"},{\"role\":\"user\",\"content\":\"next\"},{\"role\":\"assistant\",\"content\":\"\",\"tool_calls\":[{\"id\":\"c\",\"type\":\"function\",\"function\":{\"name\":\"fn_c\",\"arguments\":\"{\\\"2\\\":3,\\\"10\\\":4,\\\"z\\\":[\\\"\\\\n한글\\\",{\\\"b\\\":1e-7,\\\"a\\\":false}],\\\"a\\\":null,\\\"required\\\":null}\"}}]},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"c\",\"name\":\"fn_c\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"tools\":[]}" + } + }, + { + "id": "dropped-true", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic", + "reasoning": false, + "system": "", + "vision": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "requiresToolResultName": true, + "requiresAssistantAfterToolResult": true + }, + "messages": [ + { + "role": "toolResult", + "toolCallId": "orphan", + "toolName": "result_name", + "content": [], + "isError": true + }, + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "a", + "name": "fn_a", + "arguments": { + "2": 3, + "10": 4, + "z": [ + "\n한글", + { + "b": 1e-7, + "a": false + } + ], + "a": null, + "required": null + } + } + ], + "stopReason": "error" + }, + { + "role": "toolResult", + "toolCallId": "a", + "toolName": "result_name", + "content": [], + "isError": true + }, + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "b", + "name": "fn_b", + "arguments": { + "2": 3, + "10": 4, + "z": [ + "\n한글", + { + "b": 1e-7, + "a": false + } + ], + "a": null, + "required": null + } + } + ], + "stopReason": "aborted" + }, + { + "role": "toolResult", + "toolCallId": "b", + "toolName": "result_name", + "content": [], + "isError": true + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic\",\"messages\":[],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"tools\":[]}" + } + }, + { + "id": "late-true", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic", + "reasoning": false, + "system": "", + "vision": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "requiresToolResultName": true, + "requiresAssistantAfterToolResult": true + }, + "messages": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "a", + "name": "fn_a", + "arguments": { + "2": 3, + "10": 4, + "z": [ + "\n한글", + { + "b": 1e-7, + "a": false + } + ], + "a": null, + "required": null + } + } + ], + "stopReason": "toolUse" + }, + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "next" + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "a", + "toolName": "result_name", + "content": [ + { + "type": "text", + "text": "late" + } + ], + "isError": true + }, + { + "role": "toolResult", + "toolCallId": "a", + "toolName": "result_name", + "content": [ + { + "type": "text", + "text": "again" + } + ], + "isError": true + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic\",\"messages\":[{\"role\":\"assistant\",\"content\":\"\",\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"fn_a\",\"arguments\":\"{\\\"2\\\":3,\\\"10\\\":4,\\\"z\\\":[\\\"\\\\n한글\\\",{\\\"b\\\":1e-7,\\\"a\\\":false}],\\\"a\\\":null,\\\"required\\\":null}\"}}]},{\"role\":\"tool\",\"content\":\"No result provided\",\"tool_call_id\":\"a\",\"name\":\"fn_a\"},{\"role\":\"assistant\",\"content\":\"next\"},{\"role\":\"tool\",\"content\":\"late\",\"tool_call_id\":\"a\",\"name\":\"result_name\"},{\"role\":\"tool\",\"content\":\"again\",\"tool_call_id\":\"a\",\"name\":\"result_name\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"tools\":[]}" + } + }, + { + "id": "images-true", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic", + "reasoning": false, + "system": "", + "vision": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false, + "requiresToolResultName": true, + "requiresAssistantAfterToolResult": true + }, + "messages": [ + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "a", + "name": "fn_a", + "arguments": { + "2": 3, + "10": 4, + "z": [ + "\n한글", + { + "b": 1e-7, + "a": false + } + ], + "a": null, + "required": null + } + }, + { + "type": "toolCall", + "id": "b", + "name": "fn_b", + "arguments": { + "2": 3, + "10": 4, + "z": [ + "\n한글", + { + "b": 1e-7, + "a": false + } + ], + "a": null, + "required": null + } + } + ], + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "b", + "toolName": "result_name", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "eA==" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "eA==" + } + ], + "isError": true + }, + { + "role": "toolResult", + "toolCallId": "a", + "toolName": "result_name", + "content": [ + { + "type": "text", + "text": "mixed" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "eA==" + } + ], + "isError": true + }, + { + "role": "user", + "content": "next" + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic\",\"messages\":[{\"role\":\"assistant\",\"content\":\"\",\"tool_calls\":[{\"id\":\"a\",\"type\":\"function\",\"function\":{\"name\":\"fn_a\",\"arguments\":\"{\\\"2\\\":3,\\\"10\\\":4,\\\"z\\\":[\\\"\\\\n한글\\\",{\\\"b\\\":1e-7,\\\"a\\\":false}],\\\"a\\\":null,\\\"required\\\":null}\"}},{\"id\":\"b\",\"type\":\"function\",\"function\":{\"name\":\"fn_b\",\"arguments\":\"{\\\"2\\\":3,\\\"10\\\":4,\\\"z\\\":[\\\"\\\\n한글\\\",{\\\"b\\\":1e-7,\\\"a\\\":false}],\\\"a\\\":null,\\\"required\\\":null}\"}}]},{\"role\":\"tool\",\"content\":\"(see attached image)\",\"tool_call_id\":\"b\",\"name\":\"result_name\"},{\"role\":\"tool\",\"content\":\"mixed\",\"tool_call_id\":\"a\",\"name\":\"result_name\"},{\"role\":\"assistant\",\"content\":\"I have processed the tool results.\"},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Attached image(s) from tool result:\"},{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,eA==\"}},{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,eA==\"}},{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,eA==\"}}]},{\"role\":\"user\",\"content\":\"next\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"tools\":[]}" + } + } + ] +} diff --git a/native/omk-providers/tests/fixtures/openai-completions.json b/native/omk-providers/tests/fixtures/openai-completions.json new file mode 100644 index 0000000000..ad391db0e9 --- /dev/null +++ b/native/omk-providers/tests/fixtures/openai-completions.json @@ -0,0 +1,908 @@ +{ + "schema": "omk.openai-completions-request.v1", + "source": { + "scripts/fixtures/openai-completions-recorder.ts": "ae30ce572afd39250a498534fad253f8e86d13600b38907ff403fc4eb903a8a4", + "packages/ai/src/providers/openai-completions.ts": "35213516c93dd6b8bb777a90a8a2b9f2f280a6ef005c12cbeda7f953ba73a658", + "packages/ai/src/providers/openai-completions-compat.ts": "455262725e7f9c0b1d3a5782d94d58c78770d9ef6a0f35be8706bd3ce539f182", + "packages/ai/src/providers/tool-schema.ts": "523a0642c2c62b48d84efd9c81e4a58e83f39a217dbcc5512ff3983bdedd9edb", + "packages/ai/src/providers/transform-messages.ts": "f60d2e3c7db909eb9d80d6b670bf0d7fed8aa318aac026d06f4f8a625f9a5610", + "packages/ai/src/utils/sanitize-unicode.ts": "5749c2cf0819a900e6d84f66e989562bdf4f6bb5fb45958a82b2192f73448bde", + "node_modules/openai/package.json": "3e84370c189c41e745700f55aa5535e38f6437a48d539d0e9ce02d0554863d9f" + }, + "cases": [ + { + "id": "basic", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello 🌍" + } + ], + "tools": [], + "maxTokens": 64 + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "reasoning-developer", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello 🌍" + } + ], + "tools": [], + "maxTokens": 64 + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"developer\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "reasoning-system", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": true, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": false, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello 🌍" + } + ], + "tools": [], + "maxTokens": 64 + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "empty-system", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "", + "messages": [ + { + "role": "user", + "content": "Hello 🌍" + } + ], + "tools": [], + "maxTokens": 64 + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "empty-system-first", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": true + }, + "system": "", + "messages": [ + { + "role": "user", + "content": "Hello 🌍" + } + ], + "tools": [], + "maxTokens": 64 + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"\"},{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "legacy-fields", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": false, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": false, + "maxTokensField": "max_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello 🌍" + } + ], + "tools": [], + "maxTokens": 64 + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"stream\":true,\"max_tokens\":64}" + } + }, + { + "id": "no-max-tokens", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello 🌍" + } + ], + "tools": [] + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false}" + } + }, + { + "id": "zero-max-tokens", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello 🌍" + } + ], + "tools": [], + "maxTokens": 0 + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false}" + } + }, + { + "id": "temperature", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello 🌍" + } + ], + "tools": [], + "maxTokens": 64, + "temperature": 0.7 + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"temperature\":0.7}" + } + }, + { + "id": "temperature-zero", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello 🌍" + } + ], + "tools": [], + "maxTokens": 64, + "temperature": 0 + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"temperature\":0}" + } + }, + { + "id": "temperature-small", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello 🌍" + } + ], + "tools": [], + "maxTokens": 64, + "temperature": 1e-7 + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"temperature\":1e-7}" + } + }, + { + "id": "tools-sorted", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello 🌍" + } + ], + "tools": [ + { + "name": "write", + "description": "Synthetic write", + "properties": { + "path": { + "type": "string" + }, + "content": { + "type": "string" + } + }, + "required": [ + "path", + "content" + ] + }, + { + "name": "read", + "description": "Synthetic read", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "Read", + "description": "Synthetic Read", + "properties": "x", + "required": [] + } + ], + "maxTokens": 64 + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"read\",\"description\":\"Synthetic read\",\"parameters\":{\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"strict\":false}},{\"type\":\"function\",\"function\":{\"name\":\"Read\",\"description\":\"Synthetic Read\",\"parameters\":{\"properties\":{},\"required\":[],\"type\":\"object\"},\"strict\":false}},{\"type\":\"function\",\"function\":{\"name\":\"write\",\"description\":\"Synthetic write\",\"parameters\":{\"properties\":{\"content\":{\"type\":\"string\"},\"path\":{\"type\":\"string\"}},\"required\":[\"path\",\"content\"],\"type\":\"object\"},\"strict\":false}}]}" + } + }, + { + "id": "tools-no-strict", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": false, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello 🌍" + } + ], + "tools": [ + { + "name": "read", + "description": "Synthetic read", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + } + ], + "maxTokens": 64 + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"read\",\"description\":\"Synthetic read\",\"parameters\":{\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}}}]}" + } + }, + { + "id": "choice-auto", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello 🌍" + } + ], + "tools": [ + { + "name": "read", + "description": "Synthetic read", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + } + ], + "maxTokens": 64, + "toolChoice": "auto" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"read\",\"description\":\"Synthetic read\",\"parameters\":{\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"strict\":false}}],\"tool_choice\":\"auto\"}" + } + }, + { + "id": "choice-none", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello 🌍" + } + ], + "tools": [ + { + "name": "read", + "description": "Synthetic read", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + } + ], + "maxTokens": 64, + "toolChoice": "none" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"read\",\"description\":\"Synthetic read\",\"parameters\":{\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"strict\":false}}],\"tool_choice\":\"none\"}" + } + }, + { + "id": "choice-required", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello 🌍" + } + ], + "tools": [ + { + "name": "read", + "description": "Synthetic read", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + } + ], + "maxTokens": 64, + "toolChoice": "required" + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"read\",\"description\":\"Synthetic read\",\"parameters\":{\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"strict\":false}}],\"tool_choice\":\"required\"}" + } + }, + { + "id": "choice-function", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello 🌍" + } + ], + "tools": [ + { + "name": "read", + "description": "Synthetic read", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + } + ], + "maxTokens": 64, + "toolChoice": { + "type": "function", + "function": { + "name": "read" + } + } + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64,\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"read\",\"description\":\"Synthetic read\",\"parameters\":{\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"strict\":false}}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"read\"}}}" + } + }, + { + "id": "history", + "input": { + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "first" + }, + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "one " + }, + { + "type": "text", + "text": " " + }, + { + "type": "text", + "text": "two" + } + ] + }, + { + "role": "user", + "content": [ + { + "type": "text", + "text": "block a" + }, + { + "type": "text", + "text": "block b" + } + ] + }, + { + "role": "user", + "content": [] + }, + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": " \t" + } + ] + }, + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "" + } + ] + }, + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "…" + } + ] + }, + { + "role": "assistant", + "content": [] + }, + { + "role": "user", + "content": "" + } + ], + "tools": [], + "maxTokens": 64 + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"first\"},{\"role\":\"assistant\",\"content\":\"one two\"},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"block a\"},{\"type\":\"text\",\"text\":\"block b\"}]},{\"role\":\"assistant\",\"content\":\"…\"},{\"role\":\"user\",\"content\":\"\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "base-trailing-slash", + "input": { + "baseUrl": "https://synthetic.invalid/v1/", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello 🌍" + } + ], + "tools": [], + "maxTokens": 64 + }, + "request": { + "url": "https://synthetic.invalid/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "base-root", + "input": { + "baseUrl": "https://synthetic.invalid", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello 🌍" + } + ], + "tools": [], + "maxTokens": 64 + }, + "request": { + "url": "https://synthetic.invalid/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + }, + { + "id": "base-loopback-port", + "input": { + "baseUrl": "http://127.0.0.1:8080/openai/v1", + "model": "synthetic-completions", + "reasoning": false, + "compat": { + "supportsStore": true, + "supportsDeveloperRole": true, + "supportsUsageInStreaming": true, + "maxTokensField": "max_completion_tokens", + "supportsStrictMode": true, + "requiresSystemMessageFirst": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello 🌍" + } + ], + "tools": [], + "maxTokens": 64 + }, + "request": { + "url": "http://127.0.0.1:8080/openai/v1/chat/completions", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-completions\",\"messages\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":\"Hello 🌍\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"store\":false,\"max_completion_tokens\":64}" + } + } + ] +} diff --git a/native/omk-providers/tests/fixtures/openai-responses-headers.json b/native/omk-providers/tests/fixtures/openai-responses-headers.json new file mode 100644 index 0000000000..2f6b311666 --- /dev/null +++ b/native/omk-providers/tests/fixtures/openai-responses-headers.json @@ -0,0 +1,518 @@ +{ + "schema": "omk.openai-responses-headers.v1", + "source": { + "scripts/fixtures/openai-responses-headers-recorder.ts": "5a45ae024e17aa659b73bdc9baaaad6475ed098142f2695ee2998a194c769efa", + "packages/ai/src/providers/openai-responses.ts": "e24fd470213a6ef6c4c23c88bf1de8e32023048cb4c659836a75389e008cf5ff", + "node_modules/openai/internal/headers.js": "b4baaa26184fd91e7fd6b6f0215eb631a8c4c84b76c5eba3664e1c7e077011ae", + "node_modules/openai/client.js": "7ceed4b8b719d529d76f46c8c2860bd445ad0c76dd1c187598489292951be7e2", + "node_modules/openai/package.json": "3e84370c189c41e745700f55aa5535e38f6437a48d539d0e9ce02d0554863d9f" + }, + "cases": [ + { + "id": "model-only", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "modelHeaders": { + "X-Model": "m", + "x-shared": "model" + } + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "x-model": "m", + "x-shared": "model" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "options-only", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "headers": { + "X-Option": "o" + } + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "x-option": "o" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "options-override-model", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "modelHeaders": { + "X-Shared": "model", + "x-keep": "k" + }, + "headers": { + "X-Shared": "option" + } + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "x-keep": "k", + "x-shared": "option" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "options-override-other-case", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "modelHeaders": { + "X-Shared": "model" + }, + "headers": { + "x-shared": "option" + } + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "x-shared": "option" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "case-collision-position", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "modelHeaders": { + "X-A": "1", + "x-a": "2" + }, + "headers": { + "X-A": "3" + } + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "x-a": "2" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "index-keys-first", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "modelHeaders": { + "2": "two", + "10": "ten", + "x-b": "b" + }, + "headers": { + "02": "zero-two" + } + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "2": "two", + "10": "ten", + "02": "zero-two", + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "x-b": "b" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "session-then-model", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "modelHeaders": { + "session_id": "model-session", + "x-client-request-id": "model-req" + }, + "sessionId": "sess-1" + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "session_id": "sess-1", + "x-client-request-id": "sess-1" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"prompt_cache_key\":\"sess-1\",\"store\":false}" + } + }, + { + "id": "session-in-place-before-cased-key", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "modelHeaders": { + "session_id": "model-lower", + "SESSION_ID": "model-upper" + }, + "sessionId": "sess-1" + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "session_id": "model-upper", + "x-client-request-id": "sess-1" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"prompt_cache_key\":\"sess-1\",\"store\":false}" + } + }, + { + "id": "options-override-session", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "headers": { + "session_id": "opt-session", + "X-Client-Request-Id": "opt-req" + }, + "sessionId": "sess-1" + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "session_id": "opt-session", + "x-client-request-id": "opt-req" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"prompt_cache_key\":\"sess-1\",\"store\":false}" + } + }, + { + "id": "session-header-disabled-model-kept", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "compat": { + "sendSessionIdHeader": false + }, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "modelHeaders": { + "session_id": "model-session" + }, + "sessionId": "sess-1" + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "session_id": "model-session", + "x-client-request-id": "sess-1" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"prompt_cache_key\":\"sess-1\",\"store\":false}" + } + }, + { + "id": "retention-none-model-session", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "modelHeaders": { + "session_id": "model-session" + }, + "sessionId": "sess-1", + "cacheRetention": "none" + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "session_id": "model-session" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "override-sdk-defaults", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "headers": { + "Accept": "text/event-stream", + "Authorization": "Bearer synthetic-override" + } + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "text/event-stream", + "authorization": "Bearer synthetic-override", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "content-type-is-sdk-owned", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "modelHeaders": { + "Content-Type": "text/plain" + }, + "headers": { + "content-type": "application/x-ndjson" + } + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "empty-and-inner-space", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "modelHeaders": { + "x-empty": "", + "x-inner": "a b\tc" + } + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "x-empty": "", + "x-inner": "a b\tc" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "token-punctuation", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "headers": { + "X-!#$%&'*+-.^_`|~": "v", + "x-value": "A-z_0.9~!#$%&'*+^`|\"()/:;<=>?@[\\]{}" + } + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "x-!#$%&'*+-.^_`|~": "v", + "x-value": "A-z_0.9~!#$%&'*+^`|\"()/:;<=>?@[\\]{}" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "empty-objects", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "modelHeaders": {}, + "headers": {} + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false}" + } + } + ] +} diff --git a/native/omk-providers/tests/fixtures/openai-responses-history.json b/native/omk-providers/tests/fixtures/openai-responses-history.json new file mode 100644 index 0000000000..34e940b7a1 --- /dev/null +++ b/native/omk-providers/tests/fixtures/openai-responses-history.json @@ -0,0 +1,3919 @@ +{ + "schema": "omk.openai-responses-history.v1", + "source": { + "scripts/fixtures/openai-responses-history-recorder.ts": "76444fafbb5d997254a04ac67fd0f81c9a66e9621c25f449ccdf3a6ed4f2a597", + "packages/ai/src/providers/openai-responses.ts": "e24fd470213a6ef6c4c23c88bf1de8e32023048cb4c659836a75389e008cf5ff", + "packages/ai/src/providers/openai-responses-shared.ts": "2b4b75585ee88793845e00260e4fd177be5e9ac4f5dec53521e7bc6ae6948311", + "packages/ai/src/providers/transform-messages.ts": "f60d2e3c7db909eb9d80d6b670bf0d7fed8aa318aac026d06f4f8a625f9a5610", + "packages/ai/src/utils/hash.ts": "2cdfce4af41810d1a92c7f0a55c78637a3173041038aafd85b378be345761ed8", + "packages/ai/src/utils/sanitize-unicode.ts": "5749c2cf0819a900e6d84f66e989562bdf4f6bb5fb45958a82b2192f73448bde", + "node_modules/openai/package.json": "3e84370c189c41e745700f55aa5535e38f6437a48d539d0e9ce02d0554863d9f" + }, + "cases": [ + { + "id": "same-tool-turn", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hi" + }, + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "Calling", + "textSignature": "{\"v\":1,\"id\":\"msg_1\"}" + }, + { + "type": "toolCall", + "id": "call_1|fc_1", + "name": "f", + "arguments": { + "10": "x", + "z": 1, + "a": { + "2": true, + "b": [ + 1.5, + 0, + 1e+21 + ] + }, + "é": null + } + } + ], + "source": { + "provider": "synthetic", + "api": "openai-responses", + "model": "synthetic-responses" + } + }, + { + "role": "toolResult", + "toolCallId": "call_1|fc_1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "out" + } + ], + "isError": false + }, + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "Done" + } + ], + "source": { + "provider": "synthetic", + "api": "openai-responses", + "model": "synthetic-responses" + } + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hi\"}]},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Calling\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_1\"},{\"type\":\"function_call\",\"id\":\"fc_1\",\"call_id\":\"call_1\",\"name\":\"f\",\"arguments\":\"{\\\"10\\\":\\\"x\\\",\\\"z\\\":1,\\\"a\\\":{\\\"2\\\":true,\\\"b\\\":[1.5,0,1e+21]},\\\"é\\\":null}\"},{\"type\":\"function_call_output\",\"call_id\":\"call_1\",\"output\":\"out\"},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Done\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_omk_3\"}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "same-reasoning", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": true, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hi" + }, + { + "role": "assistant", + "content": [ + { + "type": "thinking", + "thinking": "visible", + "thinkingSignature": "{\"type\":\"reasoning\",\"id\":\"rs_1\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"s\"}],\"encrypted_content\":\"enc\",\"10\":1.50,\"2\":-0}" + }, + { + "type": "thinking", + "thinking": " \t ", + "thinkingSignature": "{\"type\":\"reasoning\",\"id\":\"rs_blank\"}" + }, + { + "type": "thinking", + "thinking": "unsigned" + }, + { + "type": "thinking", + "thinking": "opaque", + "thinkingSignature": "{\"type\":\"reasoning\",\"id\":\"rs_redacted\"}", + "redacted": true + }, + { + "type": "thinking", + "thinking": "empty-sig", + "thinkingSignature": "" + }, + { + "type": "text", + "text": "answer", + "textSignature": "{\"v\":1,\"id\":\"msg_2\",\"phase\":\"final_answer\"}" + } + ], + "source": { + "provider": "synthetic", + "api": "openai-responses", + "model": "synthetic-responses" + } + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"developer\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hi\"}]},{\"2\":0,\"10\":1.5,\"type\":\"reasoning\",\"id\":\"rs_1\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"s\"}],\"encrypted_content\":\"enc\"},{\"type\":\"reasoning\",\"id\":\"rs_redacted\"},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"answer\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_2\",\"phase\":\"final_answer\"}],\"stream\":true,\"store\":false,\"reasoning\":{\"effort\":\"none\"}}" + } + }, + { + "id": "text-signatures", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "Hi" + }, + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "a", + "textSignature": "{\"v\":1,\"id\":\"msg_c\",\"phase\":\"commentary\"}" + }, + { + "type": "text", + "text": "b", + "textSignature": "{\"v\":1,\"id\":\"msg_bad_phase\",\"phase\":\"other\"}" + }, + { + "type": "text", + "text": "c", + "textSignature": "{\"v\":1,\"id\":\"\"}" + }, + { + "type": "text", + "text": "d", + "textSignature": "legacy_plain_id" + }, + { + "type": "text", + "text": "e", + "textSignature": "{\"v\":1,\"id\":\"mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm\"}" + }, + { + "type": "text", + "text": "f", + "textSignature": "{\"v\":1,\"id\":\"😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀\"}" + }, + { + "type": "text", + "text": "g", + "textSignature": "{\"v\":1,\"id\":\"😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀\"}" + }, + { + "type": "text", + "text": "h", + "textSignature": "{\"v\":2,\"id\":\"x\"}" + }, + { + "type": "text", + "text": "i", + "textSignature": "{\"v\":1,\"id\":7}" + }, + { + "type": "text", + "text": "j", + "textSignature": "{\"v\":1.0,\"id\":\"one-point-zero\"}" + }, + { + "type": "text", + "text": "k", + "textSignature": "{\"v\":1,\"id\":\"dup\",\"id\":\"last\"}" + }, + { + "type": "text", + "text": "l" + }, + { + "type": "text", + "text": "m", + "textSignature": "" + } + ], + "source": { + "provider": "synthetic", + "api": "openai-responses", + "model": "synthetic-responses" + } + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hi\"}]},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"a\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_c\",\"phase\":\"commentary\"},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"b\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_bad_phase\"},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"c\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_omk_1_2\"},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"d\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"legacy_plain_id\"},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"e\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_4tg0y8defk0h\"},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"f\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_smzk6g1t3negr\"},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"g\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀😀\"},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"h\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"{\\\"v\\\":2,\\\"id\\\":\\\"x\\\"}\"},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"i\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"{\\\"v\\\":1,\\\"id\\\":7}\"},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"j\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"one-point-zero\"},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"k\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"last\"},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"l\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_omk_1_11\"},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"m\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_omk_1_12\"}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "message-index", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": [] + }, + { + "role": "user", + "content": "x" + }, + { + "role": "assistant", + "content": [ + { + "type": "thinking", + "thinking": " " + } + ], + "source": { + "provider": "synthetic", + "api": "openai-responses", + "model": "synthetic-responses" + } + }, + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "first" + }, + { + "type": "text", + "text": "second" + } + ], + "source": { + "provider": "synthetic", + "api": "openai-responses", + "model": "synthetic-responses" + } + }, + { + "role": "user", + "content": [ + { + "type": "text", + "text": "" + } + ] + }, + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "third" + } + ], + "source": { + "provider": "synthetic", + "api": "openai-responses", + "model": "synthetic-responses" + } + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"x\"}]},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"first\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_omk_1\"},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"second\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_omk_1_1\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"\"}]},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"third\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_omk_3\"}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "pairing", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "go" + }, + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "dead|fc_dead", + "name": "f", + "arguments": { + "z": 1, + "a": 2 + } + } + ], + "stopReason": "error", + "source": { + "provider": "synthetic", + "api": "openai-responses", + "model": "synthetic-responses" + } + }, + { + "role": "toolResult", + "toolCallId": "dead|fc_dead", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "dropped" + } + ], + "isError": false + }, + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "gone|fc_gone", + "name": "f", + "arguments": { + "z": 1, + "a": 2 + } + } + ], + "stopReason": "aborted", + "source": { + "provider": "synthetic", + "api": "openai-responses", + "model": "synthetic-responses" + } + }, + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "a|fc_a", + "name": "f", + "arguments": { + "z": 1, + "a": 2 + } + }, + { + "type": "toolCall", + "id": "b|fc_b", + "name": "f", + "arguments": { + "z": 1, + "a": 2 + } + }, + { + "type": "toolCall", + "id": "|fc_empty", + "name": "f", + "arguments": { + "z": 1, + "a": 2 + } + } + ], + "stopReason": "toolUse", + "source": { + "provider": "synthetic", + "api": "openai-responses", + "model": "synthetic-responses" + } + }, + { + "role": "toolResult", + "toolCallId": " a|fc_a\n", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "padded" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "unknown|fc_u", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "orphan" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "blank" + } + ], + "isError": false + }, + { + "role": "user", + "content": "interrupt" + }, + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "tail|fc_tail", + "name": "f", + "arguments": { + "z": 1, + "a": 2 + } + } + ], + "source": { + "provider": "synthetic", + "api": "openai-responses", + "model": "synthetic-responses" + } + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"go\"}]},{\"type\":\"function_call\",\"id\":\"fc_a\",\"call_id\":\"a\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":2}\"},{\"type\":\"function_call\",\"id\":\"fc_b\",\"call_id\":\"b\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":2}\"},{\"type\":\"function_call\",\"id\":\"fc_empty\",\"call_id\":\"\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":2}\"},{\"type\":\"function_call_output\",\"call_id\":\"a\",\"output\":\"padded\"},{\"type\":\"function_call_output\",\"call_id\":\"b\",\"output\":\"No result provided\"},{\"type\":\"function_call_output\",\"call_id\":\"\",\"output\":\"No result provided\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"interrupt\"}]},{\"type\":\"function_call\",\"id\":\"fc_tail\",\"call_id\":\"tail\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":2}\"},{\"type\":\"function_call_output\",\"call_id\":\"tail\",\"output\":\"No result provided\"}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "tool-results", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "go" + }, + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "r1|fc_1", + "name": "f", + "arguments": { + "z": 1, + "a": 2 + } + }, + { + "type": "toolCall", + "id": "r2|fc_2", + "name": "f", + "arguments": { + "z": 1, + "a": 2 + } + }, + { + "type": "toolCall", + "id": "r3|fc_3", + "name": "f", + "arguments": { + "z": 1, + "a": 2 + } + }, + { + "type": "toolCall", + "id": "r4|fc_4", + "name": "f", + "arguments": { + "z": 1, + "a": 2 + } + } + ], + "source": { + "provider": "synthetic", + "api": "openai-responses", + "model": "synthetic-responses" + } + }, + { + "role": "toolResult", + "toolCallId": "r1|fc_1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "line1" + }, + { + "type": "text", + "text": "line2" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "r2|fc_2", + "toolName": "f", + "content": [], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "r3|fc_3", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "r4|fc_4", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "😀 \"q\"" + } + ], + "isError": true + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"go\"}]},{\"type\":\"function_call\",\"id\":\"fc_1\",\"call_id\":\"r1\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":2}\"},{\"type\":\"function_call\",\"id\":\"fc_2\",\"call_id\":\"r2\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":2}\"},{\"type\":\"function_call\",\"id\":\"fc_3\",\"call_id\":\"r3\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":2}\"},{\"type\":\"function_call\",\"id\":\"fc_4\",\"call_id\":\"r4\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":2}\"},{\"type\":\"function_call_output\",\"call_id\":\"r1\",\"output\":\"line1\\nline2\"},{\"type\":\"function_call_output\",\"call_id\":\"r2\",\"output\":\"(see attached image)\"},{\"type\":\"function_call_output\",\"call_id\":\"r3\",\"output\":\"(see attached image)\"},{\"type\":\"function_call_output\",\"call_id\":\"r4\",\"output\":\"😀 \\\"q\\\"\"}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "same-call-ids", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "go" + }, + { + "role": "assistant", + "content": [ + { + "type": "toolCall", + "id": "plain", + "name": "f", + "arguments": { + "z": 1, + "a": 2 + } + }, + { + "type": "toolCall", + "id": "raw|", + "name": "f", + "arguments": { + "z": 1, + "a": 2 + } + }, + { + "type": "toolCall", + "id": "|", + "name": "f", + "arguments": { + "z": 1, + "a": 2 + } + }, + { + "type": "toolCall", + "id": "a|b|c", + "name": "f", + "arguments": { + "z": 1, + "a": 2 + } + }, + { + "type": "toolCall", + "id": "c|rs_1", + "name": "f", + "arguments": { + "z": 1, + "a": 2 + } + }, + { + "type": "toolCall", + "id": "we+ird|it/😀", + "name": "f", + "arguments": { + "z": 1, + "a": 2 + } + } + ], + "source": { + "provider": "synthetic", + "api": "openai-responses", + "model": "synthetic-responses" + } + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"go\"}]},{\"type\":\"function_call\",\"call_id\":\"plain\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":2}\"},{\"type\":\"function_call\",\"id\":\"\",\"call_id\":\"raw\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":2}\"},{\"type\":\"function_call\",\"id\":\"\",\"call_id\":\"\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":2}\"},{\"type\":\"function_call\",\"id\":\"b\",\"call_id\":\"a\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":2}\"},{\"type\":\"function_call\",\"id\":\"rs_1\",\"call_id\":\"c\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":2}\"},{\"type\":\"function_call\",\"id\":\"it/😀\",\"call_id\":\"we+ird\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":2}\"},{\"type\":\"function_call_output\",\"call_id\":\"plain\",\"output\":\"No result provided\"},{\"type\":\"function_call_output\",\"call_id\":\"raw\",\"output\":\"No result provided\"},{\"type\":\"function_call_output\",\"call_id\":\"\",\"output\":\"No result provided\"},{\"type\":\"function_call_output\",\"call_id\":\"a\",\"output\":\"No result provided\"},{\"type\":\"function_call_output\",\"call_id\":\"c\",\"output\":\"No result provided\"},{\"type\":\"function_call_output\",\"call_id\":\"we+ird\",\"output\":\"No result provided\"}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "cross-synthetic-none", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "go" + }, + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "start", + "textSignature": "{\"v\":1,\"id\":\"msg_src\",\"phase\":\"commentary\"}" + }, + { + "type": "thinking", + "thinking": "visible", + "thinkingSignature": "{\"type\":\"reasoning\",\"id\":\"rs_src\"}" + }, + { + "type": "thinking", + "thinking": "opaque", + "thinkingSignature": "{\"type\":\"reasoning\",\"id\":\"rs_red\"}", + "redacted": true + }, + { + "type": "thinking", + "thinking": " \t" + }, + { + "type": "toolCall", + "id": "call+|it😀/1", + "name": "f", + "arguments": { + "z": 0, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "name": "f", + "arguments": { + "z": 1, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "plain-id", + "name": "f", + "arguments": { + "z": 2, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "raw|", + "name": "f", + "arguments": { + "z": 3, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "|", + "name": "f", + "arguments": { + "z": 4, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "a|b|c", + "name": "f", + "arguments": { + "z": 5, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "c|fc_x", + "name": "f", + "arguments": { + "z": 6, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "c|rs_1", + "name": "f", + "arguments": { + "z": 7, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "trail___|item___", + "name": "f", + "arguments": { + "z": 8, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "name": "f", + "arguments": { + "z": 9, + "a": 1 + } + } + ], + "source": { + "provider": "synthetic", + "api": "openai-responses", + "model": "synthetic-responses" + }, + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-9" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "trail___|item___", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-8" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c|rs_1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-7" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c|fc_x", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-6" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "a|b|c", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-5" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-4" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "raw|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-3" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "plain-id", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-2" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-1" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call+|it😀/1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-0" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"go\"}]},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"start\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_src\",\"phase\":\"commentary\"},{\"type\":\"reasoning\",\"id\":\"rs_src\"},{\"type\":\"reasoning\",\"id\":\"rs_red\"},{\"type\":\"function_call\",\"id\":\"it😀/1\",\"call_id\":\"call+\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":0,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"B+/=😀\",\"call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"plain-id\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":2,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"\",\"call_id\":\"raw\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":3,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"\",\"call_id\":\"\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":4,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"b\",\"call_id\":\"a\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":5,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_x\",\"call_id\":\"c\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":6,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"rs_1\",\"call_id\":\"c\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":7,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"item___\",\"call_id\":\"trail___\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":8,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":9,\\\"a\\\":1}\"},{\"type\":\"function_call_output\",\"call_id\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"output\":\"result-9\"},{\"type\":\"function_call_output\",\"call_id\":\"trail___\",\"output\":\"result-8\"},{\"type\":\"function_call_output\",\"call_id\":\"c\",\"output\":\"result-7\"},{\"type\":\"function_call_output\",\"call_id\":\"c\",\"output\":\"result-6\"},{\"type\":\"function_call_output\",\"call_id\":\"a\",\"output\":\"result-5\"},{\"type\":\"function_call_output\",\"call_id\":\"\",\"output\":\"result-4\"},{\"type\":\"function_call_output\",\"call_id\":\"raw\",\"output\":\"result-3\"},{\"type\":\"function_call_output\",\"call_id\":\"plain-id\",\"output\":\"result-2\"},{\"type\":\"function_call_output\",\"call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"output\":\"result-1\"},{\"type\":\"function_call_output\",\"call_id\":\"call+\",\"output\":\"result-0\"}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "cross-synthetic-provider", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "go" + }, + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "start", + "textSignature": "{\"v\":1,\"id\":\"msg_src\",\"phase\":\"commentary\"}" + }, + { + "type": "thinking", + "thinking": "visible", + "thinkingSignature": "{\"type\":\"reasoning\",\"id\":\"rs_src\"}" + }, + { + "type": "thinking", + "thinking": "opaque", + "thinkingSignature": "{\"type\":\"reasoning\",\"id\":\"rs_red\"}", + "redacted": true + }, + { + "type": "thinking", + "thinking": " \t" + }, + { + "type": "toolCall", + "id": "call+|it😀/1", + "name": "f", + "arguments": { + "z": 0, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "name": "f", + "arguments": { + "z": 1, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "plain-id", + "name": "f", + "arguments": { + "z": 2, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "raw|", + "name": "f", + "arguments": { + "z": 3, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "|", + "name": "f", + "arguments": { + "z": 4, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "a|b|c", + "name": "f", + "arguments": { + "z": 5, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "c|fc_x", + "name": "f", + "arguments": { + "z": 6, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "c|rs_1", + "name": "f", + "arguments": { + "z": 7, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "trail___|item___", + "name": "f", + "arguments": { + "z": 8, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "name": "f", + "arguments": { + "z": 9, + "a": 1 + } + } + ], + "source": { + "provider": "foreign", + "api": "openai-responses", + "model": "synthetic-responses" + }, + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-9" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "trail___|item___", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-8" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c|rs_1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-7" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c|fc_x", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-6" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "a|b|c", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-5" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-4" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "raw|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-3" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "plain-id", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-2" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-1" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call+|it😀/1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-0" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"go\"}]},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"start\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_omk_1\"},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"visible\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_omk_1_1\"},{\"type\":\"function_call\",\"call_id\":\"call__it___1\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":0,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"plain-id\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":2,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"raw\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":3,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":4,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"a_b_c\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":5,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"c_fc_x\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":6,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"c_rs_1\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":7,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"trail____item\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":8,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":9,\\\"a\\\":1}\"},{\"type\":\"function_call_output\",\"call_id\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"output\":\"result-9\"},{\"type\":\"function_call_output\",\"call_id\":\"trail____item\",\"output\":\"result-8\"},{\"type\":\"function_call_output\",\"call_id\":\"c_rs_1\",\"output\":\"result-7\"},{\"type\":\"function_call_output\",\"call_id\":\"c_fc_x\",\"output\":\"result-6\"},{\"type\":\"function_call_output\",\"call_id\":\"a_b_c\",\"output\":\"result-5\"},{\"type\":\"function_call_output\",\"call_id\":\"raw\",\"output\":\"result-3\"},{\"type\":\"function_call_output\",\"call_id\":\"plain-id\",\"output\":\"result-2\"},{\"type\":\"function_call_output\",\"call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"output\":\"result-1\"},{\"type\":\"function_call_output\",\"call_id\":\"call__it___1\",\"output\":\"result-0\"},{\"type\":\"function_call_output\",\"call_id\":\"\",\"output\":\"No result provided\"}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "cross-synthetic-api", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "go" + }, + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "start", + "textSignature": "{\"v\":1,\"id\":\"msg_src\",\"phase\":\"commentary\"}" + }, + { + "type": "thinking", + "thinking": "visible", + "thinkingSignature": "{\"type\":\"reasoning\",\"id\":\"rs_src\"}" + }, + { + "type": "thinking", + "thinking": "opaque", + "thinkingSignature": "{\"type\":\"reasoning\",\"id\":\"rs_red\"}", + "redacted": true + }, + { + "type": "thinking", + "thinking": " \t" + }, + { + "type": "toolCall", + "id": "call+|it😀/1", + "name": "f", + "arguments": { + "z": 0, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "name": "f", + "arguments": { + "z": 1, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "plain-id", + "name": "f", + "arguments": { + "z": 2, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "raw|", + "name": "f", + "arguments": { + "z": 3, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "|", + "name": "f", + "arguments": { + "z": 4, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "a|b|c", + "name": "f", + "arguments": { + "z": 5, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "c|fc_x", + "name": "f", + "arguments": { + "z": 6, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "c|rs_1", + "name": "f", + "arguments": { + "z": 7, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "trail___|item___", + "name": "f", + "arguments": { + "z": 8, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "name": "f", + "arguments": { + "z": 9, + "a": 1 + } + } + ], + "source": { + "provider": "synthetic", + "api": "openai-completions", + "model": "synthetic-responses" + }, + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-9" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "trail___|item___", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-8" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c|rs_1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-7" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c|fc_x", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-6" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "a|b|c", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-5" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-4" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "raw|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-3" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "plain-id", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-2" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-1" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call+|it😀/1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-0" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"go\"}]},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"start\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_omk_1\"},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"visible\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_omk_1_1\"},{\"type\":\"function_call\",\"call_id\":\"call__it___1\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":0,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"plain-id\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":2,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"raw\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":3,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":4,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"a_b_c\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":5,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"c_fc_x\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":6,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"c_rs_1\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":7,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"trail____item\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":8,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":9,\\\"a\\\":1}\"},{\"type\":\"function_call_output\",\"call_id\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"output\":\"result-9\"},{\"type\":\"function_call_output\",\"call_id\":\"trail____item\",\"output\":\"result-8\"},{\"type\":\"function_call_output\",\"call_id\":\"c_rs_1\",\"output\":\"result-7\"},{\"type\":\"function_call_output\",\"call_id\":\"c_fc_x\",\"output\":\"result-6\"},{\"type\":\"function_call_output\",\"call_id\":\"a_b_c\",\"output\":\"result-5\"},{\"type\":\"function_call_output\",\"call_id\":\"raw\",\"output\":\"result-3\"},{\"type\":\"function_call_output\",\"call_id\":\"plain-id\",\"output\":\"result-2\"},{\"type\":\"function_call_output\",\"call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"output\":\"result-1\"},{\"type\":\"function_call_output\",\"call_id\":\"call__it___1\",\"output\":\"result-0\"},{\"type\":\"function_call_output\",\"call_id\":\"\",\"output\":\"No result provided\"}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "cross-synthetic-model", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "go" + }, + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "start", + "textSignature": "{\"v\":1,\"id\":\"msg_src\",\"phase\":\"commentary\"}" + }, + { + "type": "thinking", + "thinking": "visible", + "thinkingSignature": "{\"type\":\"reasoning\",\"id\":\"rs_src\"}" + }, + { + "type": "thinking", + "thinking": "opaque", + "thinkingSignature": "{\"type\":\"reasoning\",\"id\":\"rs_red\"}", + "redacted": true + }, + { + "type": "thinking", + "thinking": " \t" + }, + { + "type": "toolCall", + "id": "call+|it😀/1", + "name": "f", + "arguments": { + "z": 0, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "name": "f", + "arguments": { + "z": 1, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "plain-id", + "name": "f", + "arguments": { + "z": 2, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "raw|", + "name": "f", + "arguments": { + "z": 3, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "|", + "name": "f", + "arguments": { + "z": 4, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "a|b|c", + "name": "f", + "arguments": { + "z": 5, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "c|fc_x", + "name": "f", + "arguments": { + "z": 6, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "c|rs_1", + "name": "f", + "arguments": { + "z": 7, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "trail___|item___", + "name": "f", + "arguments": { + "z": 8, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "name": "f", + "arguments": { + "z": 9, + "a": 1 + } + } + ], + "source": { + "provider": "synthetic", + "api": "openai-responses", + "model": "other" + }, + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-9" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "trail___|item___", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-8" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c|rs_1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-7" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c|fc_x", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-6" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "a|b|c", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-5" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-4" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "raw|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-3" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "plain-id", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-2" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-1" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call+|it😀/1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-0" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"go\"}]},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"start\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_omk_1\"},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"visible\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_omk_1_1\"},{\"type\":\"function_call\",\"call_id\":\"call__it___1\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":0,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"plain-id\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":2,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"raw\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":3,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":4,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"a_b_c\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":5,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"c_fc_x\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":6,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"c_rs_1\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":7,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"trail____item\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":8,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":9,\\\"a\\\":1}\"},{\"type\":\"function_call_output\",\"call_id\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"output\":\"result-9\"},{\"type\":\"function_call_output\",\"call_id\":\"trail____item\",\"output\":\"result-8\"},{\"type\":\"function_call_output\",\"call_id\":\"c_rs_1\",\"output\":\"result-7\"},{\"type\":\"function_call_output\",\"call_id\":\"c_fc_x\",\"output\":\"result-6\"},{\"type\":\"function_call_output\",\"call_id\":\"a_b_c\",\"output\":\"result-5\"},{\"type\":\"function_call_output\",\"call_id\":\"raw\",\"output\":\"result-3\"},{\"type\":\"function_call_output\",\"call_id\":\"plain-id\",\"output\":\"result-2\"},{\"type\":\"function_call_output\",\"call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"output\":\"result-1\"},{\"type\":\"function_call_output\",\"call_id\":\"call__it___1\",\"output\":\"result-0\"},{\"type\":\"function_call_output\",\"call_id\":\"\",\"output\":\"No result provided\"}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "cross-openai-none", + "input": { + "provider": "openai", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "go" + }, + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "start", + "textSignature": "{\"v\":1,\"id\":\"msg_src\",\"phase\":\"commentary\"}" + }, + { + "type": "thinking", + "thinking": "visible", + "thinkingSignature": "{\"type\":\"reasoning\",\"id\":\"rs_src\"}" + }, + { + "type": "thinking", + "thinking": "opaque", + "thinkingSignature": "{\"type\":\"reasoning\",\"id\":\"rs_red\"}", + "redacted": true + }, + { + "type": "thinking", + "thinking": " \t" + }, + { + "type": "toolCall", + "id": "call+|it😀/1", + "name": "f", + "arguments": { + "z": 0, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "name": "f", + "arguments": { + "z": 1, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "plain-id", + "name": "f", + "arguments": { + "z": 2, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "raw|", + "name": "f", + "arguments": { + "z": 3, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "|", + "name": "f", + "arguments": { + "z": 4, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "a|b|c", + "name": "f", + "arguments": { + "z": 5, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "c|fc_x", + "name": "f", + "arguments": { + "z": 6, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "c|rs_1", + "name": "f", + "arguments": { + "z": 7, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "trail___|item___", + "name": "f", + "arguments": { + "z": 8, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "name": "f", + "arguments": { + "z": 9, + "a": 1 + } + } + ], + "source": { + "provider": "openai", + "api": "openai-responses", + "model": "synthetic-responses" + }, + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-9" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "trail___|item___", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-8" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c|rs_1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-7" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c|fc_x", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-6" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "a|b|c", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-5" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-4" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "raw|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-3" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "plain-id", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-2" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-1" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call+|it😀/1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-0" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"go\"}]},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"start\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_src\",\"phase\":\"commentary\"},{\"type\":\"reasoning\",\"id\":\"rs_src\"},{\"type\":\"reasoning\",\"id\":\"rs_red\"},{\"type\":\"function_call\",\"id\":\"it😀/1\",\"call_id\":\"call+\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":0,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"B+/=😀\",\"call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"plain-id\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":2,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"\",\"call_id\":\"raw\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":3,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"\",\"call_id\":\"\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":4,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"b\",\"call_id\":\"a\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":5,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_x\",\"call_id\":\"c\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":6,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"rs_1\",\"call_id\":\"c\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":7,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"item___\",\"call_id\":\"trail___\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":8,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":9,\\\"a\\\":1}\"},{\"type\":\"function_call_output\",\"call_id\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"output\":\"result-9\"},{\"type\":\"function_call_output\",\"call_id\":\"trail___\",\"output\":\"result-8\"},{\"type\":\"function_call_output\",\"call_id\":\"c\",\"output\":\"result-7\"},{\"type\":\"function_call_output\",\"call_id\":\"c\",\"output\":\"result-6\"},{\"type\":\"function_call_output\",\"call_id\":\"a\",\"output\":\"result-5\"},{\"type\":\"function_call_output\",\"call_id\":\"\",\"output\":\"result-4\"},{\"type\":\"function_call_output\",\"call_id\":\"raw\",\"output\":\"result-3\"},{\"type\":\"function_call_output\",\"call_id\":\"plain-id\",\"output\":\"result-2\"},{\"type\":\"function_call_output\",\"call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"output\":\"result-1\"},{\"type\":\"function_call_output\",\"call_id\":\"call+\",\"output\":\"result-0\"}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "cross-openai-provider", + "input": { + "provider": "openai", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "go" + }, + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "start", + "textSignature": "{\"v\":1,\"id\":\"msg_src\",\"phase\":\"commentary\"}" + }, + { + "type": "thinking", + "thinking": "visible", + "thinkingSignature": "{\"type\":\"reasoning\",\"id\":\"rs_src\"}" + }, + { + "type": "thinking", + "thinking": "opaque", + "thinkingSignature": "{\"type\":\"reasoning\",\"id\":\"rs_red\"}", + "redacted": true + }, + { + "type": "thinking", + "thinking": " \t" + }, + { + "type": "toolCall", + "id": "call+|it😀/1", + "name": "f", + "arguments": { + "z": 0, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "name": "f", + "arguments": { + "z": 1, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "plain-id", + "name": "f", + "arguments": { + "z": 2, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "raw|", + "name": "f", + "arguments": { + "z": 3, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "|", + "name": "f", + "arguments": { + "z": 4, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "a|b|c", + "name": "f", + "arguments": { + "z": 5, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "c|fc_x", + "name": "f", + "arguments": { + "z": 6, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "c|rs_1", + "name": "f", + "arguments": { + "z": 7, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "trail___|item___", + "name": "f", + "arguments": { + "z": 8, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "name": "f", + "arguments": { + "z": 9, + "a": 1 + } + } + ], + "source": { + "provider": "foreign", + "api": "openai-responses", + "model": "synthetic-responses" + }, + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-9" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "trail___|item___", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-8" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c|rs_1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-7" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c|fc_x", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-6" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "a|b|c", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-5" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-4" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "raw|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-3" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "plain-id", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-2" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-1" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call+|it😀/1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-0" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"go\"}]},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"start\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_omk_1\"},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"visible\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_omk_1_1\"},{\"type\":\"function_call\",\"id\":\"fc_wy1znd1aew64y\",\"call_id\":\"call\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":0,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_qmme311exb3ps\",\"call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"plain-id\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":2,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_k4n83c7h0j2b\",\"call_id\":\"raw\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":3,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_k4n83c7h0j2b\",\"call_id\":\"\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":4,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_jbf49n1hx4dkv\",\"call_id\":\"a\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":5,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_1e8ugf8zrbf9\",\"call_id\":\"c\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":6,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_6uzfcw3e7c4\",\"call_id\":\"c\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":7,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_qo12jt1t99y8s\",\"call_id\":\"trail\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":8,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":9,\\\"a\\\":1}\"},{\"type\":\"function_call_output\",\"call_id\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"output\":\"result-9\"},{\"type\":\"function_call_output\",\"call_id\":\"trail\",\"output\":\"result-8\"},{\"type\":\"function_call_output\",\"call_id\":\"c\",\"output\":\"result-7\"},{\"type\":\"function_call_output\",\"call_id\":\"c\",\"output\":\"result-6\"},{\"type\":\"function_call_output\",\"call_id\":\"a\",\"output\":\"result-5\"},{\"type\":\"function_call_output\",\"call_id\":\"\",\"output\":\"result-4\"},{\"type\":\"function_call_output\",\"call_id\":\"raw\",\"output\":\"result-3\"},{\"type\":\"function_call_output\",\"call_id\":\"plain-id\",\"output\":\"result-2\"},{\"type\":\"function_call_output\",\"call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"output\":\"result-1\"},{\"type\":\"function_call_output\",\"call_id\":\"call\",\"output\":\"result-0\"}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "cross-openai-api", + "input": { + "provider": "openai", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "go" + }, + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "start", + "textSignature": "{\"v\":1,\"id\":\"msg_src\",\"phase\":\"commentary\"}" + }, + { + "type": "thinking", + "thinking": "visible", + "thinkingSignature": "{\"type\":\"reasoning\",\"id\":\"rs_src\"}" + }, + { + "type": "thinking", + "thinking": "opaque", + "thinkingSignature": "{\"type\":\"reasoning\",\"id\":\"rs_red\"}", + "redacted": true + }, + { + "type": "thinking", + "thinking": " \t" + }, + { + "type": "toolCall", + "id": "call+|it😀/1", + "name": "f", + "arguments": { + "z": 0, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "name": "f", + "arguments": { + "z": 1, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "plain-id", + "name": "f", + "arguments": { + "z": 2, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "raw|", + "name": "f", + "arguments": { + "z": 3, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "|", + "name": "f", + "arguments": { + "z": 4, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "a|b|c", + "name": "f", + "arguments": { + "z": 5, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "c|fc_x", + "name": "f", + "arguments": { + "z": 6, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "c|rs_1", + "name": "f", + "arguments": { + "z": 7, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "trail___|item___", + "name": "f", + "arguments": { + "z": 8, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "name": "f", + "arguments": { + "z": 9, + "a": 1 + } + } + ], + "source": { + "provider": "openai", + "api": "openai-completions", + "model": "synthetic-responses" + }, + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-9" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "trail___|item___", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-8" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c|rs_1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-7" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c|fc_x", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-6" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "a|b|c", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-5" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-4" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "raw|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-3" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "plain-id", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-2" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-1" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call+|it😀/1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-0" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"go\"}]},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"start\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_omk_1\"},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"visible\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_omk_1_1\"},{\"type\":\"function_call\",\"id\":\"fc_wy1znd1aew64y\",\"call_id\":\"call\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":0,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_qmme311exb3ps\",\"call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"plain-id\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":2,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_k4n83c7h0j2b\",\"call_id\":\"raw\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":3,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_k4n83c7h0j2b\",\"call_id\":\"\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":4,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_jbf49n1hx4dkv\",\"call_id\":\"a\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":5,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_1e8ugf8zrbf9\",\"call_id\":\"c\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":6,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_6uzfcw3e7c4\",\"call_id\":\"c\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":7,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_qo12jt1t99y8s\",\"call_id\":\"trail\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":8,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":9,\\\"a\\\":1}\"},{\"type\":\"function_call_output\",\"call_id\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"output\":\"result-9\"},{\"type\":\"function_call_output\",\"call_id\":\"trail\",\"output\":\"result-8\"},{\"type\":\"function_call_output\",\"call_id\":\"c\",\"output\":\"result-7\"},{\"type\":\"function_call_output\",\"call_id\":\"c\",\"output\":\"result-6\"},{\"type\":\"function_call_output\",\"call_id\":\"a\",\"output\":\"result-5\"},{\"type\":\"function_call_output\",\"call_id\":\"\",\"output\":\"result-4\"},{\"type\":\"function_call_output\",\"call_id\":\"raw\",\"output\":\"result-3\"},{\"type\":\"function_call_output\",\"call_id\":\"plain-id\",\"output\":\"result-2\"},{\"type\":\"function_call_output\",\"call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"output\":\"result-1\"},{\"type\":\"function_call_output\",\"call_id\":\"call\",\"output\":\"result-0\"}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "cross-openai-model", + "input": { + "provider": "openai", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "go" + }, + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "start", + "textSignature": "{\"v\":1,\"id\":\"msg_src\",\"phase\":\"commentary\"}" + }, + { + "type": "thinking", + "thinking": "visible", + "thinkingSignature": "{\"type\":\"reasoning\",\"id\":\"rs_src\"}" + }, + { + "type": "thinking", + "thinking": "opaque", + "thinkingSignature": "{\"type\":\"reasoning\",\"id\":\"rs_red\"}", + "redacted": true + }, + { + "type": "thinking", + "thinking": " \t" + }, + { + "type": "toolCall", + "id": "call+|it😀/1", + "name": "f", + "arguments": { + "z": 0, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "name": "f", + "arguments": { + "z": 1, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "plain-id", + "name": "f", + "arguments": { + "z": 2, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "raw|", + "name": "f", + "arguments": { + "z": 3, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "|", + "name": "f", + "arguments": { + "z": 4, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "a|b|c", + "name": "f", + "arguments": { + "z": 5, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "c|fc_x", + "name": "f", + "arguments": { + "z": 6, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "c|rs_1", + "name": "f", + "arguments": { + "z": 7, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "trail___|item___", + "name": "f", + "arguments": { + "z": 8, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "name": "f", + "arguments": { + "z": 9, + "a": 1 + } + } + ], + "source": { + "provider": "openai", + "api": "openai-responses", + "model": "other" + }, + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-9" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "trail___|item___", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-8" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c|rs_1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-7" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c|fc_x", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-6" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "a|b|c", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-5" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-4" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "raw|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-3" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "plain-id", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-2" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-1" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call+|it😀/1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-0" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"go\"}]},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"start\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_omk_1\"},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"visible\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_omk_1_1\"},{\"type\":\"function_call\",\"call_id\":\"call\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":0,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"plain-id\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":2,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc\",\"call_id\":\"raw\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":3,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc\",\"call_id\":\"\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":4,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"a\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":5,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"c\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":6,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"c\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":7,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"trail\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":8,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":9,\\\"a\\\":1}\"},{\"type\":\"function_call_output\",\"call_id\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"output\":\"result-9\"},{\"type\":\"function_call_output\",\"call_id\":\"trail\",\"output\":\"result-8\"},{\"type\":\"function_call_output\",\"call_id\":\"c\",\"output\":\"result-7\"},{\"type\":\"function_call_output\",\"call_id\":\"c\",\"output\":\"result-6\"},{\"type\":\"function_call_output\",\"call_id\":\"a\",\"output\":\"result-5\"},{\"type\":\"function_call_output\",\"call_id\":\"\",\"output\":\"result-4\"},{\"type\":\"function_call_output\",\"call_id\":\"raw\",\"output\":\"result-3\"},{\"type\":\"function_call_output\",\"call_id\":\"plain-id\",\"output\":\"result-2\"},{\"type\":\"function_call_output\",\"call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"output\":\"result-1\"},{\"type\":\"function_call_output\",\"call_id\":\"call\",\"output\":\"result-0\"}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "cross-opencode-none", + "input": { + "provider": "opencode", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "go" + }, + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "start", + "textSignature": "{\"v\":1,\"id\":\"msg_src\",\"phase\":\"commentary\"}" + }, + { + "type": "thinking", + "thinking": "visible", + "thinkingSignature": "{\"type\":\"reasoning\",\"id\":\"rs_src\"}" + }, + { + "type": "thinking", + "thinking": "opaque", + "thinkingSignature": "{\"type\":\"reasoning\",\"id\":\"rs_red\"}", + "redacted": true + }, + { + "type": "thinking", + "thinking": " \t" + }, + { + "type": "toolCall", + "id": "call+|it😀/1", + "name": "f", + "arguments": { + "z": 0, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "name": "f", + "arguments": { + "z": 1, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "plain-id", + "name": "f", + "arguments": { + "z": 2, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "raw|", + "name": "f", + "arguments": { + "z": 3, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "|", + "name": "f", + "arguments": { + "z": 4, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "a|b|c", + "name": "f", + "arguments": { + "z": 5, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "c|fc_x", + "name": "f", + "arguments": { + "z": 6, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "c|rs_1", + "name": "f", + "arguments": { + "z": 7, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "trail___|item___", + "name": "f", + "arguments": { + "z": 8, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "name": "f", + "arguments": { + "z": 9, + "a": 1 + } + } + ], + "source": { + "provider": "opencode", + "api": "openai-responses", + "model": "synthetic-responses" + }, + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-9" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "trail___|item___", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-8" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c|rs_1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-7" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c|fc_x", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-6" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "a|b|c", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-5" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-4" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "raw|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-3" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "plain-id", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-2" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-1" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call+|it😀/1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-0" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"go\"}]},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"start\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_src\",\"phase\":\"commentary\"},{\"type\":\"reasoning\",\"id\":\"rs_src\"},{\"type\":\"reasoning\",\"id\":\"rs_red\"},{\"type\":\"function_call\",\"id\":\"it😀/1\",\"call_id\":\"call+\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":0,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"B+/=😀\",\"call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"plain-id\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":2,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"\",\"call_id\":\"raw\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":3,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"\",\"call_id\":\"\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":4,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"b\",\"call_id\":\"a\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":5,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_x\",\"call_id\":\"c\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":6,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"rs_1\",\"call_id\":\"c\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":7,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"item___\",\"call_id\":\"trail___\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":8,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":9,\\\"a\\\":1}\"},{\"type\":\"function_call_output\",\"call_id\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"output\":\"result-9\"},{\"type\":\"function_call_output\",\"call_id\":\"trail___\",\"output\":\"result-8\"},{\"type\":\"function_call_output\",\"call_id\":\"c\",\"output\":\"result-7\"},{\"type\":\"function_call_output\",\"call_id\":\"c\",\"output\":\"result-6\"},{\"type\":\"function_call_output\",\"call_id\":\"a\",\"output\":\"result-5\"},{\"type\":\"function_call_output\",\"call_id\":\"\",\"output\":\"result-4\"},{\"type\":\"function_call_output\",\"call_id\":\"raw\",\"output\":\"result-3\"},{\"type\":\"function_call_output\",\"call_id\":\"plain-id\",\"output\":\"result-2\"},{\"type\":\"function_call_output\",\"call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"output\":\"result-1\"},{\"type\":\"function_call_output\",\"call_id\":\"call+\",\"output\":\"result-0\"}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "cross-opencode-provider", + "input": { + "provider": "opencode", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "go" + }, + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "start", + "textSignature": "{\"v\":1,\"id\":\"msg_src\",\"phase\":\"commentary\"}" + }, + { + "type": "thinking", + "thinking": "visible", + "thinkingSignature": "{\"type\":\"reasoning\",\"id\":\"rs_src\"}" + }, + { + "type": "thinking", + "thinking": "opaque", + "thinkingSignature": "{\"type\":\"reasoning\",\"id\":\"rs_red\"}", + "redacted": true + }, + { + "type": "thinking", + "thinking": " \t" + }, + { + "type": "toolCall", + "id": "call+|it😀/1", + "name": "f", + "arguments": { + "z": 0, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "name": "f", + "arguments": { + "z": 1, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "plain-id", + "name": "f", + "arguments": { + "z": 2, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "raw|", + "name": "f", + "arguments": { + "z": 3, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "|", + "name": "f", + "arguments": { + "z": 4, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "a|b|c", + "name": "f", + "arguments": { + "z": 5, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "c|fc_x", + "name": "f", + "arguments": { + "z": 6, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "c|rs_1", + "name": "f", + "arguments": { + "z": 7, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "trail___|item___", + "name": "f", + "arguments": { + "z": 8, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "name": "f", + "arguments": { + "z": 9, + "a": 1 + } + } + ], + "source": { + "provider": "foreign", + "api": "openai-responses", + "model": "synthetic-responses" + }, + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-9" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "trail___|item___", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-8" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c|rs_1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-7" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c|fc_x", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-6" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "a|b|c", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-5" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-4" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "raw|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-3" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "plain-id", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-2" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-1" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call+|it😀/1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-0" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"go\"}]},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"start\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_omk_1\"},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"visible\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_omk_1_1\"},{\"type\":\"function_call\",\"id\":\"fc_wy1znd1aew64y\",\"call_id\":\"call\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":0,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_qmme311exb3ps\",\"call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"plain-id\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":2,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_k4n83c7h0j2b\",\"call_id\":\"raw\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":3,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_k4n83c7h0j2b\",\"call_id\":\"\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":4,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_jbf49n1hx4dkv\",\"call_id\":\"a\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":5,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_1e8ugf8zrbf9\",\"call_id\":\"c\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":6,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_6uzfcw3e7c4\",\"call_id\":\"c\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":7,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_qo12jt1t99y8s\",\"call_id\":\"trail\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":8,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":9,\\\"a\\\":1}\"},{\"type\":\"function_call_output\",\"call_id\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"output\":\"result-9\"},{\"type\":\"function_call_output\",\"call_id\":\"trail\",\"output\":\"result-8\"},{\"type\":\"function_call_output\",\"call_id\":\"c\",\"output\":\"result-7\"},{\"type\":\"function_call_output\",\"call_id\":\"c\",\"output\":\"result-6\"},{\"type\":\"function_call_output\",\"call_id\":\"a\",\"output\":\"result-5\"},{\"type\":\"function_call_output\",\"call_id\":\"\",\"output\":\"result-4\"},{\"type\":\"function_call_output\",\"call_id\":\"raw\",\"output\":\"result-3\"},{\"type\":\"function_call_output\",\"call_id\":\"plain-id\",\"output\":\"result-2\"},{\"type\":\"function_call_output\",\"call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"output\":\"result-1\"},{\"type\":\"function_call_output\",\"call_id\":\"call\",\"output\":\"result-0\"}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "cross-opencode-api", + "input": { + "provider": "opencode", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "go" + }, + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "start", + "textSignature": "{\"v\":1,\"id\":\"msg_src\",\"phase\":\"commentary\"}" + }, + { + "type": "thinking", + "thinking": "visible", + "thinkingSignature": "{\"type\":\"reasoning\",\"id\":\"rs_src\"}" + }, + { + "type": "thinking", + "thinking": "opaque", + "thinkingSignature": "{\"type\":\"reasoning\",\"id\":\"rs_red\"}", + "redacted": true + }, + { + "type": "thinking", + "thinking": " \t" + }, + { + "type": "toolCall", + "id": "call+|it😀/1", + "name": "f", + "arguments": { + "z": 0, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "name": "f", + "arguments": { + "z": 1, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "plain-id", + "name": "f", + "arguments": { + "z": 2, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "raw|", + "name": "f", + "arguments": { + "z": 3, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "|", + "name": "f", + "arguments": { + "z": 4, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "a|b|c", + "name": "f", + "arguments": { + "z": 5, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "c|fc_x", + "name": "f", + "arguments": { + "z": 6, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "c|rs_1", + "name": "f", + "arguments": { + "z": 7, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "trail___|item___", + "name": "f", + "arguments": { + "z": 8, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "name": "f", + "arguments": { + "z": 9, + "a": 1 + } + } + ], + "source": { + "provider": "opencode", + "api": "openai-completions", + "model": "synthetic-responses" + }, + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-9" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "trail___|item___", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-8" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c|rs_1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-7" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c|fc_x", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-6" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "a|b|c", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-5" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-4" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "raw|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-3" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "plain-id", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-2" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-1" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call+|it😀/1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-0" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"go\"}]},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"start\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_omk_1\"},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"visible\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_omk_1_1\"},{\"type\":\"function_call\",\"id\":\"fc_wy1znd1aew64y\",\"call_id\":\"call\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":0,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_qmme311exb3ps\",\"call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"plain-id\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":2,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_k4n83c7h0j2b\",\"call_id\":\"raw\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":3,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_k4n83c7h0j2b\",\"call_id\":\"\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":4,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_jbf49n1hx4dkv\",\"call_id\":\"a\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":5,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_1e8ugf8zrbf9\",\"call_id\":\"c\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":6,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_6uzfcw3e7c4\",\"call_id\":\"c\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":7,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc_qo12jt1t99y8s\",\"call_id\":\"trail\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":8,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":9,\\\"a\\\":1}\"},{\"type\":\"function_call_output\",\"call_id\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"output\":\"result-9\"},{\"type\":\"function_call_output\",\"call_id\":\"trail\",\"output\":\"result-8\"},{\"type\":\"function_call_output\",\"call_id\":\"c\",\"output\":\"result-7\"},{\"type\":\"function_call_output\",\"call_id\":\"c\",\"output\":\"result-6\"},{\"type\":\"function_call_output\",\"call_id\":\"a\",\"output\":\"result-5\"},{\"type\":\"function_call_output\",\"call_id\":\"\",\"output\":\"result-4\"},{\"type\":\"function_call_output\",\"call_id\":\"raw\",\"output\":\"result-3\"},{\"type\":\"function_call_output\",\"call_id\":\"plain-id\",\"output\":\"result-2\"},{\"type\":\"function_call_output\",\"call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"output\":\"result-1\"},{\"type\":\"function_call_output\",\"call_id\":\"call\",\"output\":\"result-0\"}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "cross-opencode-model", + "input": { + "provider": "opencode", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "go" + }, + { + "role": "assistant", + "content": [ + { + "type": "text", + "text": "start", + "textSignature": "{\"v\":1,\"id\":\"msg_src\",\"phase\":\"commentary\"}" + }, + { + "type": "thinking", + "thinking": "visible", + "thinkingSignature": "{\"type\":\"reasoning\",\"id\":\"rs_src\"}" + }, + { + "type": "thinking", + "thinking": "opaque", + "thinkingSignature": "{\"type\":\"reasoning\",\"id\":\"rs_red\"}", + "redacted": true + }, + { + "type": "thinking", + "thinking": " \t" + }, + { + "type": "toolCall", + "id": "call+|it😀/1", + "name": "f", + "arguments": { + "z": 0, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "name": "f", + "arguments": { + "z": 1, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "plain-id", + "name": "f", + "arguments": { + "z": 2, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "raw|", + "name": "f", + "arguments": { + "z": 3, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "|", + "name": "f", + "arguments": { + "z": 4, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "a|b|c", + "name": "f", + "arguments": { + "z": 5, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "c|fc_x", + "name": "f", + "arguments": { + "z": 6, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "c|rs_1", + "name": "f", + "arguments": { + "z": 7, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "trail___|item___", + "name": "f", + "arguments": { + "z": 8, + "a": 1 + } + }, + { + "type": "toolCall", + "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "name": "f", + "arguments": { + "z": 9, + "a": 1 + } + } + ], + "source": { + "provider": "opencode", + "api": "openai-responses", + "model": "other" + }, + "stopReason": "toolUse" + }, + { + "role": "toolResult", + "toolCallId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-9" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "trail___|item___", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-8" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c|rs_1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-7" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c|fc_x", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-6" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "a|b|c", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-5" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-4" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "raw|", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-3" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "plain-id", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-2" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|B+/=😀", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-1" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "call+|it😀/1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "result-0" + } + ], + "isError": false + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"go\"}]},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"start\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_omk_1\"},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"visible\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_omk_1_1\"},{\"type\":\"function_call\",\"call_id\":\"call\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":0,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":1,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"plain-id\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":2,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc\",\"call_id\":\"raw\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":3,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"id\":\"fc\",\"call_id\":\"\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":4,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"a\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":5,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"c\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":6,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"c\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":7,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"trail\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":8,\\\"a\\\":1}\"},{\"type\":\"function_call\",\"call_id\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"name\":\"f\",\"arguments\":\"{\\\"z\\\":9,\\\"a\\\":1}\"},{\"type\":\"function_call_output\",\"call_id\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"output\":\"result-9\"},{\"type\":\"function_call_output\",\"call_id\":\"trail\",\"output\":\"result-8\"},{\"type\":\"function_call_output\",\"call_id\":\"c\",\"output\":\"result-7\"},{\"type\":\"function_call_output\",\"call_id\":\"c\",\"output\":\"result-6\"},{\"type\":\"function_call_output\",\"call_id\":\"a\",\"output\":\"result-5\"},{\"type\":\"function_call_output\",\"call_id\":\"\",\"output\":\"result-4\"},{\"type\":\"function_call_output\",\"call_id\":\"raw\",\"output\":\"result-3\"},{\"type\":\"function_call_output\",\"call_id\":\"plain-id\",\"output\":\"result-2\"},{\"type\":\"function_call_output\",\"call_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"output\":\"result-1\"},{\"type\":\"function_call_output\",\"call_id\":\"call\",\"output\":\"result-0\"}],\"stream\":true,\"store\":false}" + } + } + ] +} diff --git a/native/omk-providers/tests/fixtures/openai-responses-images.json b/native/omk-providers/tests/fixtures/openai-responses-images.json new file mode 100644 index 0000000000..f0a94bc489 --- /dev/null +++ b/native/omk-providers/tests/fixtures/openai-responses-images.json @@ -0,0 +1,947 @@ +{ + "schema": "omk.openai-responses-images.v1", + "source": { + "scripts/fixtures/openai-responses-images-recorder.ts": "f5e7c2fbbd648e72a7b2b4a18f9cb32afde21e482f441456174b686861724294", + "packages/ai/src/providers/openai-responses.ts": "e24fd470213a6ef6c4c23c88bf1de8e32023048cb4c659836a75389e008cf5ff", + "packages/ai/src/providers/openai-responses-shared.ts": "2b4b75585ee88793845e00260e4fd177be5e9ac4f5dec53521e7bc6ae6948311", + "packages/ai/src/providers/transform-messages.ts": "f60d2e3c7db909eb9d80d6b670bf0d7fed8aa318aac026d06f4f8a625f9a5610", + "packages/ai/src/utils/sanitize-unicode.ts": "5749c2cf0819a900e6d84f66e989562bdf4f6bb5fb45958a82b2192f73448bde", + "node_modules/openai/package.json": "3e84370c189c41e745700f55aa5535e38f6437a48d539d0e9ce02d0554863d9f" + }, + "cases": [ + { + "id": "vision-user-only", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "vision": true, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_image\",\"detail\":\"auto\",\"image_url\":\"data:image/png;base64,cG5n\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "vision-user-ordered", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "vision": true, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "앞" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + }, + { + "type": "image", + "mimeType": "image/svg+xml", + "data": "not normalized+/=\n
" + }, + { + "type": "text", + "text": "" + }, + { + "type": "image", + "mimeType": "image/svg+xml", + "data": "not normalized+/=\n
" + }, + { + "type": "text", + "text": "끝" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"앞\"},{\"type\":\"input_image\",\"detail\":\"auto\",\"image_url\":\"data:image/png;base64,cG5n\"},{\"type\":\"input_image\",\"detail\":\"auto\",\"image_url\":\"data:image/svg+xml;base64,not normalized+/=\\n
\"},{\"type\":\"input_text\",\"text\":\"\"},{\"type\":\"input_image\",\"detail\":\"auto\",\"image_url\":\"data:image/svg+xml;base64,not normalized+/=\\n
\"},{\"type\":\"input_text\",\"text\":\"끝\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "vision-user-literal-marker", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "vision": true, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "(image omitted: model does not support images)" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + }, + { + "type": "text", + "text": "(image omitted: model does not support images)" + }, + { + "type": "text", + "text": " " + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + }, + { + "type": "text", + "text": "(tool image omitted: model does not support images)" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"(image omitted: model does not support images)\"},{\"type\":\"input_image\",\"detail\":\"auto\",\"image_url\":\"data:image/png;base64,cG5n\"},{\"type\":\"input_text\",\"text\":\"(image omitted: model does not support images)\"},{\"type\":\"input_text\",\"text\":\" \"},{\"type\":\"input_image\",\"detail\":\"auto\",\"image_url\":\"data:image/png;base64,cG5n\"},{\"type\":\"input_text\",\"text\":\"(tool image omitted: model does not support images)\"},{\"type\":\"input_image\",\"detail\":\"auto\",\"image_url\":\"data:image/png;base64,cG5n\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "vision-user-per-turn", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "vision": true, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + } + ] + }, + { + "role": "user", + "content": [] + }, + { + "role": "user", + "content": "plain" + }, + { + "role": "user", + "content": [ + { + "type": "image", + "mimeType": "", + "data": "" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_image\",\"detail\":\"auto\",\"image_url\":\"data:image/png;base64,cG5n\"},{\"type\":\"input_image\",\"detail\":\"auto\",\"image_url\":\"data:image/png;base64,cG5n\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"plain\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_image\",\"detail\":\"auto\",\"image_url\":\"data:;base64,\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "vision-tool-results", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "vision": true, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "go" + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "api": "openai-responses", + "model": "synthetic-responses" + }, + "stopReason": "toolUse", + "content": [ + { + "type": "toolCall", + "id": "c0|fc_0", + "name": "f", + "arguments": {} + }, + { + "type": "toolCall", + "id": "c1|fc_1", + "name": "f", + "arguments": {} + }, + { + "type": "toolCall", + "id": "c2|fc_2", + "name": "f", + "arguments": {} + }, + { + "type": "toolCall", + "id": "c3|fc_3", + "name": "f", + "arguments": {} + }, + { + "type": "toolCall", + "id": "c4|fc_4", + "name": "f", + "arguments": {} + }, + { + "type": "toolCall", + "id": "c5|fc_5", + "name": "f", + "arguments": {} + }, + { + "type": "toolCall", + "id": "c6|fc_6", + "name": "f", + "arguments": {} + }, + { + "type": "toolCall", + "id": "c7|fc_7", + "name": "f", + "arguments": {} + }, + { + "type": "toolCall", + "id": "c8|fc_8", + "name": "f", + "arguments": {} + } + ] + }, + { + "role": "toolResult", + "toolCallId": "c0|fc_0", + "toolName": "f", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c1|fc_1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "a" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + }, + { + "type": "text", + "text": "b" + } + ], + "isError": true + }, + { + "role": "toolResult", + "toolCallId": "c2|fc_2", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c3|fc_3", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "(tool image omitted: model does not support images)" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + } + ], + "isError": true + }, + { + "role": "toolResult", + "toolCallId": "c4|fc_4", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "only" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c5|fc_5", + "toolName": "f", + "content": [], + "isError": true + }, + { + "role": "toolResult", + "toolCallId": "c6|fc_6", + "toolName": "f", + "content": [ + { + "type": "image", + "mimeType": "image/svg+xml", + "data": "not normalized+/=\n
" + }, + { + "type": "text", + "text": "x" + }, + { + "type": "image", + "mimeType": "image/svg+xml", + "data": "not normalized+/=\n
" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c7|fc_7", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "(image omitted: model does not support images)" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + } + ], + "isError": true + }, + { + "role": "toolResult", + "toolCallId": "c8|fc_8", + "toolName": "f", + "content": [ + { + "type": "image", + "mimeType": "", + "data": "" + }, + { + "type": "text", + "text": "😀 \"q\"" + } + ], + "isError": false + }, + { + "role": "user", + "content": [ + { + "type": "text", + "text": "after" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "api": "openai-responses", + "model": "synthetic-responses" + }, + "stopReason": "toolUse", + "content": [ + { + "type": "text", + "text": "t" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"go\"}]},{\"type\":\"function_call\",\"id\":\"fc_0\",\"call_id\":\"c0\",\"name\":\"f\",\"arguments\":\"{}\"},{\"type\":\"function_call\",\"id\":\"fc_1\",\"call_id\":\"c1\",\"name\":\"f\",\"arguments\":\"{}\"},{\"type\":\"function_call\",\"id\":\"fc_2\",\"call_id\":\"c2\",\"name\":\"f\",\"arguments\":\"{}\"},{\"type\":\"function_call\",\"id\":\"fc_3\",\"call_id\":\"c3\",\"name\":\"f\",\"arguments\":\"{}\"},{\"type\":\"function_call\",\"id\":\"fc_4\",\"call_id\":\"c4\",\"name\":\"f\",\"arguments\":\"{}\"},{\"type\":\"function_call\",\"id\":\"fc_5\",\"call_id\":\"c5\",\"name\":\"f\",\"arguments\":\"{}\"},{\"type\":\"function_call\",\"id\":\"fc_6\",\"call_id\":\"c6\",\"name\":\"f\",\"arguments\":\"{}\"},{\"type\":\"function_call\",\"id\":\"fc_7\",\"call_id\":\"c7\",\"name\":\"f\",\"arguments\":\"{}\"},{\"type\":\"function_call\",\"id\":\"fc_8\",\"call_id\":\"c8\",\"name\":\"f\",\"arguments\":\"{}\"},{\"type\":\"function_call_output\",\"call_id\":\"c0\",\"output\":[{\"type\":\"input_image\",\"detail\":\"auto\",\"image_url\":\"data:image/png;base64,cG5n\"}]},{\"type\":\"function_call_output\",\"call_id\":\"c1\",\"output\":[{\"type\":\"input_text\",\"text\":\"a\\nb\"},{\"type\":\"input_image\",\"detail\":\"auto\",\"image_url\":\"data:image/png;base64,cG5n\"}]},{\"type\":\"function_call_output\",\"call_id\":\"c2\",\"output\":[{\"type\":\"input_image\",\"detail\":\"auto\",\"image_url\":\"data:image/png;base64,cG5n\"}]},{\"type\":\"function_call_output\",\"call_id\":\"c3\",\"output\":[{\"type\":\"input_text\",\"text\":\"(tool image omitted: model does not support images)\"},{\"type\":\"input_image\",\"detail\":\"auto\",\"image_url\":\"data:image/png;base64,cG5n\"},{\"type\":\"input_image\",\"detail\":\"auto\",\"image_url\":\"data:image/png;base64,cG5n\"}]},{\"type\":\"function_call_output\",\"call_id\":\"c4\",\"output\":\"only\"},{\"type\":\"function_call_output\",\"call_id\":\"c5\",\"output\":\"(see attached image)\"},{\"type\":\"function_call_output\",\"call_id\":\"c6\",\"output\":[{\"type\":\"input_text\",\"text\":\"x\"},{\"type\":\"input_image\",\"detail\":\"auto\",\"image_url\":\"data:image/svg+xml;base64,not normalized+/=\\n
\"},{\"type\":\"input_image\",\"detail\":\"auto\",\"image_url\":\"data:image/svg+xml;base64,not normalized+/=\\n
\"}]},{\"type\":\"function_call_output\",\"call_id\":\"c7\",\"output\":[{\"type\":\"input_text\",\"text\":\"(image omitted: model does not support images)\"},{\"type\":\"input_image\",\"detail\":\"auto\",\"image_url\":\"data:image/png;base64,cG5n\"}]},{\"type\":\"function_call_output\",\"call_id\":\"c8\",\"output\":[{\"type\":\"input_text\",\"text\":\"😀 \\\"q\\\"\"},{\"type\":\"input_image\",\"detail\":\"auto\",\"image_url\":\"data:;base64,\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"after\"},{\"type\":\"input_image\",\"detail\":\"auto\",\"image_url\":\"data:image/png;base64,cG5n\"}]},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"t\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_omk_12\"}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "text-user-only", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "vision": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"(image omitted: model does not support images)\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "text-user-ordered", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "vision": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "앞" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + }, + { + "type": "image", + "mimeType": "image/svg+xml", + "data": "not normalized+/=\n
" + }, + { + "type": "text", + "text": "" + }, + { + "type": "image", + "mimeType": "image/svg+xml", + "data": "not normalized+/=\n
" + }, + { + "type": "text", + "text": "끝" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"앞\"},{\"type\":\"input_text\",\"text\":\"(image omitted: model does not support images)\"},{\"type\":\"input_text\",\"text\":\"\"},{\"type\":\"input_text\",\"text\":\"(image omitted: model does not support images)\"},{\"type\":\"input_text\",\"text\":\"끝\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "text-user-literal-marker", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "vision": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "(image omitted: model does not support images)" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + }, + { + "type": "text", + "text": "(image omitted: model does not support images)" + }, + { + "type": "text", + "text": " " + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + }, + { + "type": "text", + "text": "(tool image omitted: model does not support images)" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"(image omitted: model does not support images)\"},{\"type\":\"input_text\",\"text\":\"(image omitted: model does not support images)\"},{\"type\":\"input_text\",\"text\":\" \"},{\"type\":\"input_text\",\"text\":\"(image omitted: model does not support images)\"},{\"type\":\"input_text\",\"text\":\"(tool image omitted: model does not support images)\"},{\"type\":\"input_text\",\"text\":\"(image omitted: model does not support images)\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "text-user-per-turn", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "vision": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + } + ] + }, + { + "role": "user", + "content": [] + }, + { + "role": "user", + "content": "plain" + }, + { + "role": "user", + "content": [ + { + "type": "image", + "mimeType": "", + "data": "" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"(image omitted: model does not support images)\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"plain\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"(image omitted: model does not support images)\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "text-tool-results", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "vision": false, + "system": "Synthetic system", + "messages": [ + { + "role": "user", + "content": "go" + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "api": "openai-responses", + "model": "synthetic-responses" + }, + "stopReason": "toolUse", + "content": [ + { + "type": "toolCall", + "id": "c0|fc_0", + "name": "f", + "arguments": {} + }, + { + "type": "toolCall", + "id": "c1|fc_1", + "name": "f", + "arguments": {} + }, + { + "type": "toolCall", + "id": "c2|fc_2", + "name": "f", + "arguments": {} + }, + { + "type": "toolCall", + "id": "c3|fc_3", + "name": "f", + "arguments": {} + }, + { + "type": "toolCall", + "id": "c4|fc_4", + "name": "f", + "arguments": {} + }, + { + "type": "toolCall", + "id": "c5|fc_5", + "name": "f", + "arguments": {} + }, + { + "type": "toolCall", + "id": "c6|fc_6", + "name": "f", + "arguments": {} + }, + { + "type": "toolCall", + "id": "c7|fc_7", + "name": "f", + "arguments": {} + }, + { + "type": "toolCall", + "id": "c8|fc_8", + "name": "f", + "arguments": {} + } + ] + }, + { + "role": "toolResult", + "toolCallId": "c0|fc_0", + "toolName": "f", + "content": [ + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c1|fc_1", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "a" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + }, + { + "type": "text", + "text": "b" + } + ], + "isError": true + }, + { + "role": "toolResult", + "toolCallId": "c2|fc_2", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c3|fc_3", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "(tool image omitted: model does not support images)" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + } + ], + "isError": true + }, + { + "role": "toolResult", + "toolCallId": "c4|fc_4", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "only" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c5|fc_5", + "toolName": "f", + "content": [], + "isError": true + }, + { + "role": "toolResult", + "toolCallId": "c6|fc_6", + "toolName": "f", + "content": [ + { + "type": "image", + "mimeType": "image/svg+xml", + "data": "not normalized+/=\n
" + }, + { + "type": "text", + "text": "x" + }, + { + "type": "image", + "mimeType": "image/svg+xml", + "data": "not normalized+/=\n
" + } + ], + "isError": false + }, + { + "role": "toolResult", + "toolCallId": "c7|fc_7", + "toolName": "f", + "content": [ + { + "type": "text", + "text": "(image omitted: model does not support images)" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + } + ], + "isError": true + }, + { + "role": "toolResult", + "toolCallId": "c8|fc_8", + "toolName": "f", + "content": [ + { + "type": "image", + "mimeType": "", + "data": "" + }, + { + "type": "text", + "text": "😀 \"q\"" + } + ], + "isError": false + }, + { + "role": "user", + "content": [ + { + "type": "text", + "text": "after" + }, + { + "type": "image", + "mimeType": "image/png", + "data": "cG5n" + } + ] + }, + { + "role": "assistant", + "source": { + "provider": "synthetic", + "api": "openai-responses", + "model": "synthetic-responses" + }, + "stopReason": "toolUse", + "content": [ + { + "type": "text", + "text": "t" + } + ] + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"go\"}]},{\"type\":\"function_call\",\"id\":\"fc_0\",\"call_id\":\"c0\",\"name\":\"f\",\"arguments\":\"{}\"},{\"type\":\"function_call\",\"id\":\"fc_1\",\"call_id\":\"c1\",\"name\":\"f\",\"arguments\":\"{}\"},{\"type\":\"function_call\",\"id\":\"fc_2\",\"call_id\":\"c2\",\"name\":\"f\",\"arguments\":\"{}\"},{\"type\":\"function_call\",\"id\":\"fc_3\",\"call_id\":\"c3\",\"name\":\"f\",\"arguments\":\"{}\"},{\"type\":\"function_call\",\"id\":\"fc_4\",\"call_id\":\"c4\",\"name\":\"f\",\"arguments\":\"{}\"},{\"type\":\"function_call\",\"id\":\"fc_5\",\"call_id\":\"c5\",\"name\":\"f\",\"arguments\":\"{}\"},{\"type\":\"function_call\",\"id\":\"fc_6\",\"call_id\":\"c6\",\"name\":\"f\",\"arguments\":\"{}\"},{\"type\":\"function_call\",\"id\":\"fc_7\",\"call_id\":\"c7\",\"name\":\"f\",\"arguments\":\"{}\"},{\"type\":\"function_call\",\"id\":\"fc_8\",\"call_id\":\"c8\",\"name\":\"f\",\"arguments\":\"{}\"},{\"type\":\"function_call_output\",\"call_id\":\"c0\",\"output\":\"(tool image omitted: model does not support images)\"},{\"type\":\"function_call_output\",\"call_id\":\"c1\",\"output\":\"a\\n(tool image omitted: model does not support images)\\nb\"},{\"type\":\"function_call_output\",\"call_id\":\"c2\",\"output\":\"\\n(tool image omitted: model does not support images)\"},{\"type\":\"function_call_output\",\"call_id\":\"c3\",\"output\":\"(tool image omitted: model does not support images)\"},{\"type\":\"function_call_output\",\"call_id\":\"c4\",\"output\":\"only\"},{\"type\":\"function_call_output\",\"call_id\":\"c5\",\"output\":\"(see attached image)\"},{\"type\":\"function_call_output\",\"call_id\":\"c6\",\"output\":\"(tool image omitted: model does not support images)\\nx\\n(tool image omitted: model does not support images)\"},{\"type\":\"function_call_output\",\"call_id\":\"c7\",\"output\":\"(image omitted: model does not support images)\\n(tool image omitted: model does not support images)\"},{\"type\":\"function_call_output\",\"call_id\":\"c8\",\"output\":\"(tool image omitted: model does not support images)\\n😀 \\\"q\\\"\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"after\"},{\"type\":\"input_text\",\"text\":\"(image omitted: model does not support images)\"}]},{\"type\":\"message\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"t\",\"annotations\":[]}],\"status\":\"completed\",\"id\":\"msg_omk_12\"}],\"stream\":true,\"store\":false}" + } + } + ] +} diff --git a/native/omk-providers/tests/fixtures/openai-responses.json b/native/omk-providers/tests/fixtures/openai-responses.json new file mode 100644 index 0000000000..52ae7bf3cb --- /dev/null +++ b/native/omk-providers/tests/fixtures/openai-responses.json @@ -0,0 +1,1466 @@ +{ + "schema": "omk.openai-responses-request.v1", + "source": { + "scripts/fixtures/openai-responses-recorder.ts": "920b87506e75d79293b6bfd904cc4ccf8bee2555378a214694b79dc3d3e9cc91", + "packages/ai/src/providers/openai-responses.ts": "e24fd470213a6ef6c4c23c88bf1de8e32023048cb4c659836a75389e008cf5ff", + "packages/ai/src/providers/openai-responses-shared.ts": "2b4b75585ee88793845e00260e4fd177be5e9ac4f5dec53521e7bc6ae6948311", + "packages/ai/src/providers/openai-prompt-cache.ts": "dc5ad893e8d895e5eb7b76102c9c0f045569c839ed8d7679b72d24965dbfaf8f", + "packages/ai/src/providers/prompt-cache.ts": "d91900005c5a146e33b3276d02100a0da3dfe57f718301fc77c12cad23e8329d", + "packages/ai/src/providers/tool-schema.ts": "523a0642c2c62b48d84efd9c81e4a58e83f39a217dbcc5512ff3983bdedd9edb", + "node_modules/openai/package.json": "3e84370c189c41e745700f55aa5535e38f6437a48d539d0e9ce02d0554863d9f" + }, + "cases": [ + { + "id": "plain", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "reasoning-default", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": true, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"developer\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false,\"reasoning\":{\"effort\":\"none\"}}" + } + }, + { + "id": "empty-system", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "user-parts", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "a" + }, + { + "type": "text", + "text": "😀 b\n\"c\"" + } + ] + }, + { + "role": "user", + "content": "second" + }, + { + "role": "user", + "content": [] + } + ], + "tools": [] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"a\"},{\"type\":\"input_text\",\"text\":\"😀 b\\n\\\"c\\\"\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"second\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "user-empty-text-part", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "" + } + ] + } + ], + "tools": [] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "max-tokens", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 64 + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false,\"max_output_tokens\":64}" + } + }, + { + "id": "max-tokens-zero", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "maxTokens": 0 + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "temperature", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "temperature": 0.5 + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false,\"temperature\":0.5}" + } + }, + { + "id": "temperature-zero", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "temperature": 0 + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false,\"temperature\":0}" + } + }, + { + "id": "temperature-negative-zero", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "temperature": 0 + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false,\"temperature\":0}" + } + }, + { + "id": "temperature-exponent", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "temperature": 1e+21 + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false,\"temperature\":1e+21}" + } + }, + { + "id": "service-tier-priority", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "serviceTier": "priority" + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false,\"service_tier\":\"priority\"}" + } + }, + { + "id": "service-tier-flex", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "serviceTier": "flex" + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false,\"service_tier\":\"flex\"}" + } + }, + { + "id": "service-tier-auto", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "serviceTier": "auto" + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false,\"service_tier\":\"auto\"}" + } + }, + { + "id": "tools", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [ + { + "name": "write", + "description": "", + "properties": {}, + "required": [] + }, + { + "name": "read", + "description": "Read a file\n\"quoted\" 한글", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "Edit", + "description": "Edit", + "required": [ + "b", + "10" + ], + "properties": { + "2": {}, + "10": { + "type": "integer", + "minimum": 0 + }, + "b": { + "type": "object", + "required": null, + "properties": { + "z": {}, + "y": { + "enum": [ + 1, + 0, + 1e+21, + 0.1 + ] + } + } + }, + "a": { + "type": "string" + }, + "é": {}, + "😀": {} + } + } + ] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false,\"tools\":[{\"type\":\"function\",\"name\":\"Edit\",\"description\":\"Edit\",\"parameters\":{\"properties\":{\"2\":{},\"10\":{\"minimum\":0,\"type\":\"integer\"},\"a\":{\"type\":\"string\"},\"b\":{\"properties\":{\"y\":{\"enum\":[1,0,1e+21,0.1]},\"z\":{}},\"type\":\"object\"},\"é\":{},\"😀\":{}},\"required\":[\"b\",\"10\"],\"type\":\"object\"},\"strict\":false},{\"type\":\"function\",\"name\":\"read\",\"description\":\"Read a file\\n\\\"quoted\\\" 한글\",\"parameters\":{\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"strict\":false},{\"type\":\"function\",\"name\":\"write\",\"description\":\"\",\"parameters\":{\"properties\":{},\"required\":[],\"type\":\"object\"},\"strict\":false}]}" + } + }, + { + "id": "tools-empty", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "effort-high", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": true, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "reasoningEffort": "high" + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"developer\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false,\"reasoning\":{\"effort\":\"high\",\"summary\":\"auto\"},\"include\":[\"reasoning.encrypted_content\"]}" + } + }, + { + "id": "effort-ultra", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": true, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "reasoningEffort": "ultra" + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"developer\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false,\"reasoning\":{\"effort\":\"ultra\",\"summary\":\"auto\"},\"include\":[\"reasoning.encrypted_content\"]}" + } + }, + { + "id": "effort-mapped", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": true, + "thinkingLevelMap": { + "high": "xhigh" + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "reasoningEffort": "high" + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"developer\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false,\"reasoning\":{\"effort\":\"xhigh\",\"summary\":\"auto\"},\"include\":[\"reasoning.encrypted_content\"]}" + } + }, + { + "id": "effort-map-null", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": true, + "thinkingLevelMap": { + "low": null + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "reasoningEffort": "low" + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"developer\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false,\"reasoning\":{\"effort\":\"low\",\"summary\":\"auto\"},\"include\":[\"reasoning.encrypted_content\"]}" + } + }, + { + "id": "summary-only", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": true, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "reasoningSummary": "detailed" + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"developer\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false,\"reasoning\":{\"effort\":\"medium\",\"summary\":\"detailed\"},\"include\":[\"reasoning.encrypted_content\"]}" + } + }, + { + "id": "effort-summary", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": true, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "reasoningEffort": "minimal", + "reasoningSummary": "concise" + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"developer\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false,\"reasoning\":{\"effort\":\"minimal\",\"summary\":\"concise\"},\"include\":[\"reasoning.encrypted_content\"]}" + } + }, + { + "id": "effort-summary-null", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": true, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "reasoningEffort": "medium", + "reasoningSummary": null + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"developer\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false,\"reasoning\":{\"effort\":\"medium\",\"summary\":\"auto\"},\"include\":[\"reasoning.encrypted_content\"]}" + } + }, + { + "id": "effort-non-reasoning", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "reasoningEffort": "high", + "reasoningSummary": "auto" + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "off-null", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"developer\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "off-mapped", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": true, + "thinkingLevelMap": { + "off": "minimal" + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"developer\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false,\"reasoning\":{\"effort\":\"minimal\"}}" + } + }, + { + "id": "off-empty", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": true, + "thinkingLevelMap": { + "off": "" + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"developer\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false,\"reasoning\":{\"effort\":\"\"}}" + } + }, + { + "id": "off-null-with-effort", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": true, + "thinkingLevelMap": { + "off": null + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "reasoningEffort": "high" + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"developer\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false,\"reasoning\":{\"effort\":\"high\",\"summary\":\"auto\"},\"include\":[\"reasoning.encrypted_content\"]}" + } + }, + { + "id": "session-short", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "sessionId": "sess-1" + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "session_id": "sess-1", + "x-client-request-id": "sess-1" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"prompt_cache_key\":\"sess-1\",\"store\":false}" + } + }, + { + "id": "session-none", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "cacheRetention": "none", + "sessionId": "sess-1" + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "session-empty", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "sessionId": "" + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"prompt_cache_key\":\"\",\"store\":false}" + } + }, + { + "id": "session-no-id-header", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "compat": { + "sendSessionIdHeader": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "sessionId": "sess-1" + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "x-client-request-id": "sess-1" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"prompt_cache_key\":\"sess-1\",\"store\":false}" + } + }, + { + "id": "session-long-clamped", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "sessionId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "session_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "x-client-request-id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"prompt_cache_key\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\"store\":false}" + } + }, + { + "id": "session-internal-space", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "sessionId": "a b\tc" + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "session_id": "a b\tc", + "x-client-request-id": "a b\tc" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"prompt_cache_key\":\"a b\\tc\",\"store\":false}" + } + }, + { + "id": "retention-long-default", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "cacheRetention": "long", + "sessionId": "s" + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "session_id": "s", + "x-client-request-id": "s" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"prompt_cache_key\":\"s\",\"prompt_cache_retention\":\"24h\",\"store\":false}" + } + }, + { + "id": "retention-long-unsupported", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "compat": { + "supportsLongCacheRetention": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "cacheRetention": "long" + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "retention-long-no-session", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "cacheRetention": "long" + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"prompt_cache_retention\":\"24h\",\"store\":false}" + } + }, + { + "id": "content-key", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [ + { + "name": "read", + "description": "Read a file\n\"quoted\" 한글", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + } + ], + "sessionId": "s", + "systemPromptCacheBoundary": 9 + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "session_id": "s", + "x-client-request-id": "s" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"prompt_cache_key\":\"omk-1m9qkzw1qbpot0\",\"store\":false,\"tools\":[{\"type\":\"function\",\"name\":\"read\",\"description\":\"Read a file\\n\\\"quoted\\\" 한글\",\"parameters\":{\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"strict\":false}]}" + } + }, + { + "id": "content-key-canonical-tools", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [ + { + "name": "read", + "description": "Read a file\n\"quoted\" 한글", + "properties": { + "path": { + "type": "string" + } + }, + "required": [ + "path" + ] + }, + { + "name": "Edit", + "description": "Edit", + "required": [ + "b", + "10" + ], + "properties": { + "2": {}, + "10": { + "type": "integer", + "minimum": 0 + }, + "b": { + "type": "object", + "required": null, + "properties": { + "z": {}, + "y": { + "enum": [ + 1, + 0, + 1e+21, + 0.1 + ] + } + } + }, + "a": { + "type": "string" + }, + "é": {}, + "😀": {} + } + } + ], + "systemPromptCacheBoundary": 9 + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"prompt_cache_key\":\"omk-dy4k69ggsnhb\",\"store\":false,\"tools\":[{\"type\":\"function\",\"name\":\"Edit\",\"description\":\"Edit\",\"parameters\":{\"properties\":{\"2\":{},\"10\":{\"minimum\":0,\"type\":\"integer\"},\"a\":{\"type\":\"string\"},\"b\":{\"properties\":{\"y\":{\"enum\":[1,0,1e+21,0.1]},\"z\":{}},\"type\":\"object\"},\"é\":{},\"😀\":{}},\"required\":[\"b\",\"10\"],\"type\":\"object\"},\"strict\":false},{\"type\":\"function\",\"name\":\"read\",\"description\":\"Read a file\\n\\\"quoted\\\" 한글\",\"parameters\":{\"properties\":{\"path\":{\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"strict\":false}]}" + } + }, + { + "id": "content-key-astral", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "😀 cache 한글 tail", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "systemPromptCacheBoundary": 2 + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"😀 cache 한글 tail\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"prompt_cache_key\":\"omk-m81vec1a7b2w6\",\"store\":false}" + } + }, + { + "id": "boundary-null", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "sessionId": "s", + "systemPromptCacheBoundary": null + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "session_id": "s", + "x-client-request-id": "s" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "boundary-too-long", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "sessionId": "s", + "systemPromptCacheBoundary": 99 + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "session_id": "s", + "x-client-request-id": "s" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "bypass", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "sessionId": "s", + "systemPromptCacheBoundary": 9, + "systemPromptCacheBoundaryBypass": true + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "session_id": "s", + "x-client-request-id": "s" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "codex-metadata-false", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1", + "model": "synthetic-responses", + "reasoning": false, + "compat": { + "sendCodexTurnMetadata": false + }, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "sessionId": "s" + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "session_id": "s", + "x-client-request-id": "s" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"prompt_cache_key\":\"s\",\"store\":false}" + } + }, + { + "id": "openai-host", + "input": { + "provider": "openai", + "baseUrl": "https://api.openai.com/v1", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [], + "sessionId": "s" + }, + "request": { + "url": "https://api.openai.com/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json", + "session_id": "s", + "x-client-request-id": "s" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"prompt_cache_key\":\"s\",\"store\":false}" + } + }, + { + "id": "base-trailing-slash", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid/v1/", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [] + }, + "request": { + "url": "https://synthetic.invalid/v1/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false}" + } + }, + { + "id": "base-root", + "input": { + "provider": "synthetic", + "baseUrl": "https://synthetic.invalid", + "model": "synthetic-responses", + "reasoning": false, + "system": "Synthetic system 한글", + "messages": [ + { + "role": "user", + "content": "Hello" + } + ], + "tools": [] + }, + "request": { + "url": "https://synthetic.invalid/responses", + "headers": { + "accept": "application/json", + "authorization": "Bearer faux-key", + "content-type": "application/json" + }, + "body": "{\"model\":\"synthetic-responses\",\"input\":[{\"role\":\"system\",\"content\":\"Synthetic system 한글\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Hello\"}]}],\"stream\":true,\"store\":false}" + } + } + ] +} diff --git a/native/omk-providers/tests/openai_completions.rs b/native/omk-providers/tests/openai_completions.rs new file mode 100644 index 0000000000..fed0611f83 --- /dev/null +++ b/native/omk-providers/tests/openai_completions.rs @@ -0,0 +1,284 @@ +use omk_providers::openai_completions::{Input, build_request}; +use serde_json::{Value, json}; +use std::{ + io::Write, + process::{Command, Stdio}, +}; + +fn corpus() -> Vec { + [ + include_str!("fixtures/openai-completions.json"), + include_str!("fixtures/openai-completions-images.json"), + ] + .into_iter() + .flat_map(|raw| { + serde_json::from_str::(raw).unwrap()["cases"] + .as_array() + .unwrap() + .clone() + }) + .collect() +} +fn executable(input: &str) -> std::process::Output { + let mut child = Command::new(env!("CARGO_BIN_EXE_request-openai-completions")) + .env_clear() + .env("OPENAI_API_KEY", "ambient-must-not-win") + .stdin(Stdio::piped()) + .stdout(Stdio::piped()) + .stderr(Stdio::piped()) + .spawn() + .unwrap(); + child + .stdin + .take() + .unwrap() + .write_all(input.as_bytes()) + .unwrap(); + child.wait_with_output().unwrap() +} + +#[test] +fn tool_histories_match_sdk_body_bytes() { + #[derive(serde::Deserialize)] + struct Case { + id: String, + input: Box, + request: Value, + } + #[derive(serde::Deserialize)] + struct Corpus { + cases: Vec, + } + let cases = [ + include_str!("fixtures/openai-completions-tools.json"), + include_str!("fixtures/openai-completions-cross.json"), + include_str!("fixtures/openai-completions-reasoning.json"), + ] + .into_iter() + .flat_map(|s| serde_json::from_str::(s).unwrap().cases); + for c in cases { + let out = executable(c.input.get()); + assert!( + out.status.success(), + "{}: {}", + c.id, + String::from_utf8_lossy(&out.stderr) + ); + let parsed: Input = serde_json::from_str(c.input.get()).unwrap(); + for req in [ + build_request(&parsed, "faux-key").unwrap(), + serde_json::from_slice(&out.stdout).unwrap(), + ] { + assert_eq!( + req["body"].as_str().unwrap().as_bytes(), + c.request["body"].as_str().unwrap().as_bytes(), + "{}", + c.id + ); + assert_eq!(req, c.request, "{}", c.id); + } + } +} +#[test] +fn reasoning_effort_parameters_match_sdk_body_bytes() { + request_parameters_match(include_str!("fixtures/openai-completions-effort.json"), 45); +} +#[test] +fn prompt_cache_key_and_retention_match_sdk_body_bytes() { + request_parameters_match(include_str!("fixtures/openai-completions-cache.json"), 35); +} +#[test] +fn session_affinity_headers_match_sdk_requests() { + request_parameters_match( + include_str!("fixtures/openai-completions-affinity.json"), + 12, + ); +} +fn request_parameters_match(raw: &str, count: usize) { + #[derive(serde::Deserialize)] + struct Case { + id: String, + input: Box, + request: Value, + } + #[derive(serde::Deserialize)] + struct Corpus { + cases: Vec, + } + let cases = serde_json::from_str::(raw).unwrap().cases; + assert_eq!(cases.len(), count); + for c in cases { + let out = executable(c.input.get()); + assert!( + out.status.success(), + "{}: {}", + c.id, + String::from_utf8_lossy(&out.stderr) + ); + let parsed: Input = serde_json::from_str(c.input.get()).unwrap(); + for req in [ + build_request(&parsed, "faux-key").unwrap(), + serde_json::from_slice(&out.stdout).unwrap(), + ] { + assert_eq!( + req["body"].as_str().unwrap().as_bytes(), + c.request["body"].as_str().unwrap().as_bytes(), + "{}", + c.id + ); + assert_eq!(req, c.request, "{}", c.id); + } + } +} +#[test] +fn handoff_refuses_ambiguous_identity_and_split_surrogate_without_output() { + let fixture: Value = + serde_json::from_str(include_str!("fixtures/openai-completions-cross.json")).unwrap(); + let base = &fixture["cases"][7]["input"]; + let mut no_target = base.clone(); + no_target.as_object_mut().unwrap().remove("provider"); + let mut no_source = base.clone(); + no_source["messages"][0] + .as_object_mut() + .unwrap() + .remove("source"); + let mut split = base.clone(); + split["messages"][0]["content"][4]["id"] = json!(format!("{}😀", "x".repeat(39))); + for bad in [no_target, no_source, split] { + let out = executable(&bad.to_string()); + assert!(!out.status.success()); + assert!(out.stdout.is_empty()); + } +} +#[test] +fn library_matches_every_independent_node_request() { + for case in corpus() { + let input: Input = serde_json::from_value(case["input"].clone()).unwrap(); + let request = + build_request(&input, "faux-key").unwrap_or_else(|e| panic!("{}: {e}", case["id"])); + assert_eq!(request, case["request"], "{}", case["id"]); + assert_eq!(request["body"].as_str(), case["request"]["body"].as_str()); + } +} + +#[test] +fn executable_matches_every_independent_node_request() { + for case in corpus() { + let output = executable(&case["input"].to_string()); + assert!( + output.status.success(), + "{}: {}", + case["id"], + String::from_utf8_lossy(&output.stderr) + ); + assert!(output.stderr.is_empty()); + let request: Value = serde_json::from_slice(&output.stdout).unwrap(); + assert_eq!(request, case["request"], "{}", case["id"]); + } +} + +#[test] +fn unsupported_shapes_are_refused_without_partial_output() { + let base = corpus()[0]["input"].clone(); + let edit = |f: &dyn Fn(&mut Value)| { + let mut value = base.clone(); + f(&mut value); + value + }; + let refused = [ + edit(&|v| v["apiKey"] = json!("x")), + edit(&|v| v["compat"]["thinkingFormat"] = json!("unknown-format")), + edit(&|v| v["reasoningEffort"] = json!("high")), + edit(&|v| v["thinkingLevelMap"] = json!({"off":"none"})), + edit(&|v| { + v["compat"]["supportsReasoningEffort"] = json!(true); + v["reasoningEffort"] = json!("off"); + }), + edit(&|v| { + v["compat"]["supportsReasoningEffort"] = json!(true); + v["reasoningEffort"] = json!("extreme"); + }), + edit(&|v| { + v["compat"]["supportsReasoningEffort"] = json!(true); + v["thinkingLevelMap"] = json!({"turbo":"x"}); + }), + edit(&|v| { + v["compat"]["supportsReasoningEffort"] = json!(true); + v["thinkingLevelMap"] = json!({"high":1}); + }), + edit(&|v| { + v["compat"].as_object_mut().unwrap().remove("supportsStore"); + }), + edit(&|v| v["compat"]["maxTokensField"] = json!("tokens")), + edit(&|v| v["messages"] = json!([{"role":"toolResult","content":[]}])), + edit(&|v| v["messages"] = json!([{"role":"assistant","content":"text"}])), + edit( + &|v| v["messages"] = json!([{"role":"user","content":[{"type":"image","data":"AAAA","mimeType":"image/png"}]}]), + ), + edit(&|v| { + v["vision"] = json!(true); + v["messages"] = json!([{"role":"assistant","content":[{"type":"image","data":"AA==","mimeType":"image/png"}]}]); + }), + edit(&|v| { + v["vision"] = json!(false); + v["messages"] = json!([{"role":"user","content":[{"type":"image","data":"AA=="}]}]); + }), + edit(&|v| { + v["vision"] = json!(true); + v["messages"] = json!([{"role":"user","content":vec![json!({"type":"image","data":"AA==","mimeType":"image/png"});4097]}]); + }), + edit(&|v| v["toolChoice"] = json!("any")), + edit(&|v| v["temperature"] = json!("0.5")), + edit(&|v| v["cacheRetention"] = json!("forever")), + edit(&|v| v["cacheRetention"] = json!("long")), + edit(&|v| v["sessionId"] = json!(7)), + // Header values Node's Headers would trim, Latin-1 encode or reject. + edit(&|v| { + v["compat"]["sendSessionAffinityHeaders"] = json!(true); + v["sessionId"] = json!(" s"); + }), + edit(&|v| { + v["compat"]["sendSessionAffinityHeaders"] = json!(true); + v["sessionId"] = json!("s\t"); + }), + edit(&|v| { + v["compat"]["sendSessionAffinityHeaders"] = json!(true); + v["sessionId"] = json!("é"); + }), + edit(&|v| { + v["compat"]["sendSessionAffinityHeaders"] = json!(true); + v["sessionId"] = json!("a\nb"); + }), + edit(&|v| v["compat"]["sendSessionAffinityHeaders"] = json!("true")), + edit(&|v| v["systemPromptCacheBoundaryBypass"] = json!("yes")), + edit(&|v| v["compat"]["supportsLongCacheRetention"] = json!("true")), + edit(&|v| { + v["baseUrl"] = json!("https://api.openai.com/v1"); + v["system"] = json!("😀 tail"); + v["systemPromptCacheBoundary"] = json!(1); + }), + edit(&|v| { + v["baseUrl"] = json!("https://api.openai.com/v1"); + v.as_object_mut().unwrap().remove("provider"); + v["systemPromptCacheBoundary"] = json!(3); + }), + edit(&|v| v["baseUrl"] = json!("https://Synthetic.invalid/v1")), + edit(&|v| v["baseUrl"] = json!("https://synthetic.invalid:443/v1")), + edit(&|v| v["baseUrl"] = json!("https://synthetic.invalid/v1/../v2")), + edit(&|v| v["baseUrl"] = json!("https://synthetic.invalid/v1?x=1")), + edit(&|v| v["baseUrl"] = json!("https://user@synthetic.invalid/v1")), + edit(&|v| v["baseUrl"] = json!("ftp://synthetic.invalid/v1")), + edit(&|v| { + v["tools"] = json!([{"name":"a.b","description":"d","properties":{},"required":[]}]) + }), + ]; + for input in refused { + let library = serde_json::from_value::(input.clone()) + .map_err(|e| e.to_string()) + .and_then(|i| build_request(&i, "faux-key")); + assert!(library.is_err(), "{input}"); + let output = executable(&input.to_string()); + assert!(!output.status.success(), "{input}"); + assert!(output.stdout.is_empty(), "{input}"); + } +} diff --git a/native/omk-providers/tests/openai_responses.rs b/native/omk-providers/tests/openai_responses.rs new file mode 100644 index 0000000000..dceefc4caf --- /dev/null +++ b/native/omk-providers/tests/openai_responses.rs @@ -0,0 +1,206 @@ +use omk_providers::openai_responses::{Input, build_request}; +use serde_json::{Value, json, value::RawValue}; +use std::{ + io::Write, + process::{Command, Stdio}, +}; + +#[derive(serde::Deserialize)] +struct Case { + id: String, + input: Box, + request: Value, +} +#[derive(serde::Deserialize)] +struct Corpus { + cases: Vec, +} +fn corpus() -> Vec { + load(include_str!("fixtures/openai-responses.json")) +} +fn load(raw: &str) -> Vec { + serde_json::from_str::(raw).unwrap().cases +} +fn executable(input: &str) -> std::process::Output { + let mut child = Command::new(env!("CARGO_BIN_EXE_request-openai-responses")) + .env_clear() + .env("OPENAI_API_KEY", "ambient-must-not-win") + .env("OMK_CACHE_RETENTION", "long") + .stdin(Stdio::piped()) + .stdout(Stdio::piped()) + .stderr(Stdio::piped()) + .spawn() + .unwrap(); + child + .stdin + .take() + .unwrap() + .write_all(input.as_bytes()) + .unwrap(); + child.wait_with_output().unwrap() +} + +#[test] +fn library_and_executable_match_every_independent_node_request() { + matches(corpus(), 47); +} +#[test] +fn assistant_reasoning_and_tool_history_match_sdk_requests() { + matches( + load(include_str!("fixtures/openai-responses-history.json")), + 19, + ); +} +#[test] +fn model_and_option_headers_merge_like_the_sdk() { + matches( + load(include_str!("fixtures/openai-responses-headers.json")), + 16, + ); +} +#[test] +fn user_and_tool_result_images_match_sdk_requests() { + matches( + load(include_str!("fixtures/openai-responses-images.json")), + 10, + ); +} +fn matches(cases: Vec, count: usize) { + assert_eq!(cases.len(), count); + for c in cases { + let out = executable(c.input.get()); + assert!( + out.status.success(), + "{}: {}", + c.id, + String::from_utf8_lossy(&out.stderr) + ); + let parsed: Input = serde_json::from_str(c.input.get()).unwrap(); + for req in [ + build_request(&parsed, "faux-key").unwrap(), + serde_json::from_slice(&out.stdout).unwrap(), + ] { + assert_eq!( + req["body"].as_str().unwrap().as_bytes(), + c.request["body"].as_str().unwrap().as_bytes(), + "{}", + c.id + ); + assert_eq!(req, c.request, "{}", c.id); + } + } +} + +#[test] +fn unsupported_shapes_are_refused_without_partial_output() { + let base: Value = serde_json::from_str(corpus()[0].input.get()).unwrap(); + let edit = |f: &dyn Fn(&mut Value)| { + let mut value = base.clone(); + f(&mut value); + value + }; + let refused = [ + edit(&|v| v["apiKey"] = json!("x")), + edit(&|v| v["provider"] = json!("github-copilot")), + edit(&|v| v["provider"] = json!("cloudflare-ai-gateway")), + edit(&|v| v["provider"] = json!("cloudflare-workers-ai")), + edit(&|v| { + v.as_object_mut().unwrap().remove("provider"); + }), + edit(&|v| v["compat"] = json!({"sendCodexTurnMetadata": true})), + edit(&|v| v["compat"] = json!({"unknown": true})), + // Header names/values the SDK or Fetch would reject, trim or never let reach the wire. + edit(&|v| v["headers"] = json!({"x": 1})), + edit(&|v| v["headers"] = json!({"x": null})), + edit(&|v| v["headers"] = json!(["x", "y"])), + edit(&|v| v["modelHeaders"] = json!({"bad name": "v"})), + edit(&|v| v["modelHeaders"] = json!({"": "v"})), + edit(&|v| v["headers"] = json!({"x-é": "v"})), + edit(&|v| v["headers"] = json!({"x": " padded"})), + edit(&|v| v["headers"] = json!({"x": "é"})), + edit(&|v| v["headers"] = json!({"x": "a\nb"})), + edit(&|v| v["headers"] = json!({"User-Agent": "u"})), + edit(&|v| v["modelHeaders"] = json!({"X-Stainless-Lang": "rust"})), + // Node rejects these header values (ByteString/HTTP whitespace) or trims them. + edit(&|v| v["sessionId"] = json!(format!("{}😀", "a".repeat(63)))), + edit(&|v| v["sessionId"] = json!(" s")), + edit(&|v| v["sessionId"] = json!("é")), + edit(&|v| v["sessionId"] = json!("a\nb")), + edit(&|v| v["sessionId"] = json!(7)), + edit(&|v| v["reasoningEffort"] = json!("off")), + edit(&|v| v["reasoningEffort"] = json!("extreme")), + edit(&|v| v["reasoningSummary"] = json!("")), + edit(&|v| v["thinkingLevelMap"] = json!({"turbo": "x"})), + edit(&|v| v["serviceTier"] = json!("fast")), + edit(&|v| v["serviceTier"] = json!(null)), + edit(&|v| v["temperature"] = json!("0.5")), + edit(&|v| v["cacheRetention"] = json!("forever")), + edit(&|v| v["messages"] = json!([{"role": "assistant", "content": []}])), + edit(&|v| v["messages"] = json!([{"role": "toolResult", "content": []}])), + edit( + &|v| v["messages"] = json!([{"role": "user", "content": [{"type": "image", "data": "AA==", "mimeType": "image/png"}]}]), + ), + edit( + &|v| v["messages"] = json!([{"role": "user", "content": [{"type": "text", "text": "a", "textSignature": "s"}]}]), + ), + edit(&|v| { + v["system"] = json!("😀 tail"); + v["systemPromptCacheBoundary"] = json!(1); + }), + edit(&|v| v["baseUrl"] = json!("https://Synthetic.invalid/v1")), + edit(&|v| v["baseUrl"] = json!("https://synthetic.invalid/v1?x=1")), + edit(&|v| { + v["tools"] = json!([{"name":"a.b","description":"d","properties":{},"required":[]}]) + }), + ]; + let source = + json!({"provider": "synthetic", "api": "openai-responses", "model": "synthetic-responses"}); + let history = |messages: Value| edit(&|v| v["messages"] = messages.clone()); + let assistant = |block: Value| { + history(json!([{"role": "assistant", "source": source, "content": [block]}])) + }; + let refused = refused.into_iter().chain([ + assistant(json!({"type": "thinking", "thinking": "t", "thinkingSignature": "not json"})), + assistant(json!({"type": "thinking", "thinking": "t", "thinkingSignature": "[1]"})), + assistant(json!({"type": "thinking", "thinking": "t", "thinkingSignature": "{\"a\":1,\"a\":2}"})), + assistant(json!({"type": "text", "text": "t", "textSignature": "{oops"})), + assistant(json!({"type": "text", "text": "t", "textSignature": "{\"v\":1,\"id\":\"\\ud800\"}"})), + assistant(json!({"type": "toolCall", "id": "c", "name": "f", "arguments": [1]})), + assistant(json!({"type": "image", "data": "AA==", "mimeType": "image/png"})), + assistant(json!({"type": "text", "text": "t", "extra": 1})), + history(json!([{"role": "assistant", "content": [{"type": "text", "text": "t"}]}])), + history(json!([{"role": "user", "source": source, "content": "t"}])), + history(json!([{"role": "assistant", "source": {"provider": "synthetic"}, "content": []}])), + history(json!([{"role": "toolResult", "toolCallId": "c", "content": [{"type": "image", "data": "AA==", "mimeType": "image/png"}]}])), + history(json!([{"role": "toolResult", "toolName": "f", "content": []}])), + edit(&|v| { + v["vision"] = json!("true"); + v["messages"] = json!([{"role": "user", "content": [{"type": "image", "data": "AA==", "mimeType": "image/png"}]}]); + }), + edit(&|v| { + v["vision"] = json!(true); + v["messages"] = json!([{"role": "user", "content": [{"type": "image", "data": "AA=="}]}]); + }), + edit(&|v| { + v["vision"] = json!(false); + v["messages"] = json!([{"role": "user", "content": [{"type": "image", "data": "AA==", "mimeType": "image/png", "detail": "high"}]}]); + }), + edit(&|v| { + v["vision"] = json!(true); + v["messages"] = json!([{"role": "user", "content": vec![json!({"type": "image", "data": "AA==", "mimeType": "image/png"}); 4097]}]); + }), + edit(&|v| { + v["vision"] = json!(false); + v["messages"] = json!([{"role": "user", "content": vec![json!({"type": "image", "data": "AA==", "mimeType": "image/png"}); 4097]}]); + }), + ]); + for input in refused { + let library = serde_json::from_value::(input.clone()) + .map_err(|e| e.to_string()) + .and_then(|i| build_request(&i, "faux-key")); + assert!(library.is_err(), "{input}"); + let output = executable(&input.to_string()); + assert!(!output.status.success(), "{input}"); + assert!(output.stdout.is_empty(), "{input}"); + } +} diff --git a/native/omk-providers/tests/request_cache.rs b/native/omk-providers/tests/request_cache.rs new file mode 100644 index 0000000000..dac2e74e97 --- /dev/null +++ b/native/omk-providers/tests/request_cache.rs @@ -0,0 +1,62 @@ +use omk_providers::{ + anthropic::{Input, build_request}, + request_cache::Boundary, +}; +use serde_json::{Value, json}; + +fn recorded() -> Value { + serde_json::from_str::(include_str!("fixtures/anthropic-cache.json")).unwrap()["cases"] + [0]["input"] + .clone() +} +#[test] +fn cache_retention_and_bypass_shapes_are_strict_without_widening_replay() { + let original = recorded(); + for value in [ + json!("forever"), + json!(42), + json!({}), + json!(true), + Value::Null, + ] { + let mut input = original.clone(); + input["options"]["cacheRetention"] = value; + assert!(serde_json::from_value::(input).is_err()); + } + let mut input = original.clone(); + input["systemPromptCacheBoundaryBypass"] = json!("true"); + assert!(serde_json::from_value::(input).is_err()); + let mut input = original; + input["model"] = json!("synthetic-anthropic"); + let parsed: Input = serde_json::from_value(input.clone()).unwrap(); + assert!( + build_request(&parsed) + .unwrap_err() + .contains("catalog dispatch") + ); + input.as_object_mut().unwrap().remove("options"); + input["systemPromptCacheBoundary"] = Value::Null; + let parsed: Input = serde_json::from_value(input).unwrap(); + assert!(matches!( + parsed.system_prompt_cache_boundary, + Boundary::Present(Value::Null) + )); + assert!( + build_request(&parsed) + .unwrap_err() + .contains("catalog dispatch") + ); +} + +#[test] +fn missing_null_and_numeric_boundary_metadata_are_not_conflated() { + let input: Input = serde_json::from_value(recorded()).unwrap(); + assert!(matches!( + input.system_prompt_cache_boundary, + Boundary::Missing + )); + for raw in ["null", "6.0", "1e100", "\"6\"", "{}", "[]"] { + let boundary: Boundary = serde_json::from_str(raw).unwrap(); + assert!(matches!(boundary, Boundary::Present(_)), "{raw}"); + } +} diff --git a/native/omk-providers/tests/request_policy.rs b/native/omk-providers/tests/request_policy.rs new file mode 100644 index 0000000000..d975027cbe --- /dev/null +++ b/native/omk-providers/tests/request_policy.rs @@ -0,0 +1,64 @@ +use omk_providers::{ + anthropic::{Input, build_request}, + auth::{KeySources, Snapshot}, + catalog::Catalog, + dispatch, +}; +use serde_json::{Value, json}; +fn recorded() -> Value { + serde_json::from_str::(include_str!("fixtures/anthropic-policy.json")).unwrap()["cases"] + [0] + .clone() +} +#[test] +fn malformed_and_unsafe_options_fail_before_dispatch_without_echoing_values() { + let case = recorded(); + let catalog = Catalog::load(case["overlay"].as_str()); + let snapshot = Snapshot::from_json(Ok(None)); + for options in [ + json!({"temperature":2}), + json!({"temperature":-0.1}), + json!({"thinkingBudgetTokens":-1}), + json!({"thinkingBudgetTokens":1.5}), + json!({"thinkingDisplay":"secret-marker"}), + json!({"effort":"secret-marker"}), + json!({"toolChoice":"secret-marker"}), + json!({"toolChoice":{"type":"tool","name":""}}), + json!({"toolChoice":{"type":"tool","name":"x".repeat(257)}}), + json!({"toolChoice":{"type":"tool","name":"read","extra":true}}), + json!({"unknown":"secret-marker"}), + ] { + let mut input = case["input"].clone(); + input["options"] = options; + if let Ok(input) = serde_json::from_value::(input) { + let error = match dispatch::prepare( + &catalog, + "anthropic", + &input, + &snapshot, + KeySources { + runtime: Some("faux-key"), + environment: None, + fallback: None, + include_fallback: false, + }, + |_| None, + ) { + Ok(_) => panic!("unsafe option admitted"), + Err(e) => e, + }; + assert_eq!(error, dispatch::Error::InvalidRequest); + assert!(!error.to_string().contains("secret-marker")); + } + } +} +#[test] +fn synthetic_replay_does_not_silently_ignore_new_catalog_policies() { + let mut input = recorded()["input"].clone(); + input["model"] = json!("synthetic-anthropic"); + let input: Input = serde_json::from_value(input).unwrap(); + assert_eq!( + build_request(&input).unwrap_err(), + "request options require catalog dispatch" + ); +} diff --git a/native/omk-providers/tests/thinking_signature.rs b/native/omk-providers/tests/thinking_signature.rs new file mode 100644 index 0000000000..9e81114a06 --- /dev/null +++ b/native/omk-providers/tests/thinking_signature.rs @@ -0,0 +1,30 @@ +use omk_providers::anthropic::{Input, build_request}; +use serde_json::{Value, json}; + +fn input() -> Value { + let corpus: Value = + serde_json::from_str(include_str!("fixtures/anthropic-signature.json")).unwrap(); + corpus["cases"] + .as_array() + .unwrap() + .iter() + .find(|c| c["id"] == "true-missing") + .unwrap()["input"] + .clone() +} +#[test] +fn compatibility_does_not_widen_legacy_replay_or_invalid_redacted_shapes() { + let mut value = input(); + value["model"] = json!("synthetic-anthropic"); + let request = build_request(&serde_json::from_value::(value.clone()).unwrap()).unwrap(); + let body: Value = serde_json::from_str(request["body"].as_str().unwrap()).unwrap(); + assert_eq!( + body["messages"][0]["content"][0], + json!({"type":"text","text":"thought"}) + ); + value["compat"] = json!({"allowEmptySignature":true}); + assert!(serde_json::from_value::(value).is_err()); + let mut value = input(); + value["history"][0]["content"][0]["redacted"] = json!(true); + assert!(serde_json::from_value::(value).is_err()); +} diff --git a/native/omk-providers/tests/tool_schema.rs b/native/omk-providers/tests/tool_schema.rs new file mode 100644 index 0000000000..98a725c96a --- /dev/null +++ b/native/omk-providers/tests/tool_schema.rs @@ -0,0 +1,49 @@ +use omk_providers::anthropic::{Input, build_request}; +use serde_json::Value; + +fn input(tools: &str) -> Result { + serde_json::from_str(&format!( + r#"{{"model":"synthetic-anthropic","maxTokens":1,"system":"","user":"hello","tools":{tools}}}"# + )) +} +fn body(tools: &str) -> Result { + let request = build_request(&input(tools).map_err(|e| e.to_string())?)?; + Ok(request["body"].as_str().unwrap().to_string()) +} + +#[test] +fn raw_schema_literals_match_node_parse_and_canonicalization() { + let corpus: Value = + serde_json::from_str(include_str!("fixtures/anthropic-tool-schema.json")).unwrap(); + for case in corpus["schemas"].as_array().unwrap() { + let text = case["text"].as_str().unwrap(); + let tools = + format!(r#"[{{"name":"t","description":"d","properties":{text},"required":[]}}]"#); + if text == r#"{"v":"\ud800"}"# { + // Rust strings cannot hold lone surrogates; this is an admission bound. + assert!(body(&tools).is_err(), "{text}"); + continue; + } + let expected = format!( + r#""input_schema":{{"type":"object","properties":{},"required":[]}}"#, + case["properties"].as_str().unwrap() + ); + let actual = body(&tools).unwrap(); + assert!(actual.contains(&expected), "{text}\n{actual}"); + } +} + +#[test] +fn unsupported_tool_names_are_refused_instead_of_misordered() { + let tool = |name: &str| { + format!(r#"{{"name":"{name}","description":"d","properties":{{}},"required":[]}}"#) + }; + for tools in [ + format!("[{},{}]", tool("read"), tool("read")), + format!("[{}]", tool("read.file")), + format!("[{}]", tool("caf\u{e9}")), + format!("[{}]", tool("read file")), + ] { + assert!(body(&tools).is_err(), "{tools}"); + } +} diff --git a/native/omk-providers/tests/transport_send.rs b/native/omk-providers/tests/transport_send.rs new file mode 100644 index 0000000000..de7d427f96 --- /dev/null +++ b/native/omk-providers/tests/transport_send.rs @@ -0,0 +1,644 @@ +use omk_providers::transport::{Cancellation, Error, Limits, Transport}; +use reqwest::header::{HeaderMap, HeaderValue}; +use std::time::Duration; +use tokio::{ + io::{AsyncReadExt, AsyncWriteExt}, + net::{TcpListener, TcpStream}, + time::{Instant, timeout}, +}; + +fn run(test: impl Future) { + tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + .unwrap() + .block_on(test); +} +async fn bind_listener() -> TcpListener { + TcpListener::bind("127.0.0.1:0").await.unwrap() +} +fn url(listener: &TcpListener) -> String { + format!("http://{}/v1/messages", listener.local_addr().unwrap()) +} +async fn request(socket: &mut TcpStream) -> Vec { + let mut bytes = Vec::new(); + let mut buf = [0; 4096]; + loop { + let n = socket.read(&mut buf).await.unwrap(); + assert!(n > 0, "EOF before request"); + bytes.extend_from_slice(&buf[..n]); + assert!(bytes.len() < 128 * 1024); + if let Some(end) = bytes.windows(4).position(|v| v == b"\r\n\r\n") { + let headers = String::from_utf8_lossy(&bytes[..end]).to_lowercase(); + let length: usize = headers + .lines() + .find_map(|l| l.strip_prefix("content-length: ")) + .unwrap_or("0") + .parse() + .unwrap(); + if bytes.len() >= end + 4 + length { + return bytes; + } + } + } +} +async fn eof(socket: &mut TcpStream) { + let mut byte = [0]; + assert_eq!( + timeout(Duration::from_secs(2), socket.read(&mut byte)) + .await + .unwrap() + .unwrap(), + 0 + ); +} +fn deadline() -> Instant { + Instant::now() + Duration::from_secs(3) +} + +#[test] +fn sends_recorded_sdk_body_and_streams_bytes_without_buffering_the_response() { + run(async { + let listener = bind_listener().await; + let url = url(&listener); + let fixture: serde_json::Value = + serde_json::from_str(include_str!("fixtures/anthropic.json")).unwrap(); + let recorded = &fixture["cases"][0]; + let body = recorded["request"]["body"] + .as_str() + .unwrap() + .as_bytes() + .to_vec(); + let expected = body.clone(); + let chunks = recorded["chunks"] + .as_array() + .unwrap() + .iter() + .flat_map(|c| { + c.as_array() + .unwrap() + .iter() + .map(|b| b.as_u64().unwrap() as u8) + }) + .collect::>(); + let expected_chunks = chunks.clone(); + let mut headers = HeaderMap::new(); + for (key, value) in recorded["request"]["headers"].as_object().unwrap() { + headers.insert( + reqwest::header::HeaderName::from_bytes(key.as_bytes()).unwrap(), + HeaderValue::from_str(value.as_str().unwrap()).unwrap(), + ); + } + let server = tokio::spawn(async move { + let (mut socket, _) = listener.accept().await.unwrap(); + let bytes = request(&mut socket).await; + let end = bytes.windows(4).position(|v| v == b"\r\n\r\n").unwrap(); + assert_eq!(&bytes[end + 4..], expected); + let head = String::from_utf8_lossy(&bytes[..end]); + assert!(head.starts_with("POST /v1/messages HTTP/1.1\r\n")); + assert!(head.contains("x-api-key: faux-key")); + socket.write_all(b"HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\nContent-Type: text/event-stream\r\n\r\n").await.unwrap(); + socket + .write_all(format!("{:x}\r\n", chunks.len()).as_bytes()) + .await + .unwrap(); + socket.write_all(&chunks).await.unwrap(); + socket.write_all(b"\r\n0\r\n\r\n").await.unwrap(); + }); + let transport = Transport::new().unwrap(); + let mut received = Vec::new(); + let metadata = transport + .post( + &url, + headers, + body, + Limits { + deadline: deadline(), + max_response_bytes: 8 * 1024 * 1024, + }, + &Cancellation::default(), + |_, chunk| { + received.extend_from_slice(chunk); + Ok(()) + }, + ) + .await + .unwrap(); + assert_eq!(metadata.status, 200); + assert_eq!(metadata.headers["content-type"], "text/event-stream"); + assert_eq!(received, expected_chunks); + let replay = + omk_providers::anthropic::replay("synthetic-anthropic", &[received], None).unwrap(); + assert_eq!(replay.events, recorded["events"]); + assert_eq!(replay.result, recorded["result"]); + server.await.unwrap(); + }); +} + +#[test] +fn cancellation_and_expiry_before_dispatch_make_zero_connections() { + run(async { + let listener = bind_listener().await; + let transport = Transport::new().unwrap(); + let cancel = Cancellation::default(); + cancel.cancel(); + cancel.clone().cancel(); + let mut calls = 0; + let result = transport + .post( + &url(&listener), + HeaderMap::new(), + vec![], + Limits { + deadline: deadline(), + max_response_bytes: 16, + }, + &cancel, + |_, _| { + calls += 1; + Ok(()) + }, + ) + .await; + assert!(matches!(result, Err(Error::Cancelled))); + let result = transport + .post( + &url(&listener), + HeaderMap::new(), + vec![], + Limits { + deadline: Instant::now(), + max_response_bytes: 16, + }, + &Cancellation::default(), + |_, _| { + calls += 1; + Ok(()) + }, + ) + .await; + assert!(matches!(result, Err(Error::Deadline))); + assert_eq!(calls, 0); + assert!( + timeout(Duration::from_millis(30), listener.accept()) + .await + .is_err() + ); + }); +} + +#[test] +fn cancellation_while_waiting_for_headers_closes_the_request() { + run(async { + let listener = bind_listener().await; + let endpoint = url(&listener); + let cancel = Cancellation::default(); + let control = cancel.clone(); + let server = tokio::spawn(async move { + let (mut socket, _) = listener.accept().await.unwrap(); + request(&mut socket).await; + control.cancel(); + eof(&mut socket).await; + }); + let result = Transport::new() + .unwrap() + .post( + &endpoint, + HeaderMap::new(), + vec![], + Limits { + deadline: deadline(), + max_response_bytes: 16, + }, + &cancel, + |_, _| panic!("no body before headers"), + ) + .await; + assert!(matches!(result, Err(Error::Cancelled))); + server.await.unwrap(); + }); +} + +#[test] +fn cancellation_during_body_delivery_stops_callbacks_and_closes_socket() { + run(async { + let listener = bind_listener().await; + let endpoint = url(&listener); + let server = tokio::spawn(async move { + let (mut socket, _) = listener.accept().await.unwrap(); + request(&mut socket).await; + socket + .write_all(b"HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n1\r\nx\r\n") + .await + .unwrap(); + eof(&mut socket).await; + }); + let cancel = Cancellation::default(); + let mut calls = 0; + let result = Transport::new() + .unwrap() + .post( + &endpoint, + HeaderMap::new(), + vec![], + Limits { + deadline: deadline(), + max_response_bytes: 16, + }, + &cancel, + |_, chunk| { + calls += 1; + assert_eq!(chunk, b"x"); + cancel.cancel(); + Ok(()) + }, + ) + .await; + assert!(matches!(result, Err(Error::Cancelled))); + assert_eq!(calls, 1); + server.await.unwrap(); + }); +} + +#[test] +fn absolute_deadline_covers_headers_and_stalled_body() { + run(async { + for headers in [false, true] { + let listener = bind_listener().await; + let endpoint = url(&listener); + let server = tokio::spawn(async move { + let (mut socket, _) = listener.accept().await.unwrap(); + request(&mut socket).await; + if headers { + socket + .write_all(b"HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n") + .await + .unwrap(); + } + eof(&mut socket).await; + }); + let result = Transport::new() + .unwrap() + .post( + &endpoint, + HeaderMap::new(), + vec![], + Limits { + deadline: Instant::now() + Duration::from_millis(100), + max_response_bytes: 16, + }, + &Cancellation::default(), + |_, _| Ok(()), + ) + .await; + assert!(matches!(result, Err(Error::Deadline)), "{result:?}"); + server.await.unwrap(); + } + }); +} + +#[test] +fn byte_bound_is_checked_before_delivery_and_unknown_length_is_bounded() { + run(async { + for response in [ + b"HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nxy".as_slice(), + b"HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n2\r\nxy\r\n0\r\n\r\n".as_slice(), + ] { + let listener = bind_listener().await; + let endpoint = url(&listener); + let server = tokio::spawn(async move { + let (mut socket, _) = listener.accept().await.unwrap(); + request(&mut socket).await; + socket.write_all(response).await.unwrap(); + }); + let mut delivered = 0; + let result = Transport::new() + .unwrap() + .post( + &endpoint, + HeaderMap::new(), + vec![], + Limits { + deadline: deadline(), + max_response_bytes: 1, + }, + &Cancellation::default(), + |_, chunk| { + delivered += chunk.len(); + Ok(()) + }, + ) + .await; + assert!(matches!(result, Err(Error::ResponseTooLarge))); + assert_eq!(delivered, 0); + server.await.unwrap(); + } + }); +} + +#[test] +fn status_errors_and_redirects_return_once_without_following_or_retrying() { + run(async { + for status in [307, 429, 503] { + let listener = bind_listener().await; + let endpoint = url(&listener); + let target = bind_listener().await; + let redirect = url(&target); + let server = tokio::spawn(async move { + let (mut socket, _) = listener.accept().await.unwrap(); + request(&mut socket).await; + socket.write_all(format!("HTTP/1.1 {status} Test\r\nLocation: {redirect}\r\nRetry-After: 0\r\nContent-Length: 4\r\n\r\noops").as_bytes()).await.unwrap(); + drop(socket); + assert!( + timeout(Duration::from_millis(100), listener.accept()) + .await + .is_err(), + "unexpected retry" + ); + }); + let mut body = Vec::new(); + let metadata = Transport::new() + .unwrap() + .post( + &endpoint, + HeaderMap::new(), + vec![], + Limits { + deadline: deadline(), + max_response_bytes: 16, + }, + &Cancellation::default(), + |metadata, chunk| { + assert_eq!(metadata.status, status); + body.extend_from_slice(chunk); + Ok(()) + }, + ) + .await + .unwrap(); + assert_eq!(metadata.status, status); + assert_eq!(body, b"oops"); + server.await.unwrap(); + assert!( + timeout(Duration::from_millis(20), target.accept()) + .await + .is_err(), + "redirect followed" + ); + } + }); +} + +#[test] +fn sink_failure_and_truncated_response_are_not_success() { + run(async { + for sink_failure in [true, false] { + let listener = bind_listener().await; + let endpoint = url(&listener); + let server = tokio::spawn(async move { + let (mut socket, _) = listener.accept().await.unwrap(); + request(&mut socket).await; + socket + .write_all(b"HTTP/1.1 200 OK\r\nContent-Length: 8\r\n\r\nx") + .await + .unwrap(); + if sink_failure { + eof(&mut socket).await; + } + }); + let result = Transport::new() + .unwrap() + .post( + &endpoint, + HeaderMap::new(), + vec![], + Limits { + deadline: deadline(), + max_response_bytes: 16, + }, + &Cancellation::default(), + |_, _| if sink_failure { Err(()) } else { Ok(()) }, + ) + .await; + assert!(if sink_failure { + matches!(result, Err(Error::Sink)) + } else { + matches!(result, Err(Error::Network)) + }); + server.await.unwrap(); + } + }); +} + +#[test] +fn unsafe_endpoint_and_oversized_request_fail_without_disclosing_input() { + run(async { + let transport = Transport::new().unwrap(); + for endpoint in [ + "http://example.invalid/path?secret=sentinel", + "https://user:sentinel@example.invalid", + "https://example.invalid/#sentinel", + "file:///sentinel", + "invalid-sentinel", + ] { + let error = transport + .post( + endpoint, + HeaderMap::new(), + vec![], + Limits { + deadline: deadline(), + max_response_bytes: 1, + }, + &Cancellation::default(), + |_, _| Ok(()), + ) + .await + .unwrap_err(); + assert!(matches!(error, Error::InvalidRequest)); + assert!(!format!("{error:?} {error}").contains("sentinel")); + } + let listener = bind_listener().await; + let error = transport + .post( + &url(&listener), + HeaderMap::new(), + vec![0; 8 * 1024 * 1024 + 1], + Limits { + deadline: deadline(), + max_response_bytes: 1, + }, + &Cancellation::default(), + |_, _| Ok(()), + ) + .await + .unwrap_err(); + assert!(matches!(error, Error::InvalidRequest)); + assert!( + timeout(Duration::from_millis(20), listener.accept()) + .await + .is_err() + ); + }); +} + +#[test] +fn caller_framing_headers_are_refused_before_dispatch() { + run(async { + let listener = bind_listener().await; + let transport = Transport::new().unwrap(); + for key in [ + reqwest::header::CONTENT_LENGTH, + reqwest::header::TRANSFER_ENCODING, + ] { + let mut headers = HeaderMap::new(); + headers.insert(key, HeaderValue::from_static("1")); + let error = transport + .post( + &url(&listener), + headers, + vec![], + Limits { + deadline: deadline(), + max_response_bytes: 1, + }, + &Cancellation::default(), + |_, _| Ok(()), + ) + .await + .unwrap_err(); + assert_eq!(error, Error::InvalidRequest); + } + assert!( + timeout(Duration::from_millis(20), listener.accept()) + .await + .is_err() + ); + }); +} + +#[test] +fn cumulative_limit_stops_before_delivering_a_later_chunk() { + run(async { + let listener = bind_listener().await; + let endpoint = url(&listener); + let (sent, received) = tokio::sync::oneshot::channel(); + let server = tokio::spawn(async move { + let (mut socket, _) = listener.accept().await.unwrap(); + request(&mut socket).await; + socket + .write_all(b"HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n1\r\nx\r\n") + .await + .unwrap(); + received.await.unwrap(); + socket.write_all(b"1\r\ny\r\n").await.unwrap(); + eof(&mut socket).await; + }); + let mut sent = Some(sent); + let mut bytes = Vec::new(); + let error = Transport::new() + .unwrap() + .post( + &endpoint, + HeaderMap::new(), + vec![], + Limits { + deadline: deadline(), + max_response_bytes: 1, + }, + &Cancellation::default(), + |_, chunk| { + bytes.extend_from_slice(chunk); + sent.take().unwrap().send(()).unwrap(); + Ok(()) + }, + ) + .await + .unwrap_err(); + assert_eq!(error, Error::ResponseTooLarge); + assert_eq!(bytes, b"x"); + server.await.unwrap(); + }); +} + +#[test] +fn dropping_a_pending_request_future_closes_its_socket() { + run(async { + let listener = bind_listener().await; + let endpoint = url(&listener); + let (sent, received) = tokio::sync::oneshot::channel(); + let server = tokio::spawn(async move { + let (mut socket, _) = listener.accept().await.unwrap(); + request(&mut socket).await; + sent.send(()).unwrap(); + eof(&mut socket).await; + }); + let transport = Transport::new().unwrap(); + let cancellation = Cancellation::default(); + let mut operation = Box::pin(transport.post( + &endpoint, + HeaderMap::new(), + vec![], + Limits { + deadline: deadline(), + max_response_bytes: 1, + }, + &cancellation, + |_, _| Ok(()), + )); + let mut received = Box::pin(received); + std::future::poll_fn(|cx| { + use std::future::Future; + assert!(operation.as_mut().poll(cx).is_pending()); + received.as_mut().poll(cx).map(|result| result.unwrap()) + }) + .await; + drop(operation); + server.await.unwrap(); + }); +} + +#[test] +fn zero_limit_accepts_empty_body_and_exact_limit_accepts_all_bytes() { + run(async { + for body in ["", "exact"] { + let listener = bind_listener().await; + let endpoint = url(&listener); + let server = tokio::spawn(async move { + let (mut socket, _) = listener.accept().await.unwrap(); + request(&mut socket).await; + socket + .write_all( + format!( + "HTTP/1.1 200 OK\r\nContent-Length: {}\r\n\r\n{body}", + body.len() + ) + .as_bytes(), + ) + .await + .unwrap(); + }); + let mut bytes = Vec::new(); + Transport::new() + .unwrap() + .post( + &endpoint, + HeaderMap::new(), + vec![], + Limits { + deadline: deadline(), + max_response_bytes: body.len(), + }, + &Cancellation::default(), + |_, chunk| { + bytes.extend_from_slice(chunk); + Ok(()) + }, + ) + .await + .unwrap(); + assert_eq!(bytes, body.as_bytes()); + server.await.unwrap(); + } + }); +} diff --git a/scripts/fixtures/anthropic-cache-recorder.ts b/scripts/fixtures/anthropic-cache-recorder.ts new file mode 100644 index 0000000000..0502b51a8a --- /dev/null +++ b/scripts/fixtures/anthropic-cache-recorder.ts @@ -0,0 +1,91 @@ +import { createHash } from "node:crypto"; +import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { Type } from "typebox"; +import { ModelRegistry } from "../../packages/coding-agent/src/core/model-registry.ts"; +import { AuthStorage } from "../../packages/coding-agent/src/core/auth-storage.ts"; +import { streamAnthropic } from "../../packages/ai/src/providers/anthropic.ts"; +import type { AssistantMessage, AssistantMessageEvent, CacheRetention, Context, Message, Model, ToolResultMessage, UserMessage } from "../../packages/ai/src/types.ts"; +import { cases as streams } from "./anthropic-provider-cases.ts"; + +type History = {role:"user";text?:string;content?:UserMessage["content"]} | {role:"assistant";content:AssistantMessage["content"]} | {role:"toolResult";toolCallId:string;isError:boolean;content:ToolResultMessage["content"]}; +type Scenario = {id:string;retention?:CacheRetention;provider?:string;compat?:Record;tools?:boolean;system?:string;user?:string;boundary?:unknown;bypass?:boolean;history?:History[]}; +const image = {type:"image" as const,mimeType:"image/png",data:"AAAA"}; +const call:History = {role:"assistant",content:[{type:"toolCall",id:"r1",name:"read",arguments:{path:"fixture"}}]}; +const result:History = {role:"toolResult",toolCallId:"r1",isError:false,content:[{type:"text",text:"result"}]}; +const scenarios:Scenario[] = [ + {id:"none",retention:"none"}, + {id:"short"}, + {id:"long",retention:"long"}, + {id:"long-unsupported",retention:"long",compat:{supportsLongCacheRetention:false}}, + {id:"tools-short",tools:true}, + {id:"tools-long",tools:true,retention:"long"}, + {id:"tools-no-cache-control",tools:true,compat:{supportsCacheControlOnTools:false}}, + {id:"fireworks-long",tools:true,retention:"long",provider:"fireworks"}, + {id:"empty-system",system:""}, + {id:"no-user",user:""}, + {id:"last-assistant",user:"",history:[{role:"assistant",content:[{type:"text",text:"answer"}]}]}, + {id:"boundary-short",boundary:6}, + {id:"boundary-long",boundary:6,retention:"long"}, + {id:"boundary-none",boundary:6,retention:"none"}, + {id:"boundary-end",boundary:16}, + {id:"boundary-surrogate",system:"A🌍B",boundary:2}, + {id:"boundary-zero",boundary:0}, + {id:"boundary-negative",boundary:-1}, + {id:"boundary-beyond",boundary:999}, + {id:"boundary-fraction",boundary:1.5}, + {id:"boundary-string",boundary:"6"}, + {id:"boundary-null",boundary:null}, + {id:"bypass-no-boundary",bypass:true}, + {id:"bypass-valid",bypass:true,boundary:6}, + {id:"bypass-false",bypass:false,boundary:6}, + {id:"history-text",user:"",history:[{role:"user",text:"previous"}]}, + {id:"history-image",user:"",history:[{role:"user",content:[image]}]}, + {id:"history-image-tail",user:"",history:[{role:"user",content:[{type:"text",text:"caption"},image]}]}, + {id:"tool-result",user:"",history:[call,result]}, + {id:"missing-tool-result",user:"",history:[call]}, + {id:"blocks-blank",user:"",history:[{role:"user",content:[{type:"text",text:"one"},{type:"text",text:" "}]}]}, + {id:"empty-history-block",user:"",history:[{role:"user",content:[]}]}, +]; +function message(h:History,model:Model<"anthropic-messages">):Message { + if(h.role==="user") return {role:"user",content:h.content??h.text??"",timestamp:0}; + if(h.role==="toolResult") return {...h,toolName:"read",timestamp:0}; + return {...h,api:model.api,provider:model.provider,model:model.id,stopReason:"stop",timestamp:0,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}}}; +} +const home=mkdtempSync(join(tmpdir(),"omk-cache-oracle-")); const original=globalThis.fetch; +try { + const cases=[]; + for(const s of scenarios) { + const provider=s.provider??"anthropic"; const runtime="faux-runtime"; + const definition={id:"synthetic-cache",reasoning:false,input:["text","image"],compat:s.compat}; + const overlay=JSON.stringify({providers:{[provider]:{api:"anthropic-messages",baseUrl:"https://synthetic.invalid/v1/",apiKey:"faux-config",models:[definition]}}}); + const path=join(home,"models.json"); writeFileSync(path,overlay); + const auth=AuthStorage.inMemory(); auth.setRuntimeApiKey(provider,runtime); + const registry=ModelRegistry.createReadOnly(auth,path); const model=registry.find(provider,definition.id) as Model<"anthropic-messages">; + const resolved=await registry.getApiKeyAndHeaders(model); if(!resolved.ok||!resolved.apiKey) throw new Error("synthetic auth failed"); + let request:unknown; + globalThis.fetch=async(url,init)=> { + if(String(url)!=="https://synthetic.invalid/v1/messages"||request) throw new Error("unexpected request/retry"); + const headers=Object.fromEntries([...new Headers(init?.headers)].filter(([k])=>!k.startsWith("x-stainless-")&&k!=="user-agent")); + if(headers["x-api-key"]!==runtime||headers.authorization) throw new Error("non-synthetic credentials refused"); + request={url:String(url),headers,body:init?.body}; return new Response(streams[0].wire,{headers:{"content-type":"text/event-stream"}}); + }; + const system=s.system??"Stable: dynamic!"; const user=s.user??"Hello 🌍"; + const history=s.history??[]; const messages=history.map(h=>message(h,model)); messages.push({role:"user",content:user,timestamp:0}); + const tools=s.tools?["read","write"].map(name=>({name,description:`Synthetic ${name}`,parameters:Type.Object({path:Type.String()})})):undefined; + const boundary=Object.hasOwn(s,"boundary")?{systemPromptCacheBoundary:s.boundary}:{}; + // Invalid boundary values intentionally exercise the runtime contract, beyond its static type. + const context={systemPrompt:system,messages,tools,...boundary,systemPromptCacheBoundaryBypass:s.bypass} as Context; + const options={cacheRetention:s.retention??"short"}; + const stream=streamAnthropic(model,context,{...options,apiKey:resolved.apiKey,headers:resolved.headers,maxTokens:64,maxRetries:0}); + const events=[]; + for await(const event of stream) { const {partial:_p,message:_m,error:_e,...projection}=event as Partial&{partial?:unknown;message?:unknown;error?:unknown}; events.push(projection); } + const {timestamp:_t,usage,...output}=await stream.result(); const {cost:_c,...tokens}=usage; + if(!request||output.stopReason==="error") throw new Error(`recording failed: ${s.id}`); + const input={model:definition.id,maxTokens:64,system,user,history,tools:s.tools?["read","write"].map(name=>({name,description:`Synthetic ${name}`,properties:{path:{type:"string"}},required:["path"]})):[],options,...boundary,...(s.bypass===undefined?{}:{systemPromptCacheBoundaryBypass:s.bypass})}; + cases.push({id:s.id,overlay,provider,input,runtime,request,events,result:{...output,usage:tokens},wire:streams[0].wire}); + } + const source=Object.fromEntries(["scripts/fixtures/anthropic-cache-recorder.ts","scripts/fixtures/anthropic-provider-cases.ts","packages/ai/src/providers/anthropic.ts","packages/ai/src/providers/anthropic-compat.ts","packages/ai/src/providers/prompt-cache.ts","packages/ai/src/providers/tool-schema.ts","packages/ai/src/providers/transform-messages.ts","packages/ai/src/utils/sanitize-unicode.ts","packages/coding-agent/src/core/model-registry.ts","node_modules/@anthropic-ai/sdk/package.json"].map(p=>[p,createHash("sha256").update(readFileSync(p)).digest("hex")])); + console.log(JSON.stringify({schema:"omk.anthropic-cache.v1",source,cases})); +} finally {globalThis.fetch=original;rmSync(home,{recursive:true,force:true});} diff --git a/scripts/fixtures/anthropic-content-cases.ts b/scripts/fixtures/anthropic-content-cases.ts new file mode 100644 index 0000000000..0e668bbfb7 --- /dev/null +++ b/scripts/fixtures/anthropic-content-cases.ts @@ -0,0 +1,43 @@ +import type { ImageContent, TextContent, ToolCall } from "../../packages/ai/src/types.ts"; + +type Content = TextContent | ImageContent; +type History = + | { role: "user"; content: Content[] } + | { role: "assistant"; content: ToolCall[]; stopReason: "toolUse" | "error" } + | { role: "toolResult"; toolCallId: string; content: Content[]; isError: boolean }; +const text = (text: string): TextContent => ({ type: "text", text }); +const image = (mimeType = "image/png", data = "c3ludGhldGlj"): ImageContent => ({ type: "image", mimeType, data }); +const user = (content: Content[]): History => ({ role: "user", content }); +const assistant = (stopReason: "toolUse" | "error" = "toolUse"): History => ({ role: "assistant", content: [{ type: "toolCall", id: "call_1", name: "read", arguments: {} }], stopReason }); +const result = (content: Content[], toolCallId = "call_1"): History => ({ role: "toolResult", toolCallId, content, isError: false }); +const userPlaceholder = "(image omitted: model does not support images)"; +const toolPlaceholder = "(tool image omitted: model does not support images)"; + +export const scenarios: { id: string; history: History[] }[] = [ + { id: "user-empty-array", history: [user([])] }, + { id: "user-blank-array", history: [user([text(""), text(" \t\n\uFEFF")])] }, + { id: "user-text-array", history: [user([text("First 한글"), text("Second 🌏")])] }, + { id: "user-whitespace", history: [user([text(" Keep "), text(""), text("\n"), text(" Last ")])] }, + { id: "user-ecma-whitespace", history: [user([text("\u0085"), text("\uFEFF"), text("\u2003")])] }, + { id: "user-image", history: [user([image()])] }, + { id: "user-adjacent-images", history: [user([image(), image("image/jpeg"), image("image/webp")])] }, + { id: "user-separated-images", history: [user([image(), text("Middle"), image()])] }, + { id: "user-placeholder-before", history: [user([text(userPlaceholder), image()])] }, + { id: "user-placeholder-after", history: [user([image(), text(userPlaceholder), image()])] }, + { id: "user-blank-between-images", history: [user([image(), text(""), image()])] }, + { id: "user-mime-data-ignored", history: [user([image("application/synthetic", "not base64 🌏")])] }, + { id: "tool-empty-array", history: [assistant(), result([])] }, + { id: "tool-blank-array", history: [assistant(), result([text(""), text(" \t\n\uFEFF")])] }, + { id: "tool-text-array", history: [assistant(), result([text("First"), text(""), text("Last 한글")])] }, + { id: "tool-image", history: [assistant(), result([image()])] }, + { id: "tool-adjacent-images", history: [assistant(), result([image(), image()])] }, + { id: "tool-separated-images", history: [assistant(), result([image(), text("Middle"), image()])] }, + { id: "tool-placeholder-before", history: [assistant(), result([text(toolPlaceholder), image()])] }, + { id: "tool-placeholder-after", history: [assistant(), result([image(), text(toolPlaceholder), image()])] }, + { id: "tool-blank-between-images", history: [assistant(), result([image(), text(""), image()])] }, + { id: "tool-grouped-images", history: [assistant(), result([image()]), result([image(), text("Next")])] }, + { id: "array-interrupts-tool", history: [assistant(), user([image()]), result([image()])] }, + { id: "blank-array-separates-results", history: [assistant(), result([image()]), user([]), result([image()])] }, + { id: "orphan-image", history: [result([image()], "orphan")] }, + { id: "failed-assistant-image", history: [assistant("error"), result([image()])] }, +]; diff --git a/scripts/fixtures/anthropic-content-recorder.ts b/scripts/fixtures/anthropic-content-recorder.ts new file mode 100644 index 0000000000..68f6e0e649 --- /dev/null +++ b/scripts/fixtures/anthropic-content-recorder.ts @@ -0,0 +1,50 @@ +import { createHash } from "node:crypto"; +import { readFileSync } from "node:fs"; +import { streamAnthropic } from "../../packages/ai/src/providers/anthropic.ts"; +import type { Message } from "../../packages/ai/src/types.ts"; +import { scenarios } from "./anthropic-content-cases.ts"; +import { model } from "./anthropic-provider-cases.ts"; + +const files = [ + "scripts/fixtures/anthropic-content-recorder.ts", "scripts/fixtures/anthropic-content-cases.ts", + "scripts/fixtures/anthropic-provider-cases.ts", "packages/ai/src/providers/anthropic.ts", + "packages/ai/src/providers/anthropic-client.ts", "packages/ai/src/providers/anthropic-compat.ts", + "packages/ai/src/providers/transform-messages.ts", "packages/ai/src/utils/sanitize-unicode.ts", + "packages/ai/src/providers/anthropic-image-guard.ts", "node_modules/@anthropic-ai/sdk/package.json", +]; +if (model.input.includes("image")) throw new Error("this oracle requires the recorded text-only model"); +const originalFetch = globalThis.fetch; +const recorded = []; +try { + for (const scenario of scenarios) { + let request: { url: string; headers: Record; body: string } | undefined; + globalThis.fetch = async (url, init) => { + if (String(url) !== "https://synthetic.invalid/v1/messages" || request) throw new Error("unexpected request or retry"); + if (typeof init?.body !== "string") throw new Error("expected SDK serialized request"); + const headers = Object.fromEntries([...new Headers(init.headers)].filter(([key]) => !key.startsWith("x-stainless-") && key !== "user-agent")); + if (headers["x-api-key"] !== "faux-key" || headers.authorization) throw new Error("non-synthetic credential refused"); + request = { url: String(url), headers, body: init.body }; + return new Response("", { headers: { "content-type": "text/event-stream" } }); + }; + const messages: Message[] = scenario.history.map((message): Message => { + if (message.role === "user") return { ...message, timestamp: 0 }; + if (message.role === "toolResult") return { ...message, toolName: "read", timestamp: 0 }; + return { ...message, api: model.api, provider: model.provider, model: model.id, timestamp: 0, + usage: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, totalTokens: 0, cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 } } }; + }); + const user = "Continue"; + messages.push({ role: "user", content: user, timestamp: 0 }); + const stream = streamAnthropic(model, { messages }, { apiKey: "faux-key", cacheRetention: "none", maxTokens: 64, maxRetries: 0 }); + for await (const _event of stream) { /* Drain the real provider without retaining mutable snapshots. */ } + if (!request || (await stream.result()).stopReason === "error") throw new Error(`recording failed: ${scenario.id}`); + recorded.push({ id: scenario.id, input: { model: model.id, maxTokens: 64, system: "", user, tools: [], history: scenario.history }, request }); + } +} finally { + globalThis.fetch = originalFetch; +} +console.log(JSON.stringify({ + schema: "omk.anthropic.content.v1", + source: Object.fromEntries(files.map((file) => [file, createHash("sha256").update(readFileSync(file)).digest("hex")])), + projection: { headersExcluded: ["x-stainless-*", "user-agent"], scope: "text-only model user arrays and image downgrade, same-model tool results, API key, cache disabled" }, + cases: recorded, +}, null, 2)); diff --git a/scripts/fixtures/anthropic-policy-recorder.ts b/scripts/fixtures/anthropic-policy-recorder.ts new file mode 100644 index 0000000000..e85a5c5f1d --- /dev/null +++ b/scripts/fixtures/anthropic-policy-recorder.ts @@ -0,0 +1,68 @@ +import { createHash } from "node:crypto"; +import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { Type } from "typebox"; +import { ModelRegistry } from "../../packages/coding-agent/src/core/model-registry.ts"; +import { AuthStorage } from "../../packages/coding-agent/src/core/auth-storage.ts"; +import { streamAnthropic, type AnthropicOptions } from "../../packages/ai/src/providers/anthropic.ts"; +import type { AssistantMessageEvent, Model } from "../../packages/ai/src/types.ts"; +import { cases as streams } from "./anthropic-provider-cases.ts"; +const scenarios: {id:string; reasoning?:boolean; compat?:Record; tool?:boolean; options:AnthropicOptions}[] = [ + {id:"default",options:{}}, + {id:"temperature-zero",options:{temperature:0}}, + {id:"temperature-half",options:{temperature:0.5}}, + {id:"temperature-one",options:{temperature:1}}, + {id:"temperature-unsupported",compat:{supportsTemperature:false},options:{temperature:0.5}}, + {id:"temperature-thinking-nonreasoning",options:{temperature:0.5,thinkingEnabled:true}}, + {id:"thinking-nonreasoning",options:{thinkingEnabled:true,thinkingBudgetTokens:256}}, + {id:"thinking-default",reasoning:true,options:{thinkingEnabled:true}}, + {id:"thinking-zero-budget",reasoning:true,options:{thinkingEnabled:true,thinkingBudgetTokens:0}}, + {id:"thinking-budget",reasoning:true,options:{thinkingEnabled:true,thinkingBudgetTokens:256}}, + {id:"thinking-omitted",reasoning:true,options:{thinkingEnabled:true,thinkingDisplay:"omitted"}}, + {id:"thinking-disabled",reasoning:true,options:{thinkingEnabled:false}}, + {id:"disabled-unsupported",reasoning:true,compat:{supportsDisabledThinking:false},options:{thinkingEnabled:false}}, + {id:"disabled-temperature",reasoning:true,options:{thinkingEnabled:false,temperature:0.5}}, + {id:"enabled-temperature",reasoning:true,options:{thinkingEnabled:true,temperature:0.5}}, + {id:"adaptive-default",reasoning:true,compat:{forceAdaptiveThinking:true},options:{thinkingEnabled:true}}, + ...(["low","medium","high","xhigh","max"] as const).map(effort=>({id:`adaptive-${effort}`,reasoning:true,compat:{forceAdaptiveThinking:true},options:{thinkingEnabled:true,effort}})), + {id:"adaptive-omitted",reasoning:true,compat:{forceAdaptiveThinking:true},options:{thinkingEnabled:true,thinkingDisplay:"omitted",effort:"high"}}, + {id:"adaptive-disabled",reasoning:true,compat:{forceAdaptiveThinking:true},options:{thinkingEnabled:false}}, + {id:"classic-effort-ignored",reasoning:true,options:{thinkingEnabled:true,effort:"high"}}, + {id:"metadata",options:{metadata:{user_id:"synthetic-user"}}}, + {id:"metadata-empty",options:{metadata:{user_id:""}}}, + {id:"metadata-unicode",options:{metadata:{user_id:"한글 🌍"}}}, + {id:"metadata-other-ignored",options:{metadata:{other:"ignored"}}}, + {id:"tool-auto",tool:true,options:{toolChoice:"auto"}}, + {id:"tool-any",tool:true,options:{toolChoice:"any"}}, + {id:"tool-none",tool:true,options:{toolChoice:"none"}}, + {id:"tool-named",tool:true,options:{toolChoice:{type:"tool",name:"read"}}}, +]; +const home=mkdtempSync(join(tmpdir(),"omk-policy-oracle-")); const original=globalThis.fetch; +try { + const cases=[]; + for(const s of scenarios) { + const provider="anthropic"; const runtime="faux-runtime"; + const definition={id:"synthetic-policy",reasoning:s.reasoning??false,input:["text"],compat:s.compat}; + const overlay=JSON.stringify({providers:{anthropic:{api:"anthropic-messages",baseUrl:"https://synthetic.invalid/v1/",apiKey:"faux-config",models:[definition]}}}); + const path=join(home,"models.json"); writeFileSync(path,overlay); + const auth=AuthStorage.inMemory(); auth.setRuntimeApiKey(provider,runtime); + const registry=ModelRegistry.createReadOnly(auth,path); const model=registry.find(provider,definition.id) as Model<"anthropic-messages">; + const resolved=await registry.getApiKeyAndHeaders(model); if(!resolved.ok||!resolved.apiKey) throw new Error("synthetic auth failed"); + let request:unknown; + globalThis.fetch=async(url,init)=> { + if(String(url)!=="https://synthetic.invalid/v1/messages"||request) throw new Error("unexpected request/retry"); + const headers=Object.fromEntries([...new Headers(init?.headers)].filter(([k])=>!k.startsWith("x-stainless-")&&k!=="user-agent")); + request={url:String(url),headers,body:init?.body}; return new Response(streams[0].wire,{headers:{"content-type":"text/event-stream"}}); + }; + const tools=s.tool?[{name:"read",description:"Read synthetic file",parameters:Type.Object({path:Type.String()})}]:undefined; + const stream=streamAnthropic(model,{systemPrompt:"Synthetic system",messages:[{role:"user",content:"Hello 🌍",timestamp:0}],tools},{...s.options,apiKey:resolved.apiKey,headers:resolved.headers,cacheRetention:"none",maxTokens:64,maxRetries:0}); + const events=[]; + for await(const event of stream) { const {partial:_p,message:_m,error:_e,...projection}=event as Partial&{partial?:unknown;message?:unknown;error?:unknown}; events.push(projection); } + const {timestamp:_t,usage,...result}=await stream.result(); const {cost:_c,...tokens}=usage; + const input={model:definition.id,maxTokens:64,system:"Synthetic system",user:"Hello 🌍",tools:s.tool?[{name:"read",description:"Read synthetic file",properties:{path:{type:"string"}},required:["path"]}]:[],options:s.options}; + cases.push({id:s.id,overlay,provider,input,runtime,request,events,result:{...result,usage:tokens},wire:streams[0].wire}); + } + const source=Object.fromEntries(["scripts/fixtures/anthropic-policy-recorder.ts","scripts/fixtures/anthropic-provider-cases.ts","packages/ai/src/providers/anthropic.ts","packages/ai/src/providers/anthropic-compat.ts","packages/coding-agent/src/core/model-registry.ts"].map(p=>[p,createHash("sha256").update(readFileSync(p)).digest("hex")])); + console.log(JSON.stringify({schema:"omk.anthropic-policy.v1",source,cases})); +} finally {globalThis.fetch=original;rmSync(home,{recursive:true,force:true});} diff --git a/scripts/fixtures/anthropic-signature-recorder.ts b/scripts/fixtures/anthropic-signature-recorder.ts new file mode 100644 index 0000000000..4d91acaf82 --- /dev/null +++ b/scripts/fixtures/anthropic-signature-recorder.ts @@ -0,0 +1,40 @@ +import { createHash } from "node:crypto"; +import { readFileSync } from "node:fs"; +import { streamAnthropic } from "../../packages/ai/src/providers/anthropic.ts"; +import type { AssistantMessage, AssistantMessageEvent, ThinkingContent } from "../../packages/ai/src/types.ts"; +import { cases as streams, model as base } from "./anthropic-provider-cases.ts"; +const variants:[string,Partial][] = [ + ["missing",{}], ["empty",{thinkingSignature:""}], ["space",{thinkingSignature:" "}], + ["BOM",{thinkingSignature:"\uFEFF"}], ["NEL",{thinkingSignature:"\u0085"}], + ["signed",{thinkingSignature:"signed"}], ["empty-text",{thinking:"",thinkingSignature:"signed"}], + ["redacted",{thinking:"",redacted:true,thinkingSignature:"opaque"}], + ["redacted-empty",{thinking:"",redacted:true,thinkingSignature:""}], +]; +const original=globalThis.fetch; +try { + const cases=[]; + for(const allowEmptySignature of [false,true]) for(const [label,extra] of variants) { + const id=`${allowEmptySignature}-${label}`; + const model={...base,id:"synthetic-signature",compat:{allowEmptySignature}}; + const block:ThinkingContent={type:"thinking",thinking:"thought",...extra}; + const history=[{role:"assistant" as const,content:[block]}]; + const assistant:AssistantMessage={...history[0],api:model.api,provider:model.provider,model:model.id,stopReason:"stop",timestamp:0,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}}}; + let request:unknown; + globalThis.fetch=async(url,init)=> { + if(String(url)!=="https://synthetic.invalid/v1/messages"||request) throw new Error("unexpected request/retry"); + const headers=Object.fromEntries([...new Headers(init?.headers)].filter(([k])=>!k.startsWith("x-stainless-")&&k!=="user-agent")); + if(headers["x-api-key"]!=="faux-runtime"||headers.authorization) throw new Error("non-synthetic credentials refused"); + request={url:String(url),headers,body:init?.body}; return new Response(streams[0].wire,{headers:{"content-type":"text/event-stream"}}); + }; + const stream=streamAnthropic(model,{systemPrompt:"Synthetic system",messages:[assistant,{role:"user",content:"Continue",timestamp:0}]},{apiKey:"faux-runtime",cacheRetention:"none",maxTokens:64,maxRetries:0}); + const events=[]; + for await(const event of stream) {const {partial:_p,message:_m,error:_e,...projection}=event as Partial&{partial?:unknown;message?:unknown;error?:unknown};events.push(projection);} + const {timestamp:_t,usage,...output}=await stream.result();const {cost:_c,...tokens}=usage; + if(!request||output.stopReason==="error") throw new Error(`recording failed: ${id}`); + const overlay=JSON.stringify({providers:{anthropic:{api:model.api,baseUrl:"https://synthetic.invalid",models:[{id:model.id,input:["text"],compat:model.compat}]}}}); + const input={model:model.id,maxTokens:64,system:"Synthetic system",user:"Continue",tools:[],history,...(label==="empty"?{options:{}}:{})}; + cases.push({id,overlay,provider:model.provider,input,runtime:"faux-runtime",request,events,result:{...output,usage:tokens},wire:streams[0].wire}); + } + const source=Object.fromEntries(["scripts/fixtures/anthropic-signature-recorder.ts","scripts/fixtures/anthropic-provider-cases.ts","packages/ai/src/providers/anthropic.ts","packages/ai/src/providers/anthropic-compat.ts","packages/ai/src/providers/transform-messages.ts","node_modules/@anthropic-ai/sdk/package.json"].map(p=>[p,createHash("sha256").update(readFileSync(p)).digest("hex")])); + console.log(JSON.stringify({schema:"omk.anthropic-signature.v1",source,cases})); +} finally {globalThis.fetch=original;} diff --git a/scripts/fixtures/anthropic-tool-history-cases.ts b/scripts/fixtures/anthropic-tool-history-cases.ts new file mode 100644 index 0000000000..3a572b4e08 --- /dev/null +++ b/scripts/fixtures/anthropic-tool-history-cases.ts @@ -0,0 +1,40 @@ +import type { AssistantMessage, TextContent, ToolCall } from "../../packages/ai/src/types.ts"; + +type Thinking = { type: "thinking"; thinking: string; thinkingSignature?: string; redacted?: boolean }; +export type History = + | { role: "user"; text: string } + | { role: "assistant"; content: (TextContent | ToolCall | Thinking)[]; stopReason?: AssistantMessage["stopReason"] } + | { role: "toolResult"; toolCallId: string; content: TextContent[]; isError: boolean }; +const text = (value: string): TextContent => ({ type: "text", text: value }); +const call = (id = "call_1", args: Record = { path: "한글/🌍.txt" }): ToolCall => ({ type: "toolCall", id, name: "read", arguments: args }); +const assistant = (content: (TextContent | ToolCall | Thinking)[], stopReason?: AssistantMessage["stopReason"]): History => ({ role: "assistant", content, ...(stopReason ? { stopReason } : {}) }); +const result = (toolCallId = "call_1", content = [text("Synthetic result")], isError = false): History => ({ role: "toolResult", toolCallId, content, isError }); +const calls = () => assistant([text("Reading"), call(), call("call_2", { path: "second.txt" })], "toolUse"); + +export const scenarios: { id: string; history: History[]; user?: string }[] = [ + { id: "single-tool", history: [assistant([call()], "toolUse"), result()] }, + { id: "parallel-tools", history: [calls(), result(), result("call_2")] }, + { id: "reverse-results", history: [calls(), result("call_2"), result()] }, + { id: "missing-all-results", history: [calls()] }, + { id: "missing-one-result", history: [calls(), result("call_2")] }, + { id: "missing-at-eof", history: [calls()], user: "" }, + { id: "interrupted-by-user", history: [calls(), { role: "user", text: "Interrupt" }, result()] }, + { id: "interrupted-by-assistant", history: [calls(), assistant([text("Next assistant")]), result()] }, + { id: "orphan-results", history: [result("unknown"), result("")] }, + { id: "error-assistant", history: [assistant([call(), text("Incomplete")], "error"), result()] }, + { id: "aborted-assistant", history: [assistant([call()], "aborted"), result()] }, + { id: "error-flushes-pending", history: [calls(), assistant([call("failed")], "error"), result("failed")] }, + { id: "trim-result-id", history: [assistant([call()], "toolUse"), result(" \tcall_1\uFEFF")] }, + { id: "same-model-id-unchanged", history: [assistant([call("call|🌍")], "toolUse"), result("call|🌍")] }, + { id: "duplicate-results", history: [assistant([call()], "toolUse"), result(), result()] }, + { id: "empty-tool-result", history: [assistant([call()], "toolUse"), result("call_1", [])] }, + { id: "multiblock-error-result", history: [assistant([call()], "toolUse"), result("call_1", [text("First"), text(""), text("Last\n🌏")], true)] }, + { id: "argument-key-order", history: [assistant([call("call_1", { z: 1, a: { second: [null, false, 0.25], first: "quote: \" slash: \\ nul: \0" }, "10": 10, "2": 2 })], "toolUse"), result()] }, + { id: "signed-thinking", history: [assistant([{ type: "thinking", thinking: "Reasoning 한글", thinkingSignature: "synthetic-signature" }, call()], "toolUse"), result()] }, + { id: "unsigned-thinking", history: [assistant([{ type: "thinking", thinking: "Unsigned reasoning" }, text("Reply")])] }, + { id: "blank-signature", history: [assistant([{ type: "thinking", thinking: "Reasoning", thinkingSignature: " \t" }])] }, + { id: "empty-thinking", history: [assistant([{ type: "thinking", thinking: "\uFEFF ", thinkingSignature: "synthetic-signature" }])] }, + { id: "redacted-thinking", history: [assistant([{ type: "thinking", thinking: "", thinkingSignature: "synthetic-opaque", redacted: true }, text("Reply")])] }, + { id: "blank-blocks", history: [assistant([text(" \t"), text("\u0085"), text(" Keep ")])] }, + { id: "two-tool-turns", history: [assistant([call()], "toolUse"), result(), assistant([call("call_2")], "toolUse"), result("call_2"), assistant([text("Done")])] }, +]; diff --git a/scripts/fixtures/anthropic-tool-history-recorder.ts b/scripts/fixtures/anthropic-tool-history-recorder.ts new file mode 100644 index 0000000000..8e6c29ff02 --- /dev/null +++ b/scripts/fixtures/anthropic-tool-history-recorder.ts @@ -0,0 +1,49 @@ +import { createHash } from "node:crypto"; +import { readFileSync } from "node:fs"; +import { streamAnthropic } from "../../packages/ai/src/providers/anthropic.ts"; +import type { Message } from "../../packages/ai/src/types.ts"; +import { model } from "./anthropic-provider-cases.ts"; +import { scenarios } from "./anthropic-tool-history-cases.ts"; + +const files = [ + "scripts/fixtures/anthropic-tool-history-recorder.ts", "scripts/fixtures/anthropic-tool-history-cases.ts", + "scripts/fixtures/anthropic-provider-cases.ts", "packages/ai/src/providers/anthropic.ts", + "packages/ai/src/providers/anthropic-client.ts", "packages/ai/src/providers/anthropic-compat.ts", + "packages/ai/src/providers/transform-messages.ts", "packages/ai/src/utils/sanitize-unicode.ts", + "packages/ai/src/providers/anthropic-image-guard.ts", "node_modules/@anthropic-ai/sdk/package.json", +]; +const originalFetch = globalThis.fetch; +const recorded = []; +try { + for (const scenario of scenarios) { + let request: { url: string; headers: Record; body: string } | undefined; + globalThis.fetch = async (url, init) => { + if (String(url) !== "https://synthetic.invalid/v1/messages" || request) throw new Error("unexpected request or retry"); + if (typeof init?.body !== "string") throw new Error("expected SDK serialized request"); + const headers = Object.fromEntries([...new Headers(init.headers)].filter(([key]) => !key.startsWith("x-stainless-") && key !== "user-agent")); + if (headers["x-api-key"] !== "faux-key" || headers.authorization) throw new Error("non-synthetic credential refused"); + request = { url: String(url), headers, body: init.body }; + return new Response("", { headers: { "content-type": "text/event-stream" } }); + }; + const messages: Message[] = scenario.history.map((message): Message => { + if (message.role === "user") return { role: "user", content: message.text, timestamp: 0 }; + if (message.role === "toolResult") return { ...message, toolName: "read", timestamp: 0 }; + return { ...message, api: model.api, provider: model.provider, model: model.id, stopReason: message.stopReason ?? "stop", timestamp: 0, + usage: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, totalTokens: 0, cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 } } }; + }); + const user = scenario.user ?? "Continue"; + messages.push({ role: "user", content: user, timestamp: 0 }); + const stream = streamAnthropic(model, { messages }, { apiKey: "faux-key", cacheRetention: "none", maxTokens: 64, maxRetries: 0 }); + for await (const _event of stream) { /* Drain the real provider without retaining mutable snapshots. */ } + if (!request || (await stream.result()).stopReason === "error") throw new Error(`recording failed: ${scenario.id}`); + recorded.push({ id: scenario.id, input: { model: model.id, maxTokens: 64, system: "", user, tools: [], history: scenario.history }, request }); + } +} finally { + globalThis.fetch = originalFetch; +} +console.log(JSON.stringify({ + schema: "omk.anthropic.tool-history.v1", + source: Object.fromEntries(files.map((file) => [file, createHash("sha256").update(readFileSync(file)).digest("hex")])), + projection: { headersExcluded: ["x-stainless-*", "user-agent"], scope: "same-model tools, text results and thinking history, API key, cache disabled" }, + cases: recorded, +}, null, 2)); diff --git a/scripts/fixtures/anthropic-tool-schema-recorder.ts b/scripts/fixtures/anthropic-tool-schema-recorder.ts new file mode 100644 index 0000000000..52eed49c37 --- /dev/null +++ b/scripts/fixtures/anthropic-tool-schema-recorder.ts @@ -0,0 +1,52 @@ +import { createHash } from "node:crypto"; +import { readFileSync } from "node:fs"; +import { streamAnthropic } from "../../packages/ai/src/providers/anthropic.ts"; +import { stableToolSchema } from "../../packages/ai/src/providers/tool-schema.ts"; +import type { AssistantMessageEvent, CacheRetention, Tool } from "../../packages/ai/src/types.ts"; +import { cases as streams, model as base } from "./anthropic-provider-cases.ts"; +type Spec = {name:string;properties:unknown;required?:string[]}; +const locale=new Intl.Collator().resolvedOptions().locale; +if(locale!=="en-US") throw new Error(`unexpected default collation locale: ${locale}`); +const chars=[..."_-0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ"].reverse(); +const shuffled=[...chars.filter((_,i)=>i%2===1),...chars.filter((_,i)=>i%2===0)]; +const names=["readFile","read_file","Read","read","read-file","read10","read2","readfile","a","A","a_b","a-b","a1","ab","aB","Ab","AB","b","_x","-x","9z","Z","Read_","READ"]; +const nested=String.raw`{"zeta":{"type":"object","required":null,"properties":{"b":{"type":"integer","maximum":1e21},"a":{"type":"number","minimum":1e-7,"multipleOf":0.000001}}},"10":{"type":"string"},"9":{"type":"string"},"01":{"type":"string"},"4294967295":{"type":"string"},"4294967294":{"type":"string"},"Alpha":{"type":"array","items":[{"required":null,"y":2.5e-8,"x":1e300},null,true,"\u0001\u001f\u007f\u2028/\"\\"],"required":["y","x"]},"é":{"enum":[9007199254740992,0.5,-3]},"😀":{"const":"emoji"},"\uFFFD":{"const":"replacement"},"":{"const":"empty"},"__proto__":{"const":"own"},"required":null,"kept":null}`; +const values=["1.0","1E2","-0","1e400","-1e400","1e-400","5e-324","1.7976931348623157e308","123456789012345678901234567890","0.1","0.30000000000000004","1e21","1e-7","0.000001","1.5e300","9007199254740993", + String.raw`"\u0001\u001f\u007f\u2028/\"\\"`, String.raw`"\ud800"`, String.raw`[1,"x",true,false,null]`]; +const literals=[...values.map(v=>`{"v":${v}}`), String.raw`{ "b" : 1 , "a" : { "d" : null , "required" : null , "c" : [ { "required" : null , "z" : 1 , "y" : 2 } ] } }`, + String.raw`{"a":1,"a":2}`, "[]", "null", "5", nested]; +const tools=(specs:Spec[])=>specs.map(s=>({name:s.name,description:`Synthetic ${s.name}`,properties:s.properties,required:s.required??[]})); +const scenarios:{id:string;specs:Spec[];retention?:CacheRetention}[] = [ + {id:"collation-chars",specs:shuffled.map(name=>({name,properties:{}}))}, + {id:"collation-names",specs:names.map(name=>({name,properties:{path:{type:"string"}},required:["path"]}))}, + {id:"schema-canonical",specs:[{name:"schema",properties:JSON.parse(nested),required:["zeta","Alpha"]}]}, + {id:"properties-coerced",specs:[{name:"p_string",properties:"x"},{name:"p_array",properties:[]},{name:"p_null",properties:null}]}, + {id:"cache-last-sorted",specs:[{name:"write",properties:{path:{type:"string"}}},{name:"read",properties:{path:{type:"string"}}}],retention:"short"}, +]; +const original=globalThis.fetch; +try { + const cases=[]; + for(const s of scenarios) { + const model={...base,id:"synthetic-tool-schema"}; + const nodeTools:Tool[]=s.specs.map(t=>({name:t.name,description:`Synthetic ${t.name}`,parameters:{type:"object",properties:t.properties,required:t.required??[]} as unknown as Tool["parameters"]})); + let request:unknown; + globalThis.fetch=async(url,init)=> { + if(String(url)!=="https://synthetic.invalid/v1/messages"||request) throw new Error("unexpected request/retry"); + const headers=Object.fromEntries([...new Headers(init?.headers)].filter(([k])=>!k.startsWith("x-stainless-")&&k!=="user-agent")); + if(headers["x-api-key"]!=="faux-runtime"||headers.authorization) throw new Error("non-synthetic credentials refused"); + request={url:String(url),headers,body:init?.body}; return new Response(streams[0].wire,{headers:{"content-type":"text/event-stream"}}); + }; + const stream=streamAnthropic(model,{systemPrompt:"Synthetic system",messages:[{role:"user",content:"Use a tool",timestamp:0}],tools:nodeTools},{apiKey:"faux-runtime",cacheRetention:s.retention??"none",maxTokens:64,maxRetries:0}); + const events=[]; + for await(const event of stream) {const {partial:_p,message:_m,error:_e,...projection}=event as Partial&{partial?:unknown;message?:unknown;error?:unknown};events.push(projection);} + const {timestamp:_t,usage,...output}=await stream.result();const {cost:_c,...tokens}=usage; + if(!request||output.stopReason==="error") throw new Error(`recording failed: ${s.id}`); + const overlay=JSON.stringify({providers:{anthropic:{api:model.api,baseUrl:"https://synthetic.invalid",models:[{id:model.id,input:["text"]}]}}}); + const input={model:model.id,maxTokens:64,system:"Synthetic system",user:"Use a tool",tools:tools(s.specs),...(s.retention?{options:{cacheRetention:s.retention}}:{})}; + cases.push({id:s.id,overlay,provider:model.provider,input,runtime:"faux-runtime",request,events,result:{...output,usage:tokens},wire:streams[0].wire}); + } + // Literal texts exercise JSON.parse plus the exact Node canonicalizer the request path uses. + const schemas=literals.map(text=>({text,properties:JSON.stringify(stableToolSchema({type:"object",properties:JSON.parse(text),required:[]} as unknown as Tool["parameters"]).properties)})); + const source=Object.fromEntries(["scripts/fixtures/anthropic-tool-schema-recorder.ts","scripts/fixtures/anthropic-provider-cases.ts","packages/ai/src/providers/anthropic.ts","packages/ai/src/providers/tool-schema.ts","node_modules/@anthropic-ai/sdk/package.json"].map(p=>[p,createHash("sha256").update(readFileSync(p)).digest("hex")])); + console.log(JSON.stringify({schema:"omk.anthropic-tool-schema.v1",locale,source,cases,schemas})); +} finally {globalThis.fetch=original;} diff --git a/scripts/fixtures/anthropic-vision-cases.ts b/scripts/fixtures/anthropic-vision-cases.ts new file mode 100644 index 0000000000..4a0f806bb7 --- /dev/null +++ b/scripts/fixtures/anthropic-vision-cases.ts @@ -0,0 +1,90 @@ +import type { ImageContent, TextContent, ToolCall } from "../../packages/ai/src/types.ts"; + +type Content = TextContent | ImageContent; +type History = + | { role: "user"; content: Content[] } + | { role: "assistant"; content: ToolCall[]; stopReason: "toolUse" | "error" } + | { role: "toolResult"; toolCallId: string; content: Content[]; isError: boolean }; +const image = (data: string, mimeType = "image/png"): ImageContent => ({ type: "image", data, mimeType }); +const text = (text: string): TextContent => ({ type: "text", text }); +const png = (width: number, height: number) => { + const b = Buffer.alloc(24); b.set([0x89, 0x50, 0x4e, 0x47]); b.writeUInt32BE(width, 16); b.writeUInt32BE(height, 20); return b; +}; +const gif = (width: number, height: number) => { + const b = Buffer.alloc(10); b.write("GIF89a"); b.writeUInt16LE(width, 6); b.writeUInt16LE(height, 8); return b; +}; +const jpeg = (width: number, height: number, marker = 0xc0) => { + const b = Buffer.from([0xff, 0xd8, 0xff, marker, 0, 10, 8, 0, 0, 0, 0, 0]); b.writeUInt16BE(height, 7); b.writeUInt16BE(width, 9); return b; +}; +const webp = (kind: string, width: number, height: number) => { + const b = Buffer.alloc(30); b.write("RIFF"); b.write("WEBP", 8); b.write(kind, 12); + if (kind === "VP8X") { b.writeUIntLE(width - 1, 24, 3); b.writeUIntLE(height - 1, 27, 3); } + if (kind === "VP8 ") { b.writeUInt16LE(width | 0xc000, 26); b.writeUInt16LE(height | 0xc000, 28); } + if (kind === "VP8L") { const w = width - 1; const h = height - 1; b[21] = w & 255; b[22] = ((w >> 8) & 63) | ((h & 3) << 6); b[23] = (h >> 2) & 255; b[24] = (h >> 10) & 15; } + return b; +}; +const windowJpeg = (sofOffset: number) => { + const b = Buffer.alloc(sofOffset + 10); b.set([0xff, 0xd8, 0xff, 0xe1]); b.writeUInt16BE(sofOffset - 4, 4); b.set(jpeg(1901, 1).subarray(2), sofOffset); return b; +}; +const encoded = (b: Buffer) => b.toString("base64"); +const oversized = encoded(png(1901, 1)); +export const images: { id: string; data: string; mimeType: string }[] = [ + { id: "png-limit", data: encoded(png(1900, 1900)), mimeType: "image/png" }, + { id: "png-wide", data: oversized, mimeType: "image/png" }, + { id: "png-tall", data: encoded(png(1, 1901)), mimeType: "image/png" }, + { id: "png-u32", data: encoded(png(0xffffffff, 2)), mimeType: "image/png" }, + { id: "png-short", data: encoded(png(1901, 1).subarray(0, 23)), mimeType: "image/png" }, + { id: "gif-limit", data: encoded(gif(1900, 1900)), mimeType: "image/gif" }, + { id: "gif-wide", data: encoded(gif(65535, 1)), mimeType: "image/gif" }, + { id: "gif-short", data: encoded(gif(1901, 1).subarray(0, 9)), mimeType: "image/gif" }, + { id: "jpeg-limit", data: encoded(jpeg(1900, 1900)), mimeType: "image/jpeg" }, + { id: "jpeg-wide", data: encoded(jpeg(1901, 1)), mimeType: "image/jpeg" }, + { id: "jpeg-app", data: encoded(Buffer.concat([Buffer.from([0xff, 0xd8, 0xff, 0xe1, 0, 4, 0, 0]), jpeg(1, 1901).subarray(2)])), mimeType: "image/jpeg" }, + { id: "jpeg-no-sof", data: encoded(Buffer.from([0xff, 0xd8, 0xff, 0xe1, 0, 0, 0, 0, 0, 0, 0, 0])), mimeType: "image/jpeg" }, + { id: "jpeg-excluded-marker", data: encoded(jpeg(1901, 1, 0xc4)), mimeType: "image/jpeg" }, + { id: "jpeg-noise", data: encoded(Buffer.concat([Buffer.from([0xff, 0xd8, 0]), jpeg(1901, 1).subarray(2)])), mimeType: "image/jpeg" }, + { id: "jpeg-short", data: encoded(jpeg(1901, 1).subarray(0, 11)), mimeType: "image/jpeg" }, + { id: "webp-x-limit", data: encoded(webp("VP8X", 1900, 1900)), mimeType: "image/webp" }, + { id: "webp-x-wide", data: encoded(webp("VP8X", 1901, 1)), mimeType: "image/webp" }, + { id: "webp-x-u24", data: encoded(webp("VP8X", 0x1000000, 1)), mimeType: "image/webp" }, + { id: "webp-lossy-flags", data: encoded(webp("VP8 ", 1900, 1900)), mimeType: "image/webp" }, + { id: "webp-l-limit", data: encoded(webp("VP8L", 1900, 1900)), mimeType: "image/webp" }, + { id: "webp-l-wide", data: encoded(webp("VP8L", 1901, 1)), mimeType: "image/webp" }, + { id: "webp-unknown", data: encoded(webp("NONE", 1901, 1)), mimeType: "image/webp" }, + { id: "webp-short", data: encoded(webp("VP8L", 1901, 1).subarray(0, 29)), mimeType: "image/webp" }, + { id: "unknown-format", data: encoded(Buffer.alloc(12)), mimeType: "application/synthetic" }, + { id: "empty-data", data: "", mimeType: "image/png" }, + { id: "invalid-base64", data: "!not base64!", mimeType: "image/png" }, + { id: "base64-whitespace", data: oversized.replaceAll(/(.{4})/g, "$1 \n"), mimeType: "image/png" }, + { id: "base64-url", data: encoded(jpeg(1901, 1)).replaceAll("/", "_").replaceAll("+", "-"), mimeType: "image/jpeg" }, + { id: "base64-unpadded", data: encoded(gif(1901, 1)).replaceAll("=", ""), mimeType: "image/gif" }, + { id: "base64-padding-stop", data: `${encoded(gif(1901, 1))}ignored`, mimeType: "image/gif" }, + { id: "base64-punctuation", data: oversized.replaceAll(/(.{4})/g, "$1!"), mimeType: "image/png" }, + { id: "jpeg-beyond-window", data: encoded(windowJpeg(65539)), mimeType: "image/jpeg" }, + { id: "jpeg-window-edge", data: encoded(windowJpeg(65528)), mimeType: "image/jpeg" }, + { id: "base64-unicode", data: `한글🌏${oversized}`, mimeType: "image/png" }, + { id: "mime-sniff", data: oversized, mimeType: "image/gif" }, +]; +const small = image(images[0].data); +const large = image(oversized); +const user = (content: Content[]): History => ({ role: "user", content }); +const assistant = (stopReason: "toolUse" | "error" = "toolUse"): History => ({ role: "assistant", content: [{ type: "toolCall", id: "call_1", name: "read", arguments: {} }], stopReason }); +const result = (content: Content[], toolCallId = "call_1"): History => ({ role: "toolResult", toolCallId, content, isError: false }); +export const scenarios: { id: string; history: History[] }[] = [ + ...images.map((entry) => ({ id: entry.id, history: [user([image(entry.data, entry.mimeType)])] })), + { id: "tool-only-image", history: [assistant(), result([small])] }, + { id: "tool-empty-text-image", history: [assistant(), result([text(""), small])] }, + { id: "tool-mixed", history: [assistant(), result([text("First 한글"), small, text("Last 🌏")])] }, + { id: "tool-two-images", history: [assistant(), result([small, small])] }, + { id: "tool-oversize-only", history: [assistant(), result([large])] }, + { id: "tool-oversize-and-image", history: [assistant(), result([large, small])] }, + { id: "tool-adjacent-oversize", history: [assistant(), result([large, large])] }, + { id: "tool-empty-array", history: [assistant(), result([])] }, + { id: "user-adjacent-images", history: [user([small, small])] }, + { id: "user-blank-oversize", history: [user([text("\uFEFF"), large, text("")])] }, + { id: "tool-grouped-images", history: [assistant(), result([small]), result([large, small])] }, + { id: "user-interrupts-tool", history: [assistant(), user([small]), result([small])] }, + { id: "orphan-oversize", history: [result([large], "orphan")] }, + { id: "failed-assistant-image", history: [assistant("error"), result([small])] }, + { id: "vision-text-array", history: [user([text("First"), text(""), text("Last")])] }, +]; diff --git a/scripts/fixtures/anthropic-vision-recorder.ts b/scripts/fixtures/anthropic-vision-recorder.ts new file mode 100644 index 0000000000..79f2239fc9 --- /dev/null +++ b/scripts/fixtures/anthropic-vision-recorder.ts @@ -0,0 +1,50 @@ +import { createHash } from "node:crypto"; +import { readFileSync } from "node:fs"; +import { streamAnthropic } from "../../packages/ai/src/providers/anthropic.ts"; +import type { Message, Model } from "../../packages/ai/src/types.ts"; +import { model as textModel } from "./anthropic-provider-cases.ts"; +import { scenarios } from "./anthropic-vision-cases.ts"; + +const model: Model<"anthropic-messages"> = { ...textModel, id: "synthetic-anthropic-vision", input: ["text", "image"] }; +const files = [ + "scripts/fixtures/anthropic-vision-recorder.ts", "scripts/fixtures/anthropic-vision-cases.ts", + "scripts/fixtures/anthropic-provider-cases.ts", "packages/ai/src/providers/anthropic.ts", + "packages/ai/src/providers/anthropic-client.ts", "packages/ai/src/providers/anthropic-compat.ts", + "packages/ai/src/providers/transform-messages.ts", "packages/ai/src/utils/sanitize-unicode.ts", + "packages/ai/src/providers/anthropic-image-guard.ts", "node_modules/@anthropic-ai/sdk/package.json", +]; +const originalFetch = globalThis.fetch; +const recorded = []; +try { + for (const scenario of scenarios) { + let request: { url: string; headers: Record; body: string } | undefined; + globalThis.fetch = async (url, init) => { + if (String(url) !== "https://synthetic.invalid/v1/messages" || request) throw new Error("unexpected request or retry"); + if (typeof init?.body !== "string") throw new Error("expected SDK serialized request"); + const headers = Object.fromEntries([...new Headers(init.headers)].filter(([key]) => !key.startsWith("x-stainless-") && key !== "user-agent")); + if (headers["x-api-key"] !== "faux-key" || headers.authorization) throw new Error("non-synthetic credential refused"); + request = { url: String(url), headers, body: init.body }; + return new Response("", { headers: { "content-type": "text/event-stream" } }); + }; + const messages: Message[] = scenario.history.map((message): Message => { + if (message.role === "user") return { ...message, timestamp: 0 }; + if (message.role === "toolResult") return { ...message, toolName: "read", timestamp: 0 }; + return { ...message, api: model.api, provider: model.provider, model: model.id, timestamp: 0, + usage: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, totalTokens: 0, cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 } } }; + }); + const user = "Continue"; + messages.push({ role: "user", content: user, timestamp: 0 }); + const stream = streamAnthropic(model, { messages }, { apiKey: "faux-key", cacheRetention: "none", maxTokens: 64, maxRetries: 0 }); + for await (const _event of stream) { /* Drain the provider without retaining mutable snapshots. */ } + if (!request || (await stream.result()).stopReason === "error") throw new Error(`recording failed: ${scenario.id}`); + recorded.push({ id: scenario.id, input: { model: model.id, maxTokens: 64, system: "", user, tools: [], history: scenario.history }, request }); + } +} finally { + globalThis.fetch = originalFetch; +} +console.log(JSON.stringify({ + schema: "omk.anthropic.vision.v1", + source: Object.fromEntries(files.map((file) => [file, createHash("sha256").update(readFileSync(file)).digest("hex")])), + projection: { headersExcluded: ["x-stainless-*", "user-agent"], scope: "synthetic vision model user/tool images and 1900px header guard, API key, cache disabled" }, + cases: recorded, +}, null, 2)); diff --git a/scripts/fixtures/auth-recorder.ts b/scripts/fixtures/auth-recorder.ts new file mode 100644 index 0000000000..46e56e6192 --- /dev/null +++ b/scripts/fixtures/auth-recorder.ts @@ -0,0 +1,85 @@ +import { createHash } from "node:crypto"; +import { readFileSync } from "node:fs"; +import { AuthStorage } from "../../packages/coding-agent/src/core/auth-storage.ts"; +import type { AuthStorageBackend } from "../../packages/coding-agent/src/core/auth-storage-backend.ts"; +import { resolveConfigValue } from "../../packages/coding-agent/src/core/resolve-config-value.ts"; + +type Input = { + config?: string; + store?: string; + loadError?: boolean; + runtime?: string; + environment?: string; + fallback?: string; + includeFallback?: boolean; + env?: Record; +}; +const templates = [ + "", "faux-key", "SYN_KEY", "$SYN_KEY", "${SYN_KEY}", "prefix-$SYN_KEY/suffix", + "${SYN_KEY}${SECOND}", "$SYN_KEY$SECOND", "$MISSING", "$EMPTY", "${MISSING}", + "prefix-${MISSING}", "$$SYN_KEY", "$!literal", "$${SYN_KEY}", "$$$SYN_KEY", + "${bad-name}", "${}", "${SYN_KEY", "$", "$9", "$-", "${SYN_KEY}tail", + "$_KEY", "$SYN_KEY_suffix", "$SYN_KEY.tail", "한글-$SYN_KEY-🙂", "line\n$SYN_KEY\r\n", + "${SYN_KEY}${bad-name}", "$é", "${é}", "$!$SYN_KEY", "\u0000$SYN_KEY", +]; +const scenarios: { id: string; input: Input }[] = templates.map((config, i) => ({ + id: `template-${i}`, input: { config, env: { SYN_KEY: "faux-value", SECOND: "two", _KEY: "under", EMPTY: "" } }, +})); +const stored = (key: string) => JSON.stringify({ anthropic: { type: "api_key", key } }); +scenarios.push( + { id: "missing", input: {} }, + { id: "environment", input: { environment: "faux-environment" } }, + { id: "fallback", input: { fallback: "faux-fallback" } }, + { id: "environment-before-fallback", input: { environment: "faux-environment", fallback: "faux-fallback" } }, + { id: "stored-before-environment", input: { store: stored("faux-stored"), environment: "faux-environment" } }, + { id: "runtime-before-stored", input: { runtime: "faux-runtime", store: stored("faux-stored") } }, + { id: "runtime-not-interpolated", input: { runtime: "$SYN_KEY", env: { SYN_KEY: "faux-value" } } }, + { id: "runtime-empty-ignored", input: { runtime: "", environment: "faux-environment" } }, + { id: "stored-empty-stops-fallback", input: { store: stored(""), environment: "faux-environment" } }, + { id: "stored-template", input: { store: stored("key-${SYN_KEY}"), env: { SYN_KEY: "faux-value" } } }, + { id: "stored-unresolved-no-fallback", input: { store: stored("$MISSING"), environment: "faux-environment", fallback: "faux-fallback" } }, + { id: "fallback-disabled", input: { fallback: "faux-fallback", includeFallback: false } }, + { id: "fallback-empty", input: { fallback: "" } }, + { id: "fallback-template", input: { fallback: "${SYN_KEY}", env: { SYN_KEY: "faux-value" } } }, + { id: "unreadable-no-substitution", input: { loadError: true, environment: "faux-environment", fallback: "faux-fallback" } }, + { id: "runtime-over-unreadable", input: { loadError: true, runtime: "faux-runtime" } }, + { id: "malformed-no-substitution", input: { store: "{broken", environment: "faux-environment" } }, + { id: "runtime-over-malformed", input: { store: "{broken", runtime: "faux-runtime" } }, + { id: "other-provider-ignored", input: { store: '{"other":{"type":"api_key","key":"faux-other"}}', environment: "faux-environment" } }, +); +const cases = []; +for (const scenario of scenarios) { + for (const key of ["SYN_KEY", "SECOND", "_KEY", "EMPTY", "ANTHROPIC_API_KEY", "ANTHROPIC_OAUTH_TOKEN"]) delete process.env[key]; + Object.assign(process.env, scenario.input.env); + if (scenario.input.environment !== undefined) process.env.ANTHROPIC_API_KEY = scenario.input.environment; + let key: string | undefined; + let blocked = false; + if (scenario.input.config !== undefined) { + key = resolveConfigValue(scenario.input.config); + } else { + const backend: AuthStorageBackend = { + withLock(fn) { + if (scenario.input.loadError) throw new Error("synthetic store unavailable"); + return fn(scenario.input.store).result; + }, + async withLockAsync() { throw new Error("unexpected OAuth/storage write"); }, + }; + const auth = AuthStorage.fromStorage(backend); + if (scenario.input.runtime !== undefined) auth.setRuntimeApiKey("anthropic", scenario.input.runtime); + auth.setFallbackResolver(() => scenario.input.fallback === undefined ? undefined : resolveConfigValue(scenario.input.fallback)); + key = await auth.getApiKey("anthropic", { includeFallback: scenario.input.includeFallback }); + blocked = key === undefined && auth.drainErrors().length > 0; + } + cases.push({ ...scenario, expected: { key: key ?? null, blocked } }); +} +const files = [ + "scripts/fixtures/auth-recorder.ts", "packages/coding-agent/src/core/auth-storage.ts", + "packages/coding-agent/src/core/auth-storage-backend.ts", "packages/coding-agent/src/core/resolve-config-value.ts", + "packages/ai/src/env-api-keys.ts", +]; +console.log(JSON.stringify({ + schema: "omk.auth-resolution.v1", + source: Object.fromEntries(files.map(file => [file, createHash("sha256").update(readFileSync(file)).digest("hex")])), + projection: "API-key config templates and credential priority; supplied in-memory store and environment, no OAuth/commands/files/network", + cases, +}, null, 2)); diff --git a/scripts/fixtures/catalog-recorder.ts b/scripts/fixtures/catalog-recorder.ts new file mode 100644 index 0000000000..ce04752b4f --- /dev/null +++ b/scripts/fixtures/catalog-recorder.ts @@ -0,0 +1,42 @@ +import { createHash } from "node:crypto"; +import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { getModels, getProviders } from "../../packages/ai/src/models.ts"; +import { AuthStorage } from "../../packages/coding-agent/src/core/auth-storage.ts"; +import { ModelRegistry } from "../../packages/coding-agent/src/core/model-registry.ts"; + +const builtin = getProviders().flatMap(provider => getModels(provider)); +const first = getModels("anthropic")[0].id; +const scenarios = [ + { id: "default", overlay: "{}" }, + { id: "custom-defaults", overlay: { providers: { synthetic: { api: "anthropic-messages", baseUrl: "https://synthetic.invalid/v2/", apiKey: "faux-key", models: [{ id: "one" }, { id: "two", maxTokens: 42, input: ["text", "image"] }] } } } }, + { id: "builtin-inheritance", overlay: { providers: { anthropic: { models: [{ id: "synthetic-new" }] } } } }, + { id: "provider-overrides", overlay: { providers: { anthropic: { baseUrl: "https://synthetic.invalid/route/V12/", compat: { supportsEagerToolInputStreaming: false } } } } }, + { id: "partial-model-override", overlay: { providers: { anthropic: { modelOverrides: { [first]: { name: "Synthetic", cost: { output: 7 }, reasoning: false, thinkingLevelMap: { off: null }, input: ["text"], maxTokens: 32 } } } } } }, + { id: "custom-replaces-builtin", overlay: { providers: { anthropic: { models: [{ id: first, name: "Replacement" }] } } } }, + { id: "duplicate-last-wins", overlay: { providers: { synthetic: { api: "anthropic-messages", baseUrl: "https://synthetic.invalid", apiKey: "faux-key", models: [{ id: "one", name: "First" }, { id: "one", name: "Last" }] } } } }, + { id: "header-precedence", overlay: { providers: { anthropic: { headers: { "x-test": "provider", "x-extra": "literal" }, modelOverrides: { [first]: { headers: { "x-test": "model" } } } } } } }, + { id: "visibility", overlay: { providers: {}, visibility: { providers: ["anthropic"], models: { anthropic: [first] } } } }, + { id: "comments-trailing", overlay: '{// line\n"providers":{"anthropic":{"baseUrl":"https://synthetic.invalid/v1",},},}' }, + { id: "non-anthropic-url", overlay: { providers: { synthetic: { api: "openai-completions", baseUrl: "https://synthetic.invalid/v1/", apiKey: "faux-key", models: [{ id: "one" }] } } } }, + { id: "retired", overlay: { providers: { "grok-oauth-proxy": { baseUrl: "https://synthetic.invalid", models: [{ id: "old" }] } } } }, + { id: "invalid-json", overlay: "{" }, + { id: "invalid-model-limit", overlay: { providers: { anthropic: { models: [{ id: "broken", maxTokens: 0 }] } } } }, + { id: "missing-api", overlay: { providers: { synthetic: { baseUrl: "https://synthetic.invalid", apiKey: "faux-key", models: [{ id: "one" }] } } } }, + { id: "missing-auth", overlay: { providers: { synthetic: { api: "anthropic-messages", baseUrl: "https://synthetic.invalid", models: [{ id: "one" }] } } } }, +]; +const home = mkdtempSync(join(tmpdir(), "omk-catalog-oracle-")); +try { + const cases = []; + for (const scenario of scenarios) { + const overlay = typeof scenario.overlay === "string" ? scenario.overlay : JSON.stringify(scenario.overlay); + const path = join(home, "models.json"); writeFileSync(path, overlay); + const auth = AuthStorage.inMemory(); auth.setRuntimeApiKey("anthropic", "faux-key"); auth.setRuntimeApiKey("synthetic", "faux-key"); + const registry = ModelRegistry.createReadOnly(auth, path); + const models = registry.getAll().filter(m => m.provider === "anthropic" || m.provider === "synthetic"); + cases.push({ id: scenario.id, overlay, expected: { invalid: !!registry.getError(), total: registry.getAll().length, models, available: registry.getAvailable().filter(m => m.provider === "anthropic" || m.provider === "synthetic").map(m => [m.provider, m.id]) } }); + } + const source = Object.fromEntries(["scripts/fixtures/catalog-recorder.ts", "packages/ai/src/models.generated.ts", "packages/ai/src/models.ts", "packages/ai/src/providers/grok-thinking.ts", "packages/coding-agent/src/core/model-registry.ts", "packages/coding-agent/src/core/model-registry-schema.ts", "packages/coding-agent/src/utils/json.ts"].map(p => [p, createHash("sha256").update(readFileSync(p)).digest("hex")])); + console.log(JSON.stringify({ builtin: { schema: "omk.model-catalog.v1", source, models: builtin }, fixture: { schema: "omk.model-overlay.v1", source, cases } })); +} finally { rmSync(home, { recursive: true, force: true }); } diff --git a/scripts/fixtures/dispatch-recorder.ts b/scripts/fixtures/dispatch-recorder.ts new file mode 100644 index 0000000000..98c177a2cc --- /dev/null +++ b/scripts/fixtures/dispatch-recorder.ts @@ -0,0 +1,57 @@ +import { createHash } from "node:crypto"; +import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { Type } from "typebox"; +import { ModelRegistry } from "../../packages/coding-agent/src/core/model-registry.ts"; +import { AuthStorage } from "../../packages/coding-agent/src/core/auth-storage.ts"; +import { streamAnthropic } from "../../packages/ai/src/providers/anthropic.ts"; +import type { AssistantMessageEvent, Model } from "../../packages/ai/src/types.ts"; +import { cases as streams } from "./anthropic-provider-cases.ts"; +const scenarios = [ + { id: "runtime", runtime: "faux-runtime" }, + { id: "stored", store: '{"anthropic":{"type":"api_key","key":"$SYN_KEY"}}', env: { SYN_KEY: "faux-stored" } }, + { id: "environment", environment: "faux-environment" }, + { id: "fallback", fallback: "faux-fallback" }, + { id: "provider-model-headers", runtime: "faux-runtime", headers: { "x-test": "provider", "x-provider": "$SYN_KEY" }, modelHeaders: { "X-Test": "model" }, env: { SYN_KEY: "header-value" } }, + { id: "authorization-header", runtime: "faux-runtime", authHeader: true }, + { id: "eager-disabled", runtime: "faux-runtime", compat: { supportsEagerToolInputStreaming: false }, tool: true }, + { id: "adaptive-beta", runtime: "faux-runtime", compat: { forceAdaptiveThinking: true } }, + { id: "tools", runtime: "faux-runtime", tool: true }, + { id: "custom-provider", runtime: "faux-runtime", provider: "synthetic" }, +]; +const home = mkdtempSync(join(tmpdir(), "omk-dispatch-oracle-")); +const fetch = globalThis.fetch; +try { + const cases = []; + for (const scenario of scenarios) { + const s = scenario as typeof scenario & { provider?: string; fallback?: string; runtime?: string; store?: string; environment?: string; env?: Record; headers?: Record; modelHeaders?: Record; authHeader?: boolean; compat?: Record; tool?: boolean }; + for (const name of ["ANTHROPIC_API_KEY","ANTHROPIC_OAUTH_TOKEN","SYN_KEY"]) delete process.env[name]; + Object.assign(process.env, s.env); if (s.environment) process.env.ANTHROPIC_API_KEY = s.environment; + const provider = s.provider ?? "anthropic"; + const definition = { id: "synthetic-dispatch", reasoning: false, input: ["text"], headers: s.modelHeaders, compat: s.compat }; + const overlay = JSON.stringify({ providers: { [provider]: { api: "anthropic-messages", baseUrl: "https://synthetic.invalid/v1/", apiKey: s.fallback ?? "faux-config", headers: s.headers, authHeader: s.authHeader, models: [definition] } } }); + const path = join(home,"models.json"); writeFileSync(path,overlay); + const auth = AuthStorage.fromStorage({ withLock: fn => fn(s.store).result, async withLockAsync() { throw new Error("unexpected refresh"); } }); + if (s.runtime) auth.setRuntimeApiKey(provider,s.runtime); + const registry = ModelRegistry.createReadOnly(auth,path); + const model = registry.find(provider,definition.id) as Model<"anthropic-messages">; + const resolved = await registry.getApiKeyAndHeaders(model); if (!resolved.ok || !resolved.apiKey) throw new Error("oracle auth failed"); + let request: unknown; + globalThis.fetch = async (url, init) => { + if (String(url) !== "https://synthetic.invalid/v1/messages" || request) throw new Error("unexpected dispatch/retry"); + const headers = Object.fromEntries([...new Headers(init?.headers)].filter(([k]) => !k.startsWith("x-stainless-") && k !== "user-agent")); + request = { url: String(url), headers, body: init?.body }; + return new Response(streams[0].wire, { headers: { "content-type":"text/event-stream" } }); + }; + const tools = s.tool ? [{ name: "read", description: "Read synthetic file", parameters: Type.Object({ path: Type.String() }) }] : undefined; + const stream = streamAnthropic(model, { systemPrompt: "Synthetic system", messages: [{ role:"user", content:"Hello 🌍", timestamp:0 }], tools }, { apiKey: resolved.apiKey, headers: resolved.headers, cacheRetention:"none", maxTokens:64, maxRetries:0 }); + const events = []; + for await (const event of stream) { const { partial: _p, message: _m, error: _e, ...projection } = event as Partial & { partial?: unknown; message?: unknown; error?: unknown }; events.push(projection); } + const { timestamp: _t, usage, ...result } = await stream.result(); const { cost: _c, ...tokens } = usage; + const input = { model:definition.id, maxTokens:64, system:"Synthetic system", user:"Hello 🌍", tools:s.tool ? [{name:"read",description:"Read synthetic file",properties:{path:{type:"string"}},required:["path"]}] : [] }; + cases.push({ id:s.id, overlay, provider, input, runtime:s.runtime, store:s.store, environment:s.environment, env:s.env, request, events, result:{...result,usage:tokens}, wire:streams[0].wire }); + } + const source = Object.fromEntries(["scripts/fixtures/dispatch-recorder.ts","scripts/fixtures/anthropic-provider-cases.ts","packages/ai/src/providers/anthropic.ts","packages/ai/src/providers/anthropic-compat.ts","packages/coding-agent/src/core/model-registry.ts","packages/coding-agent/src/core/provider-request-key.ts"].map(p => [p,createHash("sha256").update(readFileSync(p)).digest("hex")])); + console.log(JSON.stringify({ schema:"omk.authenticated-dispatch.v1", source, cases })); +} finally { globalThis.fetch = fetch; rmSync(home,{recursive:true,force:true}); } diff --git a/scripts/fixtures/openai-completions-affinity-recorder.ts b/scripts/fixtures/openai-completions-affinity-recorder.ts new file mode 100644 index 0000000000..adede9ce08 --- /dev/null +++ b/scripts/fixtures/openai-completions-affinity-recorder.ts @@ -0,0 +1,55 @@ +import { createHash } from "node:crypto"; +import { readFileSync } from "node:fs"; +import { streamOpenAICompletions } from "../../packages/ai/src/providers/openai-completions.ts"; +import type { CacheRetention, Context, Model } from "../../packages/ai/src/types.ts"; + +type Scenario = { id: string; baseUrl?: string; affinity?: boolean; retention?: CacheRetention; long?: boolean; session?: string }; +const openai = "https://api.openai.com/v1"; +const scenarios: Scenario[] = [ + { id: "affinity-session", affinity: true, session: "sess-1" }, + { id: "affinity-no-session", affinity: true }, + { id: "affinity-empty-session", affinity: true, session: "" }, + { id: "affinity-retention-none", affinity: true, retention: "none", session: "sess-1" }, + { id: "affinity-retention-short", affinity: true, retention: "short", session: "sess-1" }, + { id: "affinity-retention-long", affinity: true, retention: "long", long: true, session: "sess-1" }, + { id: "affinity-false-session", affinity: false, session: "sess-1" }, + { id: "affinity-absent-session", session: "sess-1" }, + { id: "affinity-openai-long-session", baseUrl: openai, affinity: true, session: "x".repeat(70) }, + { id: "affinity-openai-none", baseUrl: openai, affinity: true, retention: "none", session: "sess-1" }, + { id: "affinity-internal-space", affinity: true, session: "a b\tc" }, + { id: "affinity-visible-ascii", affinity: true, session: "A-z_0.9~!#$%&'*+^`|" }, +]; +const original = globalThis.fetch; +try { + const cases = []; + for (const s of scenarios) { + const baseUrl = s.baseUrl ?? "https://synthetic.invalid/v1"; + const compat = { + supportsStore: true, supportsDeveloperRole: true, supportsUsageInStreaming: true, maxTokensField: "max_completion_tokens", supportsStrictMode: true, requiresSystemMessageFirst: false, + ...(s.affinity === undefined ? {} : { sendSessionAffinityHeaders: s.affinity }), ...(s.long === undefined ? {} : { supportsLongCacheRetention: s.long }), + } as const; + const model: Model<"openai-completions"> = { id: "synthetic-completions", name: "Synthetic", api: "openai-completions", provider: "synthetic", baseUrl, reasoning: false, input: ["text"], cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 4096, maxTokens: 64, compat }; + const context: Context = { systemPrompt: "Synthetic system", messages: [{ role: "user", content: "Hello", timestamp: 0 }] }; + let request: { url: string; headers: Record; body: string } | undefined; + globalThis.fetch = async (url, init) => { + const headers = new Headers(init?.headers); + if (request || String(url) !== `${baseUrl}/chat/completions` || headers.get("authorization") !== "Bearer faux-key" || typeof init?.body !== "string") throw new Error("unexpected SDK request"); + request = { url: String(url), headers: Object.fromEntries([...headers].filter(([k]) => !k.startsWith("x-stainless-") && k !== "user-agent")), body: init.body }; + return new Response('data: {"choices":[{"index":0,"delta":{"content":"ok"},"finish_reason":"stop"}]}\n\ndata: [DONE]\n\n', { headers: { "content-type": "text/event-stream" } }); + }; + const result = await streamOpenAICompletions(model, context, { apiKey: "faux-key", maxTokens: 64, maxRetries: 0, ...(s.retention ? { cacheRetention: s.retention } : {}), ...(s.session === undefined ? {} : { sessionId: s.session }) }).result(); + if (result.stopReason !== "stop" || !request) throw new Error(`recording failed: ${s.id}`); + cases.push({ + id: s.id, + input: { + provider: model.provider, baseUrl, model: model.id, reasoning: false, compat, system: "Synthetic system", messages: [{ role: "user", content: "Hello" }], tools: [], maxTokens: 64, + ...(s.retention ? { cacheRetention: s.retention } : {}), ...(s.session === undefined ? {} : { sessionId: s.session }), + }, + request, + }); + } + const paths = ["scripts/fixtures/openai-completions-affinity-recorder.ts", "packages/ai/src/providers/openai-completions.ts", "packages/ai/src/providers/openai-completions-compat.ts", "packages/ai/src/providers/openai-prompt-cache.ts", "node_modules/openai/package.json"]; + console.log(JSON.stringify({ schema: "omk.openai-completions-affinity.v1", source: Object.fromEntries(paths.map((p) => [p, createHash("sha256").update(readFileSync(p)).digest("hex")])), cases })); +} finally { + globalThis.fetch = original; +} diff --git a/scripts/fixtures/openai-completions-cache-recorder.ts b/scripts/fixtures/openai-completions-cache-recorder.ts new file mode 100644 index 0000000000..a3bfd290fd --- /dev/null +++ b/scripts/fixtures/openai-completions-cache-recorder.ts @@ -0,0 +1,89 @@ +import { createHash } from "node:crypto"; +import { readFileSync } from "node:fs"; +import { streamOpenAICompletions } from "../../packages/ai/src/providers/openai-completions.ts"; +import type { CacheRetention, Context, Model, Tool } from "../../packages/ai/src/types.ts"; + +type Spec = { name: string; description: string; properties: unknown; required: string[] }; +type Scenario = { + id: string; baseUrl?: string; provider?: string; model?: string; retention?: CacheRetention; session?: string; + long?: boolean; system?: string; boundary?: unknown; bypass?: boolean; tools?: Spec[]; +}; +const openai = "https://api.openai.com/v1"; +const read: Spec = { name: "read", description: "Read a file\n\"quoted\" 한글", properties: { path: { type: "string" } }, required: ["path"] }; +const odd: Spec = { + name: "Edit", description: "Edit", required: ["b", "10"], + properties: { b: { type: "object", required: null, properties: { z: {}, y: { enum: [1.0, -0, 1e21, 0.1] } } }, "10": { type: "integer", minimum: -0 }, "2": {}, a: { type: "string" }, é: {}, "😀": {}, "\uE000": {} }, +}; +const scenarios: Scenario[] = [ + { id: "short-synthetic-session", retention: "short", session: "s" }, + { id: "none-openai-session", baseUrl: openai, retention: "none", session: "s" }, + { id: "short-openai-session", baseUrl: openai, retention: "short", session: "sess-1" }, + { id: "default-openai-session", baseUrl: openai, session: "sess-default" }, + { id: "short-openai-no-session", baseUrl: openai, retention: "short" }, + { id: "short-openai-empty-session", baseUrl: openai, retention: "short", session: "" }, + { id: "short-openai-long-session", baseUrl: openai, retention: "short", session: "x".repeat(70) }, + { id: "short-openai-astral-session", baseUrl: openai, retention: "short", session: `${"a".repeat(63)}😀😀` }, + { id: "substring-host-session", baseUrl: "https://api.openai.com.synthetic.invalid/v1", retention: "short", session: "s" }, + { id: "long-supported-synthetic", retention: "long", long: true, session: "s" }, + { id: "long-supported-no-session", retention: "long", long: true }, + { id: "long-unsupported-synthetic", retention: "long", long: false, session: "s" }, + { id: "long-unsupported-openai", baseUrl: openai, retention: "long", long: false, session: "s" }, + { id: "long-supported-openai", baseUrl: openai, retention: "long", long: true, session: "s" }, + { id: "none-supported-flag", retention: "none", long: true, session: "s" }, + { id: "short-supported-flag-synthetic", retention: "short", long: true, session: "s" }, + { id: "content-key", baseUrl: openai, retention: "short", boundary: 9, tools: [read] }, + { id: "content-key-no-tools", baseUrl: openai, retention: "short", boundary: 9 }, + { id: "content-key-full-length", baseUrl: openai, retention: "short", boundary: 19 }, + { id: "content-key-beats-session", baseUrl: openai, retention: "short", boundary: 4, session: "s" }, + { id: "content-key-canonical-tools", baseUrl: openai, retention: "short", boundary: 9, tools: [read, odd] }, + { id: "content-key-scope", baseUrl: openai, provider: "openai", model: "gpt-synthetic", retention: "short", boundary: 9 }, + { id: "content-key-long", retention: "long", long: true, boundary: 9, session: "s", tools: [read] }, + { id: "content-key-astral-prefix", baseUrl: openai, retention: "short", system: "😀 cache 한글 tail", boundary: 2 }, + { id: "boundary-zero", baseUrl: openai, retention: "short", boundary: 0, session: "s" }, + { id: "boundary-negative", baseUrl: openai, retention: "short", boundary: -1, session: "s" }, + { id: "boundary-too-long", baseUrl: openai, retention: "short", boundary: 20, session: "s" }, + { id: "boundary-fraction", baseUrl: openai, retention: "short", boundary: 1.5, session: "s" }, + { id: "boundary-null", baseUrl: openai, retention: "short", boundary: null, session: "s" }, + { id: "boundary-string", baseUrl: openai, retention: "short", boundary: "3", session: "s" }, + { id: "bypass-with-boundary", baseUrl: openai, retention: "short", boundary: 9, bypass: true, session: "s" }, + { id: "bypass-without-boundary", baseUrl: openai, retention: "short", bypass: true, session: "s" }, + { id: "bypass-false", baseUrl: openai, retention: "short", bypass: false, session: "s" }, + { id: "empty-system-boundary", baseUrl: openai, retention: "short", system: "", boundary: 1, session: "s" }, + { id: "boundary-without-key-policy", retention: "short", boundary: 9, session: "s" }, +]; +const original = globalThis.fetch; +try { + const cases = []; + for (const s of scenarios) { + const baseUrl = s.baseUrl ?? "https://synthetic.invalid/v1"; + const compat = { supportsStore: true, supportsDeveloperRole: true, supportsUsageInStreaming: true, maxTokensField: "max_completion_tokens", supportsStrictMode: true, requiresSystemMessageFirst: false, ...(s.long === undefined ? {} : { supportsLongCacheRetention: s.long }) } as const; + const model: Model<"openai-completions"> = { id: s.model ?? "synthetic-completions", name: "Synthetic", api: "openai-completions", provider: s.provider ?? "synthetic", baseUrl, reasoning: false, input: ["text"], cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 4096, maxTokens: 64, compat }; + const system = s.system ?? "Synthetic system 한글"; + const tools: Tool[] | undefined = s.tools?.map((t) => ({ name: t.name, description: t.description, parameters: { type: "object", properties: t.properties, required: t.required } as unknown as Tool["parameters"] })); + const context: Context = { systemPrompt: system, messages: [{ role: "user", content: "Hello", timestamp: 0 }], tools }; + if (Object.hasOwn(s, "boundary")) (context as { systemPromptCacheBoundary?: unknown }).systemPromptCacheBoundary = s.boundary; + if (s.bypass !== undefined) context.systemPromptCacheBoundaryBypass = s.bypass; + let request: { url: string; headers: Record; body: string } | undefined; + globalThis.fetch = async (url, init) => { + const headers = new Headers(init?.headers); + if (request || String(url) !== `${baseUrl}/chat/completions` || headers.get("authorization") !== "Bearer faux-key" || typeof init?.body !== "string") throw new Error("unexpected SDK request"); + request = { url: String(url), headers: Object.fromEntries([...headers].filter(([k]) => !k.startsWith("x-stainless-") && k !== "user-agent")), body: init.body }; + return new Response('data: {"choices":[{"index":0,"delta":{"content":"ok"},"finish_reason":"stop"}]}\n\ndata: [DONE]\n\n', { headers: { "content-type": "text/event-stream" } }); + }; + const result = await streamOpenAICompletions(model, context, { apiKey: "faux-key", maxTokens: 64, maxRetries: 0, ...(s.retention ? { cacheRetention: s.retention } : {}), ...(s.session === undefined ? {} : { sessionId: s.session }) }).result(); + if (result.stopReason !== "stop" || !request) throw new Error(`recording failed: ${s.id}`); + cases.push({ + id: s.id, + input: { + provider: model.provider, baseUrl, model: model.id, reasoning: false, compat, system, messages: [{ role: "user", content: "Hello" }], tools: s.tools ?? [], maxTokens: 64, + ...(s.retention ? { cacheRetention: s.retention } : {}), ...(s.session === undefined ? {} : { sessionId: s.session }), + ...(Object.hasOwn(s, "boundary") ? { systemPromptCacheBoundary: s.boundary } : {}), ...(s.bypass === undefined ? {} : { systemPromptCacheBoundaryBypass: s.bypass }), + }, + request, + }); + } + const paths = ["scripts/fixtures/openai-completions-cache-recorder.ts", "packages/ai/src/providers/openai-completions.ts", "packages/ai/src/providers/openai-prompt-cache.ts", "packages/ai/src/providers/prompt-cache.ts", "packages/ai/src/providers/tool-schema.ts", "packages/ai/src/utils/hash.ts", "node_modules/openai/package.json"]; + console.log(JSON.stringify({ schema: "omk.openai-completions-cache.v1", source: Object.fromEntries(paths.map((p) => [p, createHash("sha256").update(readFileSync(p)).digest("hex")])), cases })); +} finally { + globalThis.fetch = original; +} diff --git a/scripts/fixtures/openai-completions-cross-recorder.ts b/scripts/fixtures/openai-completions-cross-recorder.ts new file mode 100644 index 0000000000..ca31afb229 --- /dev/null +++ b/scripts/fixtures/openai-completions-cross-recorder.ts @@ -0,0 +1,35 @@ +import { createHash } from "node:crypto"; +import { readFileSync } from "node:fs"; +import { streamOpenAICompletions } from "../../packages/ai/src/providers/openai-completions.ts"; +import type { AssistantMessage, Message, Model, ToolCall } from "../../packages/ai/src/types.ts"; + +const baseUrl = "https://synthetic.invalid/v1"; +const compat = {supportsStore:true,supportsDeveloperRole:true,supportsUsageInStreaming:true,maxTokensField:"max_completion_tokens",supportsStrictMode:true,requiresSystemMessageFirst:false} as const; +const usage = {input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}}; +const long = "a".repeat(37); +const ids = ["call+|it😀/1", "call+|it😀/2", `${long}|A+/=😀`, `${long}|B+/=😀`, "plain".repeat(10), "raw|", "|", "a|b|c"]; +const signatures = ['{"z":1,"a":"synthetic"}', "false", "invalid", "[]", "null", '""', "0", '"detail"']; +const original=globalThis.fetch; +try { + const cases=[]; + for (const provider of ["synthetic", "openai"]) for (const change of ["none","provider","api","model"]) { + const model:Model<"openai-completions">={id:"m",name:"Synthetic",api:"openai-completions",provider,baseUrl,reasoning:false,input:["text"],cost:usage.cost,contextWindow:4096,maxTokens:64,compat}; + const source={provider:change==="provider"?"foreign":provider,api:change==="api"?"openai-responses" as const:model.api,model:change==="model"?"other":model.id}; + const calls:ToolCall[]=ids.map((id,i)=>({type:"toolCall",id,name:"f",arguments:{z:i,a:1},thoughtSignature:signatures[i]})); + const content:AssistantMessage["content"]=[{type:"text",text:"start"},{type:"thinking",thinking:"visible",thinkingSignature:"reasoning_content"},{type:"thinking",thinking:"opaque",thinkingSignature:"synthetic",redacted:true},{type:"thinking",thinking:" \t"},...calls]; + const results=ids.toReversed().map(id=>({role:"toolResult" as const,toolCallId:id,toolName:"f",content:[{type:"text" as const,text:`result-${ids.indexOf(id)}`}],isError:false})); + const messages:Message[]=[{role:"assistant",...source,content,usage,timestamp:0,stopReason:"toolUse"},...results.map(m=>({...m,timestamp:0}))]; + let request:{url:string;headers:Record;body:string}|undefined; + globalThis.fetch=async(target,init)=>{ + const headers=new Headers(init?.headers); + if(request||String(target)!==`${baseUrl}/chat/completions`||headers.get("authorization")!=="Bearer faux-key"||typeof init?.body!=="string") throw new Error("unexpected SDK request"); + request={url:String(target),headers:Object.fromEntries([...headers].filter(([k])=>!k.startsWith("x-stainless-")&&k!=="user-agent")),body:init.body}; + return new Response('data: {"choices":[{"index":0,"delta":{"content":"ok"},"finish_reason":"stop"}]}\n\ndata: [DONE]\n\n',{headers:{"content-type":"text/event-stream"}}); + }; + if((await streamOpenAICompletions(model,{messages},{apiKey:"faux-key",maxRetries:0}).result()).stopReason!=="stop"||!request) throw new Error("recording failed"); + cases.push({id:`${provider}-${change}`,input:{baseUrl,provider,model:model.id,system:"",reasoning:false,compat,messages:[{role:"assistant",source,content,stopReason:"toolUse"},...results]},request}); + } + const files=["scripts/fixtures/openai-completions-cross-recorder.ts","packages/ai/src/providers/openai-completions.ts","packages/ai/src/providers/openai-completions-compat.ts","packages/ai/src/providers/transform-messages.ts","packages/ai/src/utils/hash.ts","packages/ai/src/utils/sanitize-unicode.ts","node_modules/openai/package.json"]; + const source=Object.fromEntries(files.map(p=>[p,createHash("sha256").update(readFileSync(p)).digest("hex")])); + console.log(JSON.stringify({schema:"omk.openai-completions-cross.v1",source,cases})); +} finally {globalThis.fetch=original;} diff --git a/scripts/fixtures/openai-completions-effort-recorder.ts b/scripts/fixtures/openai-completions-effort-recorder.ts new file mode 100644 index 0000000000..9bc0c6e211 --- /dev/null +++ b/scripts/fixtures/openai-completions-effort-recorder.ts @@ -0,0 +1,82 @@ +import { createHash } from "node:crypto"; +import { readFileSync } from "node:fs"; +import { streamOpenAICompletions } from "../../packages/ai/src/providers/openai-completions.ts"; +import type { Model, OpenAICompletionsCompat, ThinkingLevel, ThinkingLevelMap } from "../../packages/ai/src/types.ts"; + +type Format = NonNullable; +type Scenario = { id: string; format: Format; effort?: ThinkingLevel; supports?: boolean; reasoning?: boolean; map?: ThinkingLevelMap; baseUrl?: string; model?: string; tools?: boolean }; +const synthetic = "https://synthetic.invalid/v1"; +const studio = "https://dashscope.aliyuncs.com/compatible-mode/v1"; +const scenarios: Scenario[] = [ + { id: "openai-effort", format: "openai", effort: "high" }, + { id: "openai-effort-tools", format: "openai", effort: "low", tools: true }, + { id: "openai-mapped", format: "openai", effort: "high", map: { high: "max-x" } }, + { id: "openai-mapped-null", format: "openai", effort: "high", map: { high: null } }, + { id: "openai-off-string", format: "openai", map: { off: "none" } }, + { id: "openai-off-null", format: "openai", map: { off: null } }, + { id: "openai-unsupported", format: "openai", effort: "high", supports: false }, + { id: "openai-unsupported-off", format: "openai", supports: false, map: { off: "none" } }, + { id: "openai-not-reasoning", format: "openai", effort: "high", reasoning: false }, + { id: "openai-ultra", format: "openai", effort: "ultra" }, + { id: "openrouter-effort", format: "openrouter", effort: "medium", tools: true }, + { id: "openrouter-mapped", format: "openrouter", effort: "xhigh", map: { xhigh: "high" } }, + { id: "openrouter-off-default", format: "openrouter" }, + { id: "openrouter-off-string", format: "openrouter", map: { off: "minimal" } }, + { id: "openrouter-off-none", format: "openrouter", map: { off: "none" } }, + { id: "openrouter-off-null", format: "openrouter", map: { off: null } }, + { id: "openrouter-unsupported", format: "openrouter", effort: "low", supports: false }, + { id: "openrouter-not-reasoning", format: "openrouter", effort: "low", reasoning: false }, + { id: "deepseek-effort", format: "deepseek", effort: "max", tools: true }, + { id: "deepseek-unsupported", format: "deepseek", effort: "high", supports: false }, + { id: "deepseek-off", format: "deepseek" }, + { id: "deepseek-not-reasoning", format: "deepseek", effort: "high", reasoning: false }, + { id: "together-effort", format: "together", effort: "minimal", map: { minimal: "low" } }, + { id: "together-unsupported", format: "together", effort: "minimal", supports: false }, + { id: "together-off", format: "together" }, + { id: "zai-effort", format: "zai", effort: "high" }, + { id: "zai-unsupported", format: "zai", effort: "high", supports: false }, + { id: "zai-off", format: "zai", map: { off: "none" } }, + { id: "qwen-effort-generic-host", format: "qwen", effort: "high" }, + { id: "qwen-effort-studio", format: "qwen", effort: "high", baseUrl: studio, tools: true }, + { id: "qwen-studio-unsupported", format: "qwen", effort: "high", baseUrl: studio, supports: false }, + { id: "qwen-studio-deepseek-minimal", format: "qwen", effort: "minimal", baseUrl: studio, model: "deepseek-v4-flash" }, + { id: "qwen-studio-deepseek-minimal-mapped", format: "qwen", effort: "minimal", baseUrl: studio, model: "deepseek-v4-flash", map: { minimal: "tiny" } }, + { id: "qwen-studio-other-minimal", format: "qwen", effort: "minimal", baseUrl: studio }, + { id: "qwen-off", format: "qwen", baseUrl: studio }, + { id: "qwen-chat-template-effort", format: "qwen-chat-template", effort: "low" }, + { id: "qwen-chat-template-off", format: "qwen-chat-template" }, + { id: "string-thinking-effort", format: "string-thinking", effort: "high", map: { high: "deep" } }, + { id: "string-thinking-off-default", format: "string-thinking" }, + { id: "string-thinking-off-string", format: "string-thinking", map: { off: "low" } }, + { id: "string-thinking-off-null", format: "string-thinking", map: { off: null } }, + { id: "ant-ling-mapped", format: "ant-ling", effort: "high", map: { high: "high" } }, + { id: "ant-ling-unmapped", format: "ant-ling", effort: "high" }, + { id: "ant-ling-null", format: "ant-ling", effort: "high", map: { high: null } }, + { id: "ant-ling-off", format: "ant-ling", map: { off: "none" } }, +]; +const tool = { name: "read", description: "Synthetic read", properties: { path: { type: "string" } }, required: ["path"] }; +const original = globalThis.fetch; +try { + const cases = []; + for (const s of scenarios) { + const baseUrl = s.baseUrl ?? synthetic; + const compat = { supportsStore: true, supportsDeveloperRole: true, supportsUsageInStreaming: true, maxTokensField: "max_completion_tokens", supportsStrictMode: true, requiresSystemMessageFirst: false, thinkingFormat: s.format, supportsReasoningEffort: s.supports ?? true } as const; + const reasoning = s.reasoning ?? true; + const model: Model<"openai-completions"> = { id: s.model ?? "synthetic-completions", name: "Synthetic", api: "openai-completions", provider: "synthetic", baseUrl, reasoning, input: ["text"], cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 4096, maxTokens: 64, compat, ...(s.map ? { thinkingLevelMap: s.map } : {}) }; + let request: { url: string; headers: Record; body: string } | undefined; + globalThis.fetch = async (url, init) => { + const headers = new Headers(init?.headers); + if (request || String(url) !== `${baseUrl}/chat/completions` || headers.get("authorization") !== "Bearer faux-key" || typeof init?.body !== "string") throw new Error("unexpected SDK request"); + request = { url: String(url), headers: Object.fromEntries([...headers].filter(([k]) => !k.startsWith("x-stainless-") && k !== "user-agent")), body: init.body }; + return new Response('data: {"choices":[{"index":0,"delta":{"content":"ok"},"finish_reason":"stop"}]}\n\ndata: [DONE]\n\n', { headers: { "content-type": "text/event-stream" } }); + }; + const tools = s.tools ? [{ name: tool.name, description: tool.description, parameters: { type: "object", properties: tool.properties, required: tool.required } as never }] : undefined; + const result = await streamOpenAICompletions(model, { systemPrompt: "Synthetic", messages: [{ role: "user", content: "Hello", timestamp: 0 }], tools }, { apiKey: "faux-key", maxTokens: 64, maxRetries: 0, reasoningEffort: s.effort, ...(s.tools ? { toolChoice: "auto" as const } : {}) }).result(); + if (result.stopReason !== "stop" || !request) throw new Error(`recording failed: ${s.id}`); + cases.push({ id: s.id, input: { provider: model.provider, baseUrl, model: model.id, reasoning, compat, system: "Synthetic", messages: [{ role: "user", content: "Hello" }], tools: s.tools ? [tool] : [], maxTokens: 64, ...(s.tools ? { toolChoice: "auto" } : {}), ...(s.effort ? { reasoningEffort: s.effort } : {}), ...(s.map ? { thinkingLevelMap: s.map } : {}) }, request }); + } + const paths = ["scripts/fixtures/openai-completions-effort-recorder.ts", "packages/ai/src/providers/openai-completions.ts", "packages/ai/src/providers/openai-completions-compat.ts", "node_modules/openai/package.json"]; + console.log(JSON.stringify({ schema: "omk.openai-completions-effort.v1", source: Object.fromEntries(paths.map((p) => [p, createHash("sha256").update(readFileSync(p)).digest("hex")])), cases })); +} finally { + globalThis.fetch = original; +} diff --git a/scripts/fixtures/openai-completions-images-recorder.ts b/scripts/fixtures/openai-completions-images-recorder.ts new file mode 100644 index 0000000000..9aaac6c7da --- /dev/null +++ b/scripts/fixtures/openai-completions-images-recorder.ts @@ -0,0 +1,45 @@ +import { createHash } from "node:crypto"; +import { readFileSync } from "node:fs"; +import { streamOpenAICompletions } from "../../packages/ai/src/providers/openai-completions.ts"; +import type { ImageContent, Model, TextContent, UserMessage } from "../../packages/ai/src/types.ts"; + +const url = "https://synthetic.invalid/v1"; +const compat = { supportsStore: true, supportsDeveloperRole: true, supportsUsageInStreaming: true, + maxTokensField: "max_completion_tokens", supportsStrictMode: true, requiresSystemMessageFirst: false } as const; +const image: ImageContent = { type: "image", mimeType: "image/png", data: "cG5n" }; +const opaque: ImageContent = { type: "image", mimeType: "image/webp", data: "not normalized+/=\n" }; +const text = (text: string): TextContent => ({ type: "text", text }); +const marker = text("(image omitted: model does not support images)"); +const histories: { id: string; turns: (TextContent | ImageContent)[][] }[] = [ + { id: "only", turns: [[image]] }, + { id: "ordered", turns: [[text("앞"), image, opaque, text(""), opaque, text("끝")]] }, + { id: "literal-marker", turns: [[marker, image, marker, text(" "), image]] }, + { id: "per-turn", turns: [[image, image], [], [opaque]] }, +]; +const streamBody = 'data: {"choices":[{"index":0,"delta":{"content":"ok"},"finish_reason":"stop"}]}\n\ndata: [DONE]\n\n'; +const original = globalThis.fetch; +try { + const cases = []; + for (const vision of [true, false]) { + const model: Model<"openai-completions"> = { id: "synthetic", name: "Synthetic", api: "openai-completions", + provider: "synthetic", baseUrl: url, reasoning: false, input: vision ? ["text", "image"] : ["text"], + cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 4096, maxTokens: 64, compat }; + for (const { id, turns } of histories) { + const messages: UserMessage[] = turns.map(content => ({ role: "user", content, timestamp: 0 })); + let request: { url: string; headers: Record; body: string } | undefined; + globalThis.fetch = async (target, init) => { + const headers = new Headers(init?.headers); + if (request || String(target) !== `${url}/chat/completions` || headers.get("authorization") !== "Bearer faux-key" || typeof init?.body !== "string") throw new Error("unexpected SDK request"); + request = { url: String(target), headers: Object.fromEntries([...headers].filter(([k]) => !k.startsWith("x-stainless-") && k !== "user-agent")), body: init.body }; + return new Response(streamBody, { headers: { "content-type": "text/event-stream" } }); + }; + const stream = streamOpenAICompletions(model, { messages }, { apiKey: "faux-key", maxRetries: 0 }); + if ((await stream.result()).stopReason !== "stop" || !request) throw new Error(`recording failed: ${id}`); + const input = { baseUrl: url, model: model.id, reasoning: false, compat, vision, system: "", messages: messages.map(({ role, content }) => ({ role, content })) }; + cases.push({ id: `${vision ? "vision" : "text"}-${id}`, input, request }); + } + } + const files = ["scripts/fixtures/openai-completions-images-recorder.ts", "packages/ai/src/providers/openai-completions.ts", "packages/ai/src/providers/openai-completions-compat.ts", "packages/ai/src/providers/transform-messages.ts", "packages/ai/src/utils/sanitize-unicode.ts", "node_modules/openai/package.json"]; + const source = Object.fromEntries(files.map(p => [p, createHash("sha256").update(readFileSync(p)).digest("hex")])); + console.log(JSON.stringify({ schema: "omk.openai-completions-images.v1", source, cases })); +} finally { globalThis.fetch = original; } diff --git a/scripts/fixtures/openai-completions-reasoning-recorder.ts b/scripts/fixtures/openai-completions-reasoning-recorder.ts new file mode 100644 index 0000000000..462a6fc4df --- /dev/null +++ b/scripts/fixtures/openai-completions-reasoning-recorder.ts @@ -0,0 +1,37 @@ +import { createHash } from "node:crypto"; +import { readFileSync } from "node:fs"; +import { streamOpenAICompletions } from "../../packages/ai/src/providers/openai-completions.ts"; +import type { AssistantMessage, Model, TextContent, ThinkingContent, ToolCall } from "../../packages/ai/src/types.ts"; + +const baseUrl = "https://synthetic.invalid/v1"; +const source = { provider: "synthetic", model: "m", api: "openai-completions" } as const; +const cost = { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }; +const usage = { ...cost, totalTokens: 0, cost: { ...cost, total: 0 } }; +const text = (text: string): TextContent => ({ type: "text", text }); +const thought = (thinking: string, thinkingSignature?: string): ThinkingContent => ({ type: "thinking", thinking, thinkingSignature }); +const call: ToolCall = { type: "toolCall", id: "a", name: "f", arguments: {}, thoughtSignature: '{"z":1,"a":2}' }; +const turns: AssistantMessage["content"][] = [ + [thought("first", "reasoning"), text("one "), thought(" \t"), thought("second"), text(" "), text("two"), call], + [thought("kept", "reasoning_content"), text("answer"), call], [thought("only")], + [thought("\uFEFF"), text("alone")], [call], [], +]; +const original = globalThis.fetch; +try { + const cases = []; + for (const reasoning of [false,true]) for (const asText of [false,true]) for (const required of [false,true]) { + const compat = { supportsStore:true, supportsDeveloperRole:true, supportsUsageInStreaming:true, maxTokensField:"max_completion_tokens", supportsStrictMode:true, requiresSystemMessageFirst:false, requiresThinkingAsText:asText, requiresReasoningContentOnAssistantMessages:required } as const; + const model: Model<"openai-completions"> = { id:source.model, api:source.api, provider:source.provider, name:"Synthetic", baseUrl, reasoning, compat, input:["text"], cost, contextWindow:4096, maxTokens:64 }; + const messages: AssistantMessage[] = turns.map(content => ({role:"assistant", ...source, content, usage, timestamp:0, stopReason:"stop"})); + let request: { url:string; headers:Record; body:string } | undefined; + globalThis.fetch = async (url, init) => { + const headers = new Headers(init?.headers); + if (request || String(url) !== `${baseUrl}/chat/completions` || headers.get("authorization") !== "Bearer faux-key" || typeof init?.body !== "string") throw new Error("unexpected SDK request"); + request = { url:String(url), headers:Object.fromEntries([...headers].filter(([k]) => !k.startsWith("x-stainless-") && k !== "user-agent")), body:init.body }; + return new Response('data: {"choices":[{"index":0,"delta":{"content":"ok"},"finish_reason":"stop"}]}\n\ndata: [DONE]\n\n', {headers:{"content-type":"text/event-stream"}}); + }; + if ((await streamOpenAICompletions(model,{messages},{apiKey:"faux-key",maxRetries:0}).result()).stopReason !== "stop" || !request) throw new Error("recording failed"); + cases.push({ id:`reasoning-${reasoning}-as-text-${asText}-required-${required}`, input:{ provider:model.provider, model:model.id, baseUrl, reasoning, system:"", compat, messages:turns.map(content=>({role:"assistant", source, content})) }, request }); + } + const paths = ["scripts/fixtures/openai-completions-reasoning-recorder.ts","packages/ai/src/providers/openai-completions.ts","packages/ai/src/providers/openai-completions-compat.ts","packages/ai/src/providers/transform-messages.ts","packages/ai/src/utils/sanitize-unicode.ts","node_modules/openai/package.json"]; + console.log(JSON.stringify({schema:"omk.openai-completions-reasoning.v1",source:Object.fromEntries(paths.map(p=>[p,createHash("sha256").update(readFileSync(p)).digest("hex")])),cases})); +} finally { globalThis.fetch = original; } diff --git a/scripts/fixtures/openai-completions-recorder.ts b/scripts/fixtures/openai-completions-recorder.ts new file mode 100644 index 0000000000..df8facc6f0 --- /dev/null +++ b/scripts/fixtures/openai-completions-recorder.ts @@ -0,0 +1,78 @@ +import { createHash } from "node:crypto"; +import { readFileSync } from "node:fs"; +import { streamOpenAICompletions, type OpenAICompletionsOptions } from "../../packages/ai/src/providers/openai-completions.ts"; +import type { AssistantMessage, Message, Model, OpenAICompletionsCompat, Tool, UserMessage } from "../../packages/ai/src/types.ts"; + +type Text = {type:"text";text:string}; +type History = {role:"user";content:string|Text[]} | {role:"assistant";content:Text[]}; +type Spec = {name:string;properties:unknown;required?:string[]}; +type Scenario = {id:string;baseUrl?:string;reasoning?:boolean;compat?:Partial;system?:string;messages?:History[];tools?:Spec[];maxTokens?:number;temperature?:number;toolChoice?:OpenAICompletionsOptions["toolChoice"]}; +type Compat = Required>; +const standard:Compat = {supportsStore:true,supportsDeveloperRole:true,supportsUsageInStreaming:true,maxTokensField:"max_completion_tokens",supportsStrictMode:true,requiresSystemMessageFirst:false}; +const t=(text:string):Text=>({type:"text",text}); +const read:Spec={name:"read",properties:{path:{type:"string"}},required:["path"]}; +const scenarios:Scenario[] = [ + {id:"basic"}, + {id:"reasoning-developer",reasoning:true}, + {id:"reasoning-system",reasoning:true,compat:{supportsDeveloperRole:false}}, + {id:"empty-system",system:""}, + {id:"empty-system-first",system:"",compat:{requiresSystemMessageFirst:true}}, + {id:"legacy-fields",compat:{maxTokensField:"max_tokens",supportsStore:false,supportsUsageInStreaming:false}}, + {id:"no-max-tokens",maxTokens:undefined}, + {id:"zero-max-tokens",maxTokens:0}, + {id:"temperature",temperature:0.7}, + {id:"temperature-zero",temperature:0}, + {id:"temperature-small",temperature:1e-7}, + {id:"tools-sorted",tools:[{name:"write",properties:{path:{type:"string"},content:{type:"string"}},required:["path","content"]},read,{name:"Read",properties:"x"}]}, + {id:"tools-no-strict",tools:[read],compat:{supportsStrictMode:false}}, + {id:"choice-auto",tools:[read],toolChoice:"auto"}, + {id:"choice-none",tools:[read],toolChoice:"none"}, + {id:"choice-required",tools:[read],toolChoice:"required"}, + {id:"choice-function",tools:[read],toolChoice:{type:"function",function:{name:"read"}}}, + {id:"history",messages:[ + {role:"user",content:"first"}, + {role:"assistant",content:[t("one "),t(" "),t("two")]}, + {role:"user",content:[t("block a"),t("block b")]}, + {role:"user",content:[]}, + {role:"assistant",content:[t(" \t")]}, + {role:"assistant",content:[t("\uFEFF")]}, + {role:"assistant",content:[t("\u0085")]}, + {role:"assistant",content:[]}, + {role:"user",content:""}, + ]}, + {id:"base-trailing-slash",baseUrl:"https://synthetic.invalid/v1/"}, + {id:"base-root",baseUrl:"https://synthetic.invalid"}, + {id:"base-loopback-port",baseUrl:"http://127.0.0.1:8080/openai/v1"}, +]; +const wire='data: {"id":"c","object":"chat.completion.chunk","created":0,"model":"m","choices":[{"index":0,"delta":{"content":"ok"},"finish_reason":"stop"}]}\n\ndata: [DONE]\n\n'; +const zero={input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}}; +const original=globalThis.fetch; +try { + const cases=[]; + for(const s of scenarios) { + const baseUrl=s.baseUrl??"https://synthetic.invalid/v1"; + const compat={...standard,...s.compat}; + const model:Model<"openai-completions">={id:"synthetic-completions",name:"Synthetic",api:"openai-completions",provider:"synthetic",baseUrl,reasoning:s.reasoning??false,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:4096,maxTokens:64,compat}; + const history=s.messages??[{role:"user",content:"Hello 🌍"}]; + const messages:Message[]=history.map(h=>h.role==="user"?{role:"user",content:h.content,timestamp:0} satisfies UserMessage:{role:"assistant",content:h.content,api:model.api,provider:model.provider,model:model.id,stopReason:"stop",timestamp:0,usage:zero} satisfies AssistantMessage); + const tools:Tool[]|undefined=s.tools?.map(x=>({name:x.name,description:`Synthetic ${x.name}`,parameters:{type:"object",properties:x.properties,required:x.required??[]} as unknown as Tool["parameters"]})); + let request:{url:string;headers:Record;body:unknown}|undefined; + globalThis.fetch=async(url,init)=> { + if(request) throw new Error("unexpected retry"); + const headers=Object.fromEntries([...new Headers(init?.headers)].filter(([k])=>!k.startsWith("x-stainless-")&&k!=="user-agent")); + if(headers.authorization!=="Bearer faux-key") throw new Error("non-synthetic credentials refused"); + request={url:String(url),headers,body:init?.body}; return new Response(wire,{headers:{"content-type":"text/event-stream"}}); + }; + const maxTokens=Object.hasOwn(s,"maxTokens")?s.maxTokens:64; + const stream=streamOpenAICompletions(model,{systemPrompt:s.system??"Synthetic system 한글",messages,tools},{apiKey:"faux-key",maxTokens,temperature:s.temperature,toolChoice:s.toolChoice,maxRetries:0}); + for await(const _ of stream) {} + const result=await stream.result(); + if(!request||result.stopReason==="error"||!/^https:\/\/synthetic\.invalid\/|^http:\/\/127\.0\.0\.1:8080\//.test(request.url)) throw new Error(`recording failed: ${s.id}`); + const input={baseUrl,model:model.id,reasoning:model.reasoning,compat,system:s.system??"Synthetic system 한글",messages:history, + tools:(s.tools??[]).map(x=>({name:x.name,description:`Synthetic ${x.name}`,properties:x.properties,required:x.required??[]})), + ...(maxTokens===undefined?{}:{maxTokens}),...(s.temperature===undefined?{}:{temperature:s.temperature}),...(s.toolChoice===undefined?{}:{toolChoice:s.toolChoice})}; + cases.push({id:s.id,input,request}); + } + const source=Object.fromEntries(["scripts/fixtures/openai-completions-recorder.ts","packages/ai/src/providers/openai-completions.ts","packages/ai/src/providers/openai-completions-compat.ts","packages/ai/src/providers/tool-schema.ts","packages/ai/src/providers/transform-messages.ts","packages/ai/src/utils/sanitize-unicode.ts","node_modules/openai/package.json"].map(p=>[p,createHash("sha256").update(readFileSync(p)).digest("hex")])); + console.log(JSON.stringify({schema:"omk.openai-completions-request.v1",source,cases})); +} finally {globalThis.fetch=original;} diff --git a/scripts/fixtures/openai-completions-tools-recorder.ts b/scripts/fixtures/openai-completions-tools-recorder.ts new file mode 100644 index 0000000000..afa19dd571 --- /dev/null +++ b/scripts/fixtures/openai-completions-tools-recorder.ts @@ -0,0 +1,43 @@ +import { createHash } from "node:crypto"; +import { readFileSync } from "node:fs"; +import { streamOpenAICompletions } from "../../packages/ai/src/providers/openai-completions.ts"; +import type { AssistantMessage, ImageContent, Message, Model, TextContent, ToolCall, ToolResultMessage } from "../../packages/ai/src/types.ts"; + +const baseUrl = "https://synthetic.invalid/v1"; +const usage = { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, totalTokens: 0, cost: {input:0,output:0,cacheRead:0,cacheWrite:0,total:0} }; +const text = (text: string): TextContent => ({type:"text", text}); +const image: ImageContent = {type:"image", mimeType:"image/png", data:"eA=="}; +const call = (id: string): ToolCall => ({type:"toolCall", id, name:`fn_${id}`, arguments: {z: ["\n한글", {b:1e-7,a:false}], a: null, 10: 4, 2: 3, required:null}}); +const assistant = (content: AssistantMessage["content"], stopReason: AssistantMessage["stopReason"] = "toolUse") => ({ role:"assistant" as const, content, stopReason }); +const result = (toolCallId:string, content: ToolResultMessage["content"], toolName="result_name") => ({role:"toolResult" as const, toolCallId, toolName, content, isError:true}); +const user = { role:"user" as const, content:"next" }; +const suite = [ + ["pair", [assistant([call("a")]), result("a",[text("first"),text(""),text("second")])]], + ["parallel", [assistant([text("before"),call("a"),text(" "),call("b"),text("after")]),result("\ufeffb ", []),result("a",[text("")],""),user]], + ["missing", [assistant([call("a"),call("b")]),result("b",[text("ok")]),user,assistant([call("c")])]], + ["dropped", [result("orphan",[]),assistant([call("a")],"error"),result("a",[]),assistant([call("b")],"aborted"),result("b",[])]], + ["late", [assistant([call("a")]),assistant([text("next")]),result("a",[text("late")]),result("a",[text("again")])]], + ["images", [assistant([call("a"),call("b")]),result("b",[image,image]),result("a",[text("mixed"),image]),user]], +] as const; +const original=globalThis.fetch; +try { + const cases=[]; + for(const flags of [false,true]) for(const [id,history] of suite) { + const compat={supportsStore:true,supportsDeveloperRole:true,supportsUsageInStreaming:true,maxTokensField:"max_completion_tokens",supportsStrictMode:true,requiresSystemMessageFirst:false,requiresToolResultName:flags,requiresAssistantAfterToolResult:flags} as const; + const model:Model<"openai-completions">={id:"synthetic",name:"Synthetic",api:"openai-completions",provider:"synthetic",baseUrl,compat,input:flags?["text","image"]:["text"],reasoning:false,cost:usage.cost,contextWindow:4096,maxTokens:64}; + const messages:Message[]=history.map(m=>m.role==="assistant"?{...m,timestamp:0,api:model.api,model:model.id,provider:model.provider,usage}:{...m,timestamp:0}); + let request: {url:string; headers: Record; body:string} | undefined; + globalThis.fetch=async(target,init)=>{ + const headers=new Headers(init?.headers); + if(request || String(target)!==`${baseUrl}/chat/completions` || headers.get("authorization")!=="Bearer faux-key" || typeof init?.body!=="string") throw new Error("unexpected SDK request"); + request={url:String(target),headers:Object.fromEntries([...headers].filter(([k])=>!k.startsWith("x-stainless-")&&k!=="user-agent")),body:init.body}; + return new Response('data: {"choices":[{"index":0,"delta":{"content":"ok"},"finish_reason":"stop"}]}\n\ndata: [DONE]\n\n',{headers:{"content-type":"text/event-stream"}}); + }; + const stream=streamOpenAICompletions(model,{messages},{apiKey:"faux-key",maxRetries:0}); + if((await stream.result()).stopReason!=="stop" || !request) throw new Error(`recording failed: ${id}`); + cases.push({id:`${id}-${flags}`,input:{baseUrl,model:model.id,reasoning:false,system:"",vision:flags,compat,messages:history},request}); + } + const files=["scripts/fixtures/openai-completions-tools-recorder.ts","packages/ai/src/providers/openai-completions.ts","packages/ai/src/providers/openai-completions-compat.ts","packages/ai/src/providers/transform-messages.ts","packages/ai/src/utils/sanitize-unicode.ts","node_modules/openai/package.json"]; + const source=Object.fromEntries(files.map(p=>[p,createHash("sha256").update(readFileSync(p)).digest("hex")])); + console.log(JSON.stringify({schema:"omk.openai-completions-tools.v1",source,cases})); +} finally {globalThis.fetch=original;} diff --git a/scripts/fixtures/openai-responses-headers-recorder.ts b/scripts/fixtures/openai-responses-headers-recorder.ts new file mode 100644 index 0000000000..4f9d23f34f --- /dev/null +++ b/scripts/fixtures/openai-responses-headers-recorder.ts @@ -0,0 +1,73 @@ +import { createHash } from "node:crypto"; +import { readFileSync } from "node:fs"; +import { streamOpenAIResponses } from "../../packages/ai/src/providers/openai-responses.ts"; +import type { CacheRetention, Model, OpenAIResponsesCompat } from "../../packages/ai/src/types.ts"; + +type Scenario = { + id: string; model?: Record; options?: Record; + session?: string; retention?: CacheRetention; compat?: OpenAIResponsesCompat; +}; +const baseUrl = "https://synthetic.invalid/v1"; +const scenarios: Scenario[] = [ + { id: "model-only", model: { "X-Model": "m", "x-shared": "model" } }, + { id: "options-only", options: { "X-Option": "o" } }, + { id: "options-override-model", model: { "X-Shared": "model", "x-keep": "k" }, options: { "X-Shared": "option" } }, + { id: "options-override-other-case", model: { "X-Shared": "model" }, options: { "x-shared": "option" } }, + // Object.assign keeps the first key position, so a later-cased key in model headers still wins. + { id: "case-collision-position", model: { "X-A": "1", "x-a": "2" }, options: { "X-A": "3" } }, + { id: "index-keys-first", model: { "x-b": "b", "10": "ten", "2": "two" }, options: { "02": "zero-two" } }, + { id: "session-then-model", model: { session_id: "model-session", "x-client-request-id": "model-req" }, session: "sess-1" }, + // The session overwrites `session_id` in place, so a later-cased model key still wins. + { id: "session-in-place-before-cased-key", model: { session_id: "model-lower", SESSION_ID: "model-upper" }, session: "sess-1" }, + { id: "options-override-session", session: "sess-1", options: { session_id: "opt-session", "X-Client-Request-Id": "opt-req" } }, + { id: "session-header-disabled-model-kept", model: { session_id: "model-session" }, session: "sess-1", compat: { sendSessionIdHeader: false } }, + { id: "retention-none-model-session", model: { session_id: "model-session" }, session: "sess-1", retention: "none" }, + { id: "override-sdk-defaults", options: { Accept: "text/event-stream", Authorization: "Bearer synthetic-override" } }, + { id: "content-type-is-sdk-owned", model: { "Content-Type": "text/plain" }, options: { "content-type": "application/x-ndjson" } }, + { id: "empty-and-inner-space", model: { "x-empty": "", "x-inner": "a b\tc" } }, + { id: "token-punctuation", options: { "X-!#$%&'*+-.^_`|~": "v", "x-value": "A-z_0.9~!#$%&'*+^`|\"()/:;<=>?@[\\]{}" } }, + { id: "empty-objects", model: {}, options: {} }, +]; +const original = globalThis.fetch; +try { + const cases = []; + for (const s of scenarios) { + const model: Model<"openai-responses"> = { + id: "synthetic-responses", name: "Synthetic", api: "openai-responses", provider: "synthetic", baseUrl, reasoning: false, input: ["text"], + cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 4096, maxTokens: 64, + ...(s.model ? { headers: s.model } : {}), ...(s.compat ? { compat: s.compat } : {}), + }; + let request: { url: string; headers: Record; body: string } | undefined; + globalThis.fetch = async (url, init) => { + const headers = new Headers(init?.headers); + const auth = headers.get("authorization"); + if (request || String(url) !== `${baseUrl}/responses` || (auth !== "Bearer faux-key" && auth !== "Bearer synthetic-override") || typeof init?.body !== "string") throw new Error("unexpected SDK request"); + request = { url: String(url), headers: Object.fromEntries([...headers].filter(([k]) => !k.startsWith("x-stainless-") && k !== "user-agent")), body: init.body }; + const done = { type: "response.completed", response: { id: "resp_synthetic", status: "completed", output: [] } }; + return new Response(`event: response.completed\ndata: ${JSON.stringify(done)}\n\n`, { headers: { "content-type": "text/event-stream" } }); + }; + const options = { + apiKey: "faux-key", maxRetries: 0, ...(s.options ? { headers: s.options } : {}), + ...(s.session === undefined ? {} : { sessionId: s.session }), ...(s.retention ? { cacheRetention: s.retention } : {}), + }; + const out = await streamOpenAIResponses(model, { systemPrompt: "Synthetic system", messages: [{ role: "user", content: "Hello", timestamp: 0 }] }, options).result(); + if (out.stopReason !== "stop" || !request) throw new Error(`recording failed: ${s.id}: ${out.errorMessage}`); + cases.push({ + id: s.id, + input: { + provider: model.provider, baseUrl, model: model.id, reasoning: false, ...(s.compat ? { compat: s.compat } : {}), + system: "Synthetic system", messages: [{ role: "user", content: "Hello" }], + ...(s.model ? { modelHeaders: s.model } : {}), ...(s.options ? { headers: s.options } : {}), + ...(s.session === undefined ? {} : { sessionId: s.session }), ...(s.retention ? { cacheRetention: s.retention } : {}), + }, + request, + }); + } + const paths = [ + "scripts/fixtures/openai-responses-headers-recorder.ts", "packages/ai/src/providers/openai-responses.ts", + "node_modules/openai/internal/headers.js", "node_modules/openai/client.js", "node_modules/openai/package.json", + ]; + console.log(JSON.stringify({ schema: "omk.openai-responses-headers.v1", source: Object.fromEntries(paths.map((p) => [p, createHash("sha256").update(readFileSync(p)).digest("hex")])), cases })); +} finally { + globalThis.fetch = original; +} diff --git a/scripts/fixtures/openai-responses-history-recorder.ts b/scripts/fixtures/openai-responses-history-recorder.ts new file mode 100644 index 0000000000..83e07a966d --- /dev/null +++ b/scripts/fixtures/openai-responses-history-recorder.ts @@ -0,0 +1,103 @@ +import { createHash } from "node:crypto"; +import { readFileSync } from "node:fs"; +import { streamOpenAIResponses } from "../../packages/ai/src/providers/openai-responses.ts"; +import type { Api, AssistantMessage, Message, Model, StopReason, ToolResultMessage } from "../../packages/ai/src/types.ts"; + +type Source = { provider: string; api: Api; model: string }; +type Block = AssistantMessage["content"][number]; +type Item = + | { role: "user"; content: string | { type: "text"; text: string }[] } + | { role: "assistant"; source?: Source; content: Block[]; stopReason?: StopReason } + | { role: "toolResult"; toolCallId: string; toolName: string; content: { type: "text"; text: string }[]; isError: boolean }; +type Scenario = { id: string; provider?: string; reasoning?: boolean; messages: Item[] }; + +const baseUrl = "https://synthetic.invalid/v1"; +const usage = { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, totalTokens: 0, cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 } }; +const text = (t: string, textSignature?: string): Block => ({ type: "text", text: t, ...(textSignature === undefined ? {} : { textSignature }) }); +const call = (id: string, args: Record = { z: 1, a: 2 }): Block => ({ type: "toolCall", id, name: "f", arguments: args }); +const result = (toolCallId: string, ...parts: string[]): Item => ({ role: "toolResult", toolCallId, toolName: "f", content: parts.map((t) => ({ type: "text", text: t })), isError: false }); +const assistant = (content: Block[], extra: Partial> = {}): Item => ({ role: "assistant", content, ...extra }); +const reasoningItem = '{"type":"reasoning","id":"rs_1","summary":[{"type":"summary_text","text":"s"}],"encrypted_content":"enc","10":1.50,"2":-0}'; +const v1 = (id: string, phase?: string) => JSON.stringify({ v: 1, id, ...(phase ? { phase } : {}) }); + +const scenarios: Scenario[] = [ + { id: "same-tool-turn", messages: [{ role: "user", content: "Hi" }, assistant([text("Calling", v1("msg_1")), call("call_1|fc_1", { z: 1, a: { "2": true, b: [1.5, -0, 1e21] }, "10": "x", é: null })]), result("call_1|fc_1", "out"), assistant([text("Done")])] }, + { id: "same-reasoning", reasoning: true, messages: [{ role: "user", content: "Hi" }, assistant([ + { type: "thinking", thinking: "visible", thinkingSignature: reasoningItem }, + { type: "thinking", thinking: " \t\u00a0", thinkingSignature: '{"type":"reasoning","id":"rs_blank"}' }, + { type: "thinking", thinking: "unsigned" }, + { type: "thinking", thinking: "opaque", thinkingSignature: '{"type":"reasoning","id":"rs_redacted"}', redacted: true }, + { type: "thinking", thinking: "empty-sig", thinkingSignature: "" }, + text("answer", v1("msg_2", "final_answer")), + ])] }, + { id: "text-signatures", messages: [{ role: "user", content: "Hi" }, assistant([ + text("a", v1("msg_c", "commentary")), text("b", v1("msg_bad_phase", "other")), text("c", v1("")), text("d", "legacy_plain_id"), + text("e", v1("m".repeat(65))), text("f", v1("😀".repeat(33))), text("g", v1("😀".repeat(32))), text("h", '{"v":2,"id":"x"}'), + text("i", '{"v":1,"id":7}'), text("j", '{"v":1.0,"id":"one-point-zero"}'), text("k", '{"v":1,"id":"dup","id":"last"}'), text("l"), text("m", ""), + ])] }, + { id: "message-index", messages: [ + { role: "user", content: [] }, { role: "user", content: "x" }, assistant([{ type: "thinking", thinking: " " }]), assistant([text("first"), text("second")]), + { role: "user", content: [{ type: "text", text: "" }] }, assistant([text("third")]), + ] }, + { id: "pairing", messages: [ + { role: "user", content: "go" }, + assistant([call("dead|fc_dead")], { stopReason: "error" }), result("dead|fc_dead", "dropped"), + assistant([call("gone|fc_gone")], { stopReason: "aborted" }), + assistant([call("a|fc_a"), call("b|fc_b"), call("|fc_empty")], { stopReason: "toolUse" }), + result(" a|fc_a\n", "padded"), result("unknown|fc_u", "orphan"), result("", "blank"), + { role: "user", content: "interrupt" }, + assistant([call("tail|fc_tail")]), + ] }, + { id: "tool-results", messages: [{ role: "user", content: "go" }, assistant([call("r1|fc_1"), call("r2|fc_2"), call("r3|fc_3"), call("r4|fc_4")]), + result("r1|fc_1", "line1", "line2"), result("r2|fc_2"), result("r3|fc_3", ""), { role: "toolResult", toolCallId: "r4|fc_4", toolName: "f", content: [{ type: "text", text: "😀 \"q\"" }], isError: true }] }, + { id: "same-call-ids", messages: [{ role: "user", content: "go" }, assistant([call("plain"), call("raw|"), call("|"), call("a|b|c"), call("c|rs_1"), call("we+ird|it/😀")])] }, +]; +const ids = ["call+|it😀/1", `${"a".repeat(70)}|B+/=😀`, "plain-id", "raw|", "|", "a|b|c", "c|fc_x", "c|rs_1", "trail___|item___", "x".repeat(70)]; +for (const provider of ["synthetic", "openai", "opencode"]) for (const change of ["none", "provider", "api", "model"] as const) { + const source: Source = { provider: change === "provider" ? "foreign" : provider, api: change === "api" ? "openai-completions" : "openai-responses", model: change === "model" ? "other" : "synthetic-responses" }; + const content: Block[] = [ + text("start", v1("msg_src", "commentary")), + { type: "thinking", thinking: "visible", thinkingSignature: '{"type":"reasoning","id":"rs_src"}' }, + { type: "thinking", thinking: "opaque", thinkingSignature: '{"type":"reasoning","id":"rs_red"}', redacted: true }, + { type: "thinking", thinking: " \t" }, + ...ids.map((id, i) => call(id, { z: i, a: 1 })), + ]; + scenarios.push({ id: `cross-${provider}-${change}`, provider, messages: [{ role: "user", content: "go" }, assistant(content, { source, stopReason: "toolUse" }), ...ids.toReversed().map((id) => result(id, `result-${ids.indexOf(id)}`))] }); +} + +const original = globalThis.fetch; +try { + const cases = []; + for (const s of scenarios) { + const provider = s.provider ?? "synthetic"; + const model: Model<"openai-responses"> = { id: "synthetic-responses", name: "Synthetic", api: "openai-responses", provider, baseUrl, reasoning: s.reasoning ?? false, input: ["text"], cost: usage.cost, contextWindow: 4096, maxTokens: 64 }; + const self: Source = { provider, api: "openai-responses", model: model.id }; + const items = s.messages.map((m) => (m.role === "assistant" ? { ...m, source: m.source ?? self } : m)); + const messages: Message[] = items.map((m): Message => { + if (m.role === "assistant") { + const { source, ...rest } = m; + return { ...rest, ...source, usage, stopReason: m.stopReason ?? "stop", timestamp: 0 } as AssistantMessage; + } + if (m.role === "toolResult") return { ...m, timestamp: 0 } as ToolResultMessage; + return { ...m, timestamp: 0 }; + }); + let request: { url: string; headers: Record; body: string } | undefined; + globalThis.fetch = async (url, init) => { + const headers = new Headers(init?.headers); + if (request || String(url) !== `${baseUrl}/responses` || headers.get("authorization") !== "Bearer faux-key" || typeof init?.body !== "string") throw new Error("unexpected SDK request"); + request = { url: String(url), headers: Object.fromEntries([...headers].filter(([k]) => !k.startsWith("x-stainless-") && k !== "user-agent")), body: init.body }; + const done = { type: "response.completed", response: { id: "resp_synthetic", status: "completed", output: [] } }; + return new Response(`event: response.completed\ndata: ${JSON.stringify(done)}\n\n`, { headers: { "content-type": "text/event-stream" } }); + }; + const out = await streamOpenAIResponses(model, { systemPrompt: "Synthetic system", messages }, { apiKey: "faux-key", maxRetries: 0 }).result(); + if (out.stopReason !== "stop" || !request) throw new Error(`recording failed: ${s.id}: ${out.errorMessage}`); + cases.push({ id: s.id, input: { provider, baseUrl, model: model.id, reasoning: model.reasoning, system: "Synthetic system", messages: items }, request }); + } + const paths = [ + "scripts/fixtures/openai-responses-history-recorder.ts", "packages/ai/src/providers/openai-responses.ts", "packages/ai/src/providers/openai-responses-shared.ts", + "packages/ai/src/providers/transform-messages.ts", "packages/ai/src/utils/hash.ts", "packages/ai/src/utils/sanitize-unicode.ts", "node_modules/openai/package.json", + ]; + console.log(JSON.stringify({ schema: "omk.openai-responses-history.v1", source: Object.fromEntries(paths.map((p) => [p, createHash("sha256").update(readFileSync(p)).digest("hex")])), cases })); +} finally { + globalThis.fetch = original; +} diff --git a/scripts/fixtures/openai-responses-images-recorder.ts b/scripts/fixtures/openai-responses-images-recorder.ts new file mode 100644 index 0000000000..f069d5fd29 --- /dev/null +++ b/scripts/fixtures/openai-responses-images-recorder.ts @@ -0,0 +1,77 @@ +import { createHash } from "node:crypto"; +import { readFileSync } from "node:fs"; +import { streamOpenAIResponses } from "../../packages/ai/src/providers/openai-responses.ts"; +import type { AssistantMessage, ImageContent, Message, Model, TextContent } from "../../packages/ai/src/types.ts"; + +type Part = TextContent | ImageContent; +type Item = + | { role: "user"; content: string | Part[] } + | { role: "assistant"; source: { provider: string; api: "openai-responses"; model: string }; content: AssistantMessage["content"]; stopReason: "toolUse" } + | { role: "toolResult"; toolCallId: string; toolName: string; content: Part[]; isError: boolean }; + +const baseUrl = "https://synthetic.invalid/v1"; +const usage = { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, totalTokens: 0, cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 } }; +const image: ImageContent = { type: "image", mimeType: "image/png", data: "cG5n" }; +const opaque: ImageContent = { type: "image", mimeType: "image/svg+xml", data: "not normalized+/=\n\u2028" }; +const empty: ImageContent = { type: "image", mimeType: "", data: "" }; +const text = (t: string): TextContent => ({ type: "text", text: t }); +const userMarker = text("(image omitted: model does not support images)"); +const toolMarker = text("(tool image omitted: model does not support images)"); +const source = { provider: "synthetic", api: "openai-responses" as const, model: "synthetic-responses" }; +const results: Part[][] = [ + [image], [text("a"), image, text("b")], [text(""), image], [toolMarker, image, image], [text("only")], [], + [opaque, text("x"), opaque], [userMarker, image], [empty, text("😀 \"q\"")], +]; +const histories: { id: string; messages: Item[] }[] = [ + { id: "user-only", messages: [{ role: "user", content: [image] }] }, + { id: "user-ordered", messages: [{ role: "user", content: [text("앞"), image, opaque, text(""), opaque, text("끝")] }] }, + { id: "user-literal-marker", messages: [{ role: "user", content: [userMarker, image, userMarker, text(" "), image, toolMarker, image] }] }, + { id: "user-per-turn", messages: [{ role: "user", content: [image, image] }, { role: "user", content: [] }, { role: "user", content: "plain" }, { role: "user", content: [empty] }] }, + { + id: "tool-results", + messages: [ + { role: "user", content: "go" }, + { role: "assistant", source, stopReason: "toolUse", content: results.map((_, i) => ({ type: "toolCall", id: `c${i}|fc_${i}`, name: "f", arguments: {} })) }, + ...results.map((content, i): Item => ({ role: "toolResult", toolCallId: `c${i}|fc_${i}`, toolName: "f", content, isError: i % 2 === 1 })), + { role: "user", content: [text("after"), image] }, + { role: "assistant", source, stopReason: "toolUse", content: [{ type: "text", text: "t" }] }, + ], + }, +]; +const original = globalThis.fetch; +try { + const cases = []; + for (const vision of [true, false]) { + const model: Model<"openai-responses"> = { + id: source.model, name: "Synthetic", api: "openai-responses", provider: source.provider, baseUrl, reasoning: false, + input: vision ? ["text", "image"] : ["text"], cost: usage.cost, contextWindow: 4096, maxTokens: 64, + }; + for (const h of histories) { + const messages: Message[] = h.messages.map((m): Message => { + if (m.role === "assistant") { + const { source: s, ...rest } = m; + return { ...rest, ...s, usage, timestamp: 0 }; + } + return { ...m, timestamp: 0 }; + }); + let request: { url: string; headers: Record; body: string } | undefined; + globalThis.fetch = async (url, init) => { + const headers = new Headers(init?.headers); + if (request || String(url) !== `${baseUrl}/responses` || headers.get("authorization") !== "Bearer faux-key" || typeof init?.body !== "string") throw new Error("unexpected SDK request"); + request = { url: String(url), headers: Object.fromEntries([...headers].filter(([k]) => !k.startsWith("x-stainless-") && k !== "user-agent")), body: init.body }; + const done = { type: "response.completed", response: { id: "resp_synthetic", status: "completed", output: [] } }; + return new Response(`event: response.completed\ndata: ${JSON.stringify(done)}\n\n`, { headers: { "content-type": "text/event-stream" } }); + }; + const out = await streamOpenAIResponses(model, { systemPrompt: "Synthetic system", messages }, { apiKey: "faux-key", maxRetries: 0 }).result(); + if (out.stopReason !== "stop" || !request) throw new Error(`recording failed: ${h.id}: ${out.errorMessage}`); + cases.push({ id: `${vision ? "vision" : "text"}-${h.id}`, input: { provider: model.provider, baseUrl, model: model.id, reasoning: false, vision, system: "Synthetic system", messages: h.messages }, request }); + } + } + const paths = [ + "scripts/fixtures/openai-responses-images-recorder.ts", "packages/ai/src/providers/openai-responses.ts", "packages/ai/src/providers/openai-responses-shared.ts", + "packages/ai/src/providers/transform-messages.ts", "packages/ai/src/utils/sanitize-unicode.ts", "node_modules/openai/package.json", + ]; + console.log(JSON.stringify({ schema: "omk.openai-responses-images.v1", source: Object.fromEntries(paths.map((p) => [p, createHash("sha256").update(readFileSync(p)).digest("hex")])), cases })); +} finally { + globalThis.fetch = original; +} diff --git a/scripts/fixtures/openai-responses-recorder.ts b/scripts/fixtures/openai-responses-recorder.ts new file mode 100644 index 0000000000..b3480b97a5 --- /dev/null +++ b/scripts/fixtures/openai-responses-recorder.ts @@ -0,0 +1,125 @@ +import { createHash } from "node:crypto"; +import { readFileSync } from "node:fs"; +import { type OpenAIResponsesOptions, streamOpenAIResponses } from "../../packages/ai/src/providers/openai-responses.ts"; +import type { CacheRetention, Context, Model, OpenAIResponsesCompat, ThinkingLevelMap, Tool, UserMessage } from "../../packages/ai/src/types.ts"; + +type Spec = { name: string; description: string; properties: unknown; required: string[] }; +type Scenario = { + id: string; baseUrl?: string; provider?: string; reasoning?: boolean; compat?: OpenAIResponsesCompat; map?: ThinkingLevelMap; + system?: string; messages?: UserMessage["content"][]; tools?: Spec[]; maxTokens?: number; temperature?: number; + serviceTier?: OpenAIResponsesOptions["serviceTier"]; effort?: OpenAIResponsesOptions["reasoningEffort"]; summary?: OpenAIResponsesOptions["reasoningSummary"]; + retention?: CacheRetention; session?: string; boundary?: unknown; bypass?: boolean; +}; +const openai = "https://api.openai.com/v1"; +const read: Spec = { name: "read", description: "Read a file\n\"quoted\" 한글", properties: { path: { type: "string" } }, required: ["path"] }; +const odd: Spec = { + name: "Edit", description: "Edit", required: ["b", "10"], + properties: { b: { type: "object", required: null, properties: { z: {}, y: { enum: [1.0, -0, 1e21, 0.1] } } }, "10": { type: "integer", minimum: -0 }, "2": {}, a: { type: "string" }, é: {}, "😀": {} }, +}; +const write: Spec = { name: "write", description: "", properties: {}, required: [] }; +const scenarios: Scenario[] = [ + { id: "plain" }, + { id: "reasoning-default", reasoning: true }, + { id: "empty-system", system: "" }, + { id: "user-parts", messages: [[{ type: "text", text: "a" }, { type: "text", text: "😀 b\n\"c\"" }], "second", []] }, + { id: "user-empty-text-part", messages: [[{ type: "text", text: "" }]] }, + { id: "max-tokens", maxTokens: 64 }, + { id: "max-tokens-zero", maxTokens: 0 }, + { id: "temperature", temperature: 0.5 }, + { id: "temperature-zero", temperature: 0 }, + { id: "temperature-negative-zero", temperature: -0 }, + { id: "temperature-exponent", temperature: 1e21 }, + { id: "service-tier-priority", serviceTier: "priority" }, + { id: "service-tier-flex", serviceTier: "flex" }, + { id: "service-tier-auto", serviceTier: "auto" }, + { id: "tools", tools: [write, read, odd] }, + { id: "tools-empty", tools: [] }, + { id: "effort-high", reasoning: true, effort: "high" }, + { id: "effort-ultra", reasoning: true, effort: "ultra" }, + { id: "effort-mapped", reasoning: true, effort: "high", map: { high: "xhigh" } }, + { id: "effort-map-null", reasoning: true, effort: "low", map: { low: null } }, + { id: "summary-only", reasoning: true, summary: "detailed" }, + { id: "effort-summary", reasoning: true, effort: "minimal", summary: "concise" }, + { id: "effort-summary-null", reasoning: true, effort: "medium", summary: null }, + { id: "effort-non-reasoning", effort: "high", summary: "auto" }, + { id: "off-null", reasoning: true, map: { off: null } }, + { id: "off-mapped", reasoning: true, map: { off: "minimal" } }, + { id: "off-empty", reasoning: true, map: { off: "" } }, + { id: "off-null-with-effort", reasoning: true, effort: "high", map: { off: null } }, + { id: "session-short", session: "sess-1" }, + { id: "session-none", retention: "none", session: "sess-1" }, + { id: "session-empty", session: "" }, + { id: "session-no-id-header", compat: { sendSessionIdHeader: false }, session: "sess-1" }, + { id: "session-long-clamped", session: "x".repeat(70) }, + { id: "session-internal-space", session: "a b\tc" }, + { id: "retention-long-default", retention: "long", session: "s" }, + { id: "retention-long-unsupported", retention: "long", compat: { supportsLongCacheRetention: false } }, + { id: "retention-long-no-session", retention: "long" }, + { id: "content-key", boundary: 9, session: "s", tools: [read] }, + { id: "content-key-canonical-tools", boundary: 9, tools: [read, odd] }, + { id: "content-key-astral", system: "😀 cache 한글 tail", boundary: 2 }, + { id: "boundary-null", boundary: null, session: "s" }, + { id: "boundary-too-long", boundary: 99, session: "s" }, + { id: "bypass", boundary: 9, bypass: true, session: "s" }, + { id: "codex-metadata-false", compat: { sendCodexTurnMetadata: false }, session: "s" }, + { id: "openai-host", baseUrl: openai, provider: "openai", session: "s" }, + { id: "base-trailing-slash", baseUrl: "https://synthetic.invalid/v1/" }, + { id: "base-root", baseUrl: "https://synthetic.invalid" }, +]; +const original = globalThis.fetch; +try { + const cases = []; + for (const s of scenarios) { + const baseUrl = s.baseUrl ?? "https://synthetic.invalid/v1"; + const endpoint = `${baseUrl.replace(/\/$/, "")}/responses`; + const model: Model<"openai-responses"> = { + id: "synthetic-responses", name: "Synthetic", api: "openai-responses", provider: s.provider ?? "synthetic", baseUrl, reasoning: s.reasoning ?? false, input: ["text"], + cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 4096, maxTokens: 64, + ...(s.compat ? { compat: s.compat } : {}), ...(s.map ? { thinkingLevelMap: s.map } : {}), + }; + const system = s.system ?? "Synthetic system 한글"; + const contents = s.messages ?? ["Hello"]; + // SAFETY: synthetic schemas are plain JSON; the oracle deliberately bypasses TypeBox to reach stableTools edge cases. + const tools: Tool[] | undefined = s.tools?.map((t) => ({ name: t.name, description: t.description, parameters: { type: "object", properties: t.properties, required: t.required } as unknown as Tool["parameters"] })); + const context: Context = { systemPrompt: system, messages: contents.map((content) => ({ role: "user", content, timestamp: 0 })), tools }; + if (Object.hasOwn(s, "boundary")) (context as { systemPromptCacheBoundary?: unknown }).systemPromptCacheBoundary = s.boundary; + if (s.bypass !== undefined) context.systemPromptCacheBoundaryBypass = s.bypass; + let request: { url: string; headers: Record; body: string } | undefined; + globalThis.fetch = async (url, init) => { + const headers = new Headers(init?.headers); + if (request || String(url) !== endpoint || headers.get("authorization") !== "Bearer faux-key" || typeof init?.body !== "string") throw new Error("unexpected SDK request"); + request = { url: String(url), headers: Object.fromEntries([...headers].filter(([k]) => !k.startsWith("x-stainless-") && k !== "user-agent")), body: init.body }; + const done = { type: "response.completed", response: { id: "resp_synthetic", status: "completed", output: [] } }; + return new Response(`event: response.completed\ndata: ${JSON.stringify(done)}\n\n`, { headers: { "content-type": "text/event-stream" } }); + }; + const options: OpenAIResponsesOptions = { + apiKey: "faux-key", maxRetries: 0, + ...(s.maxTokens === undefined ? {} : { maxTokens: s.maxTokens }), ...(s.temperature === undefined ? {} : { temperature: s.temperature }), + ...(s.serviceTier === undefined ? {} : { serviceTier: s.serviceTier }), ...(s.effort === undefined ? {} : { reasoningEffort: s.effort }), + ...(s.summary === undefined ? {} : { reasoningSummary: s.summary }), ...(s.retention ? { cacheRetention: s.retention } : {}), + ...(s.session === undefined ? {} : { sessionId: s.session }), + }; + const result = await streamOpenAIResponses(model, context, options).result(); + if (result.stopReason !== "stop" || !request) throw new Error(`recording failed: ${s.id}: ${result.errorMessage}`); + cases.push({ + id: s.id, + input: { + provider: model.provider, baseUrl, model: model.id, reasoning: model.reasoning, ...(s.compat ? { compat: s.compat } : {}), ...(s.map ? { thinkingLevelMap: s.map } : {}), + system, messages: contents.map((content) => ({ role: "user", content })), tools: s.tools ?? [], + ...(s.maxTokens === undefined ? {} : { maxTokens: s.maxTokens }), ...(s.temperature === undefined ? {} : { temperature: s.temperature }), + ...(s.serviceTier === undefined ? {} : { serviceTier: s.serviceTier }), ...(s.effort === undefined ? {} : { reasoningEffort: s.effort }), + ...(s.summary === undefined ? {} : { reasoningSummary: s.summary }), ...(s.retention ? { cacheRetention: s.retention } : {}), + ...(s.session === undefined ? {} : { sessionId: s.session }), + ...(Object.hasOwn(s, "boundary") ? { systemPromptCacheBoundary: s.boundary } : {}), ...(s.bypass === undefined ? {} : { systemPromptCacheBoundaryBypass: s.bypass }), + }, + request, + }); + } + const paths = [ + "scripts/fixtures/openai-responses-recorder.ts", "packages/ai/src/providers/openai-responses.ts", "packages/ai/src/providers/openai-responses-shared.ts", + "packages/ai/src/providers/openai-prompt-cache.ts", "packages/ai/src/providers/prompt-cache.ts", "packages/ai/src/providers/tool-schema.ts", "node_modules/openai/package.json", + ]; + console.log(JSON.stringify({ schema: "omk.openai-responses-request.v1", source: Object.fromEntries(paths.map((p) => [p, createHash("sha256").update(readFileSync(p)).digest("hex")])), cases })); +} finally { + globalThis.fetch = original; +} diff --git a/scripts/record-anthropic-cache-fixtures.mjs b/scripts/record-anthropic-cache-fixtures.mjs new file mode 100644 index 0000000000..2d20d98b03 --- /dev/null +++ b/scripts/record-anthropic-cache-fixtures.mjs @@ -0,0 +1,20 @@ +#!/usr/bin/env node +import { spawnSync } from "node:child_process"; +import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +const check=process.argv[2]==="--check"; +if(process.argv.length>(check?3:2)) throw new Error("usage: record-anthropic-cache-fixtures.mjs [--check]"); +const home=mkdtempSync(join(tmpdir(),"omk-cache-")); +try { + const env={PATH:process.env.PATH,HOME:home,USERPROFILE:home,XDG_CONFIG_HOME:home,OMK_CODING_AGENT_DIR:join(home,"agent")}; + const run=spawnSync(process.execPath,["--import","tsx","scripts/fixtures/anthropic-cache-recorder.ts"],{env,encoding:"utf8",timeout:30000,maxBuffer:8*1024*1024}); + if(run.error||run.status!==0) throw new Error(`cache recorder failed: ${run.error?.message??run.stderr}`); + const data=JSON.parse(run.stdout); if(data.schema!=="omk.anthropic-cache.v1"||data.cases.length!==32) throw new Error("incomplete cache oracle"); + const text=`${JSON.stringify(data,null,2)}\n`; + if(/\/home\/|\/mnt\/|sk-ant-/.test(text)) throw new Error("fixture privacy scan failed"); + const target="native/omk-providers/tests/fixtures/anthropic-cache.json"; + if(check) {if(readFileSync(target,"utf8")!==text) throw new Error("Node cache drift");} + else writeFileSync(target,text,{flag:"wx"}); + console.log(`PASS: ${data.cases.length} independent Node cache requests`); +} finally {rmSync(home,{recursive:true,force:true});} diff --git a/scripts/record-anthropic-content-fixtures.mjs b/scripts/record-anthropic-content-fixtures.mjs new file mode 100644 index 0000000000..89920bb98d --- /dev/null +++ b/scripts/record-anthropic-content-fixtures.mjs @@ -0,0 +1,36 @@ +#!/usr/bin/env node +/** Node-only request oracle. Never imports Rust or replaces an existing corpus. */ +import { spawnSync } from "node:child_process"; +import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { dirname, join, resolve } from "node:path"; +import { fileURLToPath } from "node:url"; + +const root = resolve(dirname(fileURLToPath(import.meta.url)), ".."); +const args = process.argv.slice(2); +if (args.length > 1 || args.some((arg) => arg !== "--check")) throw new Error("usage: record-anthropic-content-fixtures.mjs [--check]"); +const target = join(root, "native/omk-providers/tests/fixtures/anthropic-content.json"); +const home = mkdtempSync(join(tmpdir(), "omk-content-recorder-")); +try { + const env = { HOME: home, USERPROFILE: home, XDG_CONFIG_HOME: home }; + for (const key of ["PATH", "SystemRoot", "WINDIR", "COMSPEC", "PATHEXT"]) if (process.env[key]) env[key] = process.env[key]; + const run = spawnSync(process.execPath, ["--import", "tsx", "scripts/fixtures/anthropic-content-recorder.ts"], { + cwd: root, env, encoding: "utf8", timeout: 30_000, maxBuffer: 4 * 1024 * 1024, + }); + if (run.error || run.status !== 0) throw new Error(`content recorder failed: ${run.error?.message ?? run.stderr}`); + const fixture = JSON.parse(run.stdout); + if (fixture.schema !== "omk.anthropic.content.v1" || fixture.cases.length !== 26) throw new Error("incomplete content oracle"); + if (/\/home\/|\/mnt\/|\/Users\/|sk-ant-|Bearer /.test(run.stdout)) throw new Error("content fixture privacy scan failed"); + for (const entry of fixture.cases) { + if (entry.request.url !== "https://synthetic.invalid/v1/messages" || entry.request.headers["x-api-key"] !== "faux-key" || entry.request.headers.authorization) throw new Error("non-synthetic request"); + } + const output = `${JSON.stringify(fixture, null, 2)}\n`; + if (args.includes("--check")) { + if (readFileSync(target, "utf8") !== output) throw new Error("Node content recording drift; do not regenerate to satisfy Rust"); + } else { + writeFileSync(target, output, { flag: "wx" }); + } + console.log(`PASS: ${fixture.cases.length} content requests`); +} finally { + rmSync(home, { recursive: true, force: true }); +} diff --git a/scripts/record-anthropic-policy-fixtures.mjs b/scripts/record-anthropic-policy-fixtures.mjs new file mode 100644 index 0000000000..a947bacf2e --- /dev/null +++ b/scripts/record-anthropic-policy-fixtures.mjs @@ -0,0 +1,20 @@ +#!/usr/bin/env node +import { spawnSync } from "node:child_process"; +import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +const check=process.argv[2]==="--check"; +if(process.argv.length>(check?3:2)) throw new Error("usage: record-anthropic-policy-fixtures.mjs [--check]"); +const home=mkdtempSync(join(tmpdir(),"omk-policy-")); +try { + const env={PATH:process.env.PATH,HOME:home,USERPROFILE:home,XDG_CONFIG_HOME:home,OMK_CODING_AGENT_DIR:join(home,"agent")}; + const run=spawnSync(process.execPath,["--import","tsx","scripts/fixtures/anthropic-policy-recorder.ts"],{env,encoding:"utf8",timeout:30000,maxBuffer:8*1024*1024}); + if(run.error||run.status!==0) throw new Error(`policy recorder failed: ${run.error?.message??run.stderr}`); + const data=JSON.parse(run.stdout); if(data.schema!=="omk.anthropic-policy.v1"||data.cases.length!==32) throw new Error("incomplete policy oracle"); + const text=`${JSON.stringify(data,null,2)}\n`; + if(/\/home\/|\/mnt\/|sk-ant-/.test(text)) throw new Error("fixture privacy scan failed"); + const target="native/omk-providers/tests/fixtures/anthropic-policy.json"; + if(check) {if(readFileSync(target,"utf8")!==text) throw new Error("Node policy drift");} + else writeFileSync(target,text,{flag:"wx"}); + console.log(`PASS: ${data.cases.length} independent Node policy requests`); +} finally {rmSync(home,{recursive:true,force:true});} diff --git a/scripts/record-anthropic-signature-fixtures.mjs b/scripts/record-anthropic-signature-fixtures.mjs new file mode 100644 index 0000000000..49060d60ad --- /dev/null +++ b/scripts/record-anthropic-signature-fixtures.mjs @@ -0,0 +1,20 @@ +#!/usr/bin/env node +import { spawnSync } from "node:child_process"; +import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +const check=process.argv[2]==="--check"; +if(process.argv.length>(check?3:2)) throw new Error("usage: record-anthropic-signature-fixtures.mjs [--check]"); +const home=mkdtempSync(join(tmpdir(),"omk-signature-")); +try { + const env={PATH:process.env.PATH,HOME:home,USERPROFILE:home,XDG_CONFIG_HOME:home,OMK_CODING_AGENT_DIR:join(home,"agent")}; + const run=spawnSync(process.execPath,["--import","tsx","scripts/fixtures/anthropic-signature-recorder.ts"],{env,encoding:"utf8",timeout:30000,maxBuffer:8*1024*1024}); + if(run.error||run.status!==0) throw new Error(`signature recorder failed: ${run.error?.message??run.stderr}`); + const data=JSON.parse(run.stdout); if(data.schema!=="omk.anthropic-signature.v1"||data.cases.length!==18) throw new Error("incomplete signature oracle"); + const text=`${JSON.stringify(data,null,2)}\n`; + if(/\/home\/|\/mnt\/|sk-ant-/.test(text)) throw new Error("fixture privacy scan failed"); + const target="native/omk-providers/tests/fixtures/anthropic-signature.json"; + if(check) {if(readFileSync(target,"utf8")!==text) throw new Error("Node signature drift");} + else writeFileSync(target,text,{flag:"wx"}); + console.log(`PASS: ${data.cases.length} independent Node signature requests`); +} finally {rmSync(home,{recursive:true,force:true});} diff --git a/scripts/record-anthropic-tool-history-fixtures.mjs b/scripts/record-anthropic-tool-history-fixtures.mjs new file mode 100644 index 0000000000..9ef4d13ecc --- /dev/null +++ b/scripts/record-anthropic-tool-history-fixtures.mjs @@ -0,0 +1,36 @@ +#!/usr/bin/env node +/** Node-only request oracle. Never imports Rust or writes an existing corpus. */ +import { spawnSync } from "node:child_process"; +import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { dirname, join, resolve } from "node:path"; +import { fileURLToPath } from "node:url"; + +const root = resolve(dirname(fileURLToPath(import.meta.url)), ".."); +const args = process.argv.slice(2); +if (args.length > 1 || args.some((arg) => arg !== "--check")) throw new Error("usage: record-anthropic-tool-history-fixtures.mjs [--check]"); +const target = join(root, "native/omk-providers/tests/fixtures/anthropic-tool-history.json"); +const home = mkdtempSync(join(tmpdir(), "omk-tool-history-recorder-")); +try { + const env = { HOME: home, USERPROFILE: home, XDG_CONFIG_HOME: home }; + for (const key of ["PATH", "SystemRoot", "WINDIR", "COMSPEC", "PATHEXT"]) if (process.env[key]) env[key] = process.env[key]; + const run = spawnSync(process.execPath, ["--import", "tsx", "scripts/fixtures/anthropic-tool-history-recorder.ts"], { + cwd: root, env, encoding: "utf8", timeout: 30_000, maxBuffer: 4 * 1024 * 1024, + }); + if (run.error || run.status !== 0) throw new Error(`tool history recorder failed: ${run.error?.message ?? run.stderr}`); + const fixture = JSON.parse(run.stdout); + if (fixture.schema !== "omk.anthropic.tool-history.v1" || fixture.cases.length !== 25) throw new Error("incomplete tool history oracle"); + if (/\/home\/|\/mnt\/|\/Users\/|sk-ant-|Bearer /.test(run.stdout)) throw new Error("tool history fixture privacy scan failed"); + for (const entry of fixture.cases) { + if (entry.request.url !== "https://synthetic.invalid/v1/messages" || entry.request.headers["x-api-key"] !== "faux-key" || entry.request.headers.authorization) throw new Error("non-synthetic request"); + } + const output = `${JSON.stringify(fixture, null, 2)}\n`; + if (args.includes("--check")) { + if (readFileSync(target, "utf8") !== output) throw new Error("Node tool history recording drift; do not regenerate to satisfy Rust"); + } else { + writeFileSync(target, output); + } + console.log(`PASS: ${fixture.cases.length} tool-history requests`); +} finally { + rmSync(home, { recursive: true, force: true }); +} diff --git a/scripts/record-anthropic-tool-schema-fixtures.mjs b/scripts/record-anthropic-tool-schema-fixtures.mjs new file mode 100644 index 0000000000..26f6c4eb92 --- /dev/null +++ b/scripts/record-anthropic-tool-schema-fixtures.mjs @@ -0,0 +1,20 @@ +#!/usr/bin/env node +import { spawnSync } from "node:child_process"; +import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +const check=process.argv[2]==="--check"; +if(process.argv.length>(check?3:2)) throw new Error("usage: record-anthropic-tool-schema-fixtures.mjs [--check]"); +const home=mkdtempSync(join(tmpdir(),"omk-tool-schema-")); +try { + const env={PATH:process.env.PATH,HOME:home,USERPROFILE:home,XDG_CONFIG_HOME:home,OMK_CODING_AGENT_DIR:join(home,"agent")}; + const run=spawnSync(process.execPath,["--import","tsx","scripts/fixtures/anthropic-tool-schema-recorder.ts"],{env,encoding:"utf8",timeout:30000,maxBuffer:8*1024*1024}); + if(run.error||run.status!==0) throw new Error(`tool-schema recorder failed: ${run.error?.message??run.stderr}`); + const data=JSON.parse(run.stdout); if(data.schema!=="omk.anthropic-tool-schema.v1"||data.locale!=="en-US"||data.cases.length!==5||data.schemas.length!==25) throw new Error("incomplete tool-schema oracle"); + const text=`${JSON.stringify(data,null,2)}\n`; + if(/\/home\/|\/mnt\/|sk-ant-/.test(text)) throw new Error("fixture privacy scan failed"); + const target="native/omk-providers/tests/fixtures/anthropic-tool-schema.json"; + if(check) {if(readFileSync(target,"utf8")!==text) throw new Error("Node tool-schema drift");} + else writeFileSync(target,text,{flag:"wx"}); + console.log(`PASS: ${data.cases.length} independent Node tool-schema requests and ${data.schemas.length} schema literals`); +} finally {rmSync(home,{recursive:true,force:true});} diff --git a/scripts/record-anthropic-vision-fixtures.mjs b/scripts/record-anthropic-vision-fixtures.mjs new file mode 100644 index 0000000000..3006b20cbd --- /dev/null +++ b/scripts/record-anthropic-vision-fixtures.mjs @@ -0,0 +1,36 @@ +#!/usr/bin/env node +/** Node-only request oracle. Never imports Rust or replaces an existing corpus. */ +import { spawnSync } from "node:child_process"; +import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { dirname, join, resolve } from "node:path"; +import { fileURLToPath } from "node:url"; + +const root = resolve(dirname(fileURLToPath(import.meta.url)), ".."); +const args = process.argv.slice(2); +if (args.length > 1 || args.some((arg) => arg !== "--check")) throw new Error("usage: record-anthropic-vision-fixtures.mjs [--check]"); +const target = join(root, "native/omk-providers/tests/fixtures/anthropic-vision.json"); +const home = mkdtempSync(join(tmpdir(), "omk-vision-recorder-")); +try { + const env = { HOME: home, USERPROFILE: home, XDG_CONFIG_HOME: home }; + for (const key of ["PATH", "SystemRoot", "WINDIR", "COMSPEC", "PATHEXT"]) if (process.env[key]) env[key] = process.env[key]; + const run = spawnSync(process.execPath, ["--import", "tsx", "scripts/fixtures/anthropic-vision-recorder.ts"], { + cwd: root, env, encoding: "utf8", timeout: 30_000, maxBuffer: 4 * 1024 * 1024, + }); + if (run.error || run.status !== 0) throw new Error(`vision recorder failed: ${run.error?.message ?? run.stderr}`); + const fixture = JSON.parse(run.stdout); + if (fixture.schema !== "omk.anthropic.vision.v1" || fixture.cases.length !== 50) throw new Error("incomplete vision oracle"); + if (/\/home\/|\/mnt\/|\/Users\/|sk-ant-|Bearer /.test(run.stdout)) throw new Error("vision fixture privacy scan failed"); + for (const entry of fixture.cases) { + if (entry.request.url !== "https://synthetic.invalid/v1/messages" || entry.request.headers["x-api-key"] !== "faux-key" || entry.request.headers.authorization) throw new Error("non-synthetic request"); + } + const output = `${JSON.stringify(fixture, null, 2)}\n`; + if (args.includes("--check")) { + if (readFileSync(target, "utf8") !== output) throw new Error("Node vision recording drift; do not regenerate to satisfy Rust"); + } else { + writeFileSync(target, output, { flag: "wx" }); + } + console.log(`PASS: ${fixture.cases.length} vision requests`); +} finally { + rmSync(home, { recursive: true, force: true }); +} diff --git a/scripts/record-auth-fixtures.mjs b/scripts/record-auth-fixtures.mjs new file mode 100644 index 0000000000..dc11ca4b10 --- /dev/null +++ b/scripts/record-auth-fixtures.mjs @@ -0,0 +1,33 @@ +#!/usr/bin/env node +/** Independent real Node AuthStorage/config oracle, never imports Rust. */ +import { spawnSync } from "node:child_process"; +import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { dirname, join, resolve } from "node:path"; +import { fileURLToPath } from "node:url"; + +const root = resolve(dirname(fileURLToPath(import.meta.url)), ".."); +const args = process.argv.slice(2); +if (args.length > 1 || args.some(arg => arg !== "--check")) throw new Error("usage: record-auth-fixtures.mjs [--check]"); +const home = mkdtempSync(join(tmpdir(), "omk-auth-recorder-")); +try { + const env = { HOME: home, USERPROFILE: home, XDG_CONFIG_HOME: home, OMK_CODING_AGENT_DIR: join(home, "agent") }; + for (const key of ["PATH", "SystemRoot", "WINDIR", "COMSPEC", "PATHEXT"]) if (process.env[key]) env[key] = process.env[key]; + const run = spawnSync(process.execPath, ["--import", "tsx", "scripts/fixtures/auth-recorder.ts"], { + cwd: root, env, encoding: "utf8", timeout: 30_000, maxBuffer: 2 * 1024 * 1024, + }); + if (run.error || run.status !== 0) throw new Error(`auth recorder failed: ${run.error?.message ?? run.stderr}`); + const fixture = JSON.parse(run.stdout); + if (fixture.schema !== "omk.auth-resolution.v1" || fixture.cases.length !== 52) throw new Error("incomplete auth oracle"); + if (/\/home\/|\/mnt\/|\/Users\/|sk-ant-|Bearer /.test(run.stdout)) throw new Error("auth fixture privacy scan failed"); + const output = `${JSON.stringify(fixture, null, 2)}\n`; + const target = join(root, "native/omk-providers/tests/fixtures/auth.json"); + if (args.includes("--check")) { + if (readFileSync(target, "utf8") !== output) throw new Error("Node auth recording drift; do not regenerate to satisfy Rust"); + } else { + writeFileSync(target, output, { flag: "wx" }); + } + console.log(`PASS: ${fixture.cases.length} independent auth cases`); +} finally { + rmSync(home, { recursive: true, force: true }); +} diff --git a/scripts/record-catalog-fixtures.mjs b/scripts/record-catalog-fixtures.mjs new file mode 100644 index 0000000000..124b8b1e1b --- /dev/null +++ b/scripts/record-catalog-fixtures.mjs @@ -0,0 +1,22 @@ +#!/usr/bin/env node +import { spawnSync } from "node:child_process"; +import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +const check = process.argv[2] === "--check"; +if (process.argv.length > (check ? 3 : 2)) throw new Error("usage: record-catalog-fixtures.mjs [--check]"); +const home = mkdtempSync(join(tmpdir(), "omk-catalog-")); +try { + const env = { PATH: process.env.PATH, HOME: home, USERPROFILE: home, XDG_CONFIG_HOME: home, OMK_CODING_AGENT_DIR: join(home, "agent") }; + const run = spawnSync(process.execPath, ["--import", "tsx", "scripts/fixtures/catalog-recorder.ts"], { env, encoding: "utf8", timeout: 30000, maxBuffer: 16 * 1024 * 1024 }); + if (run.error || run.status !== 0) throw new Error(`catalog recorder failed: ${run.error?.message ?? run.stderr}`); + const data = JSON.parse(run.stdout); + if (data.fixture.cases.length !== 16 || data.builtin.models.length < 100) throw new Error("incomplete oracle"); + for (const [path, value] of [["native/omk-providers/catalog.json", data.builtin], ["native/omk-providers/tests/fixtures/catalog.json", data.fixture]]) { + const text = `${JSON.stringify(value, null, 2)}\n`; + if (/\/home\/|\/mnt\/|sk-ant-/.test(text)) throw new Error("fixture privacy scan failed"); + if (check) { if (readFileSync(path, "utf8") !== text) throw new Error(`Node catalog drift: ${path}`); } + else writeFileSync(path, text, { flag: "wx" }); + } + console.log(`PASS: ${data.builtin.models.length} catalog models, ${data.fixture.cases.length} overlay cases`); +} finally { rmSync(home, { recursive: true, force: true }); } diff --git a/scripts/record-dispatch-fixtures.mjs b/scripts/record-dispatch-fixtures.mjs new file mode 100644 index 0000000000..091beda40f --- /dev/null +++ b/scripts/record-dispatch-fixtures.mjs @@ -0,0 +1,20 @@ +#!/usr/bin/env node +import { spawnSync } from "node:child_process"; +import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +const check = process.argv[2] === "--check"; +if (process.argv.length > (check ? 3 : 2)) throw new Error("usage: record-dispatch-fixtures.mjs [--check]"); +const home = mkdtempSync(join(tmpdir(), "omk-dispatch-")); +try { + const env = { PATH: process.env.PATH, HOME: home, USERPROFILE: home, XDG_CONFIG_HOME: home, OMK_CODING_AGENT_DIR: join(home,"agent") }; + const run = spawnSync(process.execPath,["--import","tsx","scripts/fixtures/dispatch-recorder.ts"],{env,encoding:"utf8",timeout:30000,maxBuffer:4*1024*1024}); + if (run.error || run.status !== 0) throw new Error(`dispatch recorder failed: ${run.error?.message ?? run.stderr}`); + const data = JSON.parse(run.stdout); if (data.cases.length !== 10) throw new Error("incomplete dispatch oracle"); + const text = `${JSON.stringify(data,null,2)}\n`; + if (/\/home\/|\/mnt\/|sk-ant-/.test(text)) throw new Error("fixture privacy scan failed"); + const target = "native/omk-providers/tests/fixtures/dispatch.json"; + if (check) { if (readFileSync(target,"utf8") !== text) throw new Error("Node dispatch drift"); } + else writeFileSync(target,text,{flag:"wx"}); + console.log(`PASS: ${data.cases.length} independent authenticated SDK dispatch cases`); +} finally { rmSync(home,{recursive:true,force:true}); } diff --git a/scripts/record-openai-completions-fixtures.mjs b/scripts/record-openai-completions-fixtures.mjs new file mode 100644 index 0000000000..e03bddcf8f --- /dev/null +++ b/scripts/record-openai-completions-fixtures.mjs @@ -0,0 +1,24 @@ +#!/usr/bin/env node +import { spawnSync } from "node:child_process"; +import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +const args=process.argv.slice(2); +const check=args.includes("--check"); +const modes={"--reasoning":["openai-completions-reasoning","omk.openai-completions-reasoning.v1",8],"--cross":["openai-completions-cross","omk.openai-completions-cross.v1",8],"--images":["openai-completions-images","omk.openai-completions-images.v1",8],"--tools":["openai-completions-tools","omk.openai-completions-tools.v1",12],"--effort":["openai-completions-effort","omk.openai-completions-effort.v1",45],"--cache":["openai-completions-cache","omk.openai-completions-cache.v1",35],"--affinity":["openai-completions-affinity","omk.openai-completions-affinity.v1",12]}; +const selectors=args.filter(arg=>arg!=="--check"); +if(args.length!==selectors.length+Number(check)||selectors.length>1||(selectors.length&&!Object.hasOwn(modes,selectors[0]))) throw new Error("usage: record-openai-completions-fixtures.mjs [--images|--tools|--cross|--reasoning|--effort|--cache|--affinity] [--check]"); +const [name,schema,count]=modes[selectors[0]]??["openai-completions","omk.openai-completions-request.v1",21]; +const home=mkdtempSync(join(tmpdir(),"omk-oai-completions-")); +try { + const env={PATH:process.env.PATH,HOME:home,USERPROFILE:home,XDG_CONFIG_HOME:home,OMK_CODING_AGENT_DIR:join(home,"agent")}; + const run=spawnSync(process.execPath,["--import","tsx",`scripts/fixtures/${name}-recorder.ts`],{env,encoding:"utf8",timeout:30000,maxBuffer:8*1024*1024}); + if(run.error||run.status!==0) throw new Error(`openai-completions recorder failed: ${run.error?.message??run.stderr}`); + const data=JSON.parse(run.stdout); if(data.schema!==schema||data.cases.length!==count) throw new Error("incomplete openai-completions oracle"); + const text=`${JSON.stringify(data,null,2)}\n`; + if(/\/home\/|\/mnt\/|sk-[A-Za-z0-9]/.test(text)) throw new Error("fixture privacy scan failed"); + const target=`native/omk-providers/tests/fixtures/${name}.json`; + if(check) {if(readFileSync(target,"utf8")!==text) throw new Error("Node openai-completions drift");} + else writeFileSync(target,text,{flag:"wx"}); + console.log(`PASS: ${data.cases.length} independent Node openai-completions requests`); +} finally {rmSync(home,{recursive:true,force:true});} diff --git a/scripts/record-openai-responses-fixtures.mjs b/scripts/record-openai-responses-fixtures.mjs new file mode 100644 index 0000000000..b8c7872d2d --- /dev/null +++ b/scripts/record-openai-responses-fixtures.mjs @@ -0,0 +1,30 @@ +#!/usr/bin/env node +import { spawnSync } from "node:child_process"; +import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +const args = process.argv.slice(2); +const check = args.includes("--check"); +const modes = { "--history": ["openai-responses-history", "omk.openai-responses-history.v1", 19], "--images": ["openai-responses-images", "omk.openai-responses-images.v1", 10], "--headers": ["openai-responses-headers", "omk.openai-responses-headers.v1", 16] }; +const selectors = args.filter((arg) => arg !== "--check"); +if (args.length !== selectors.length + Number(check) || selectors.length > 1 || (selectors.length && !Object.hasOwn(modes, selectors[0]))) + throw new Error("usage: record-openai-responses-fixtures.mjs [--history|--images|--headers] [--check]"); +const [name, schema, count] = modes[selectors[0]] ?? ["openai-responses", "omk.openai-responses-request.v1", 47]; +const home = mkdtempSync(join(tmpdir(), "omk-oai-responses-")); +try { + // Allowlisted environment: no OMK_CACHE_RETENTION, OPENAI_* or inherited auth. + const env = { PATH: process.env.PATH, HOME: home, USERPROFILE: home, XDG_CONFIG_HOME: home, OMK_CODING_AGENT_DIR: join(home, "agent") }; + const run = spawnSync(process.execPath, ["--import", "tsx", `scripts/fixtures/${name}-recorder.ts`], { env, encoding: "utf8", timeout: 30000, maxBuffer: 8 * 1024 * 1024 }); + if (run.error || run.status !== 0) throw new Error(`openai-responses recorder failed: ${run.error?.message ?? run.stderr}`); + const data = JSON.parse(run.stdout); + if (data.schema !== schema || data.cases.length !== count) throw new Error("incomplete openai-responses oracle"); + const text = `${JSON.stringify(data, null, 2)}\n`; + if (/\/home\/|\/mnt\/|sk-[A-Za-z0-9]/.test(text)) throw new Error("fixture privacy scan failed"); + const target = `native/omk-providers/tests/fixtures/${name}.json`; + if (check) { + if (readFileSync(target, "utf8") !== text) throw new Error("Node openai-responses drift"); + } else writeFileSync(target, text, { flag: "wx" }); + console.log(`PASS: ${data.cases.length} independent Node openai-responses requests`); +} finally { + rmSync(home, { recursive: true, force: true }); +} diff --git a/scripts/test/anthropic-cache-fixtures.test.mjs b/scripts/test/anthropic-cache-fixtures.test.mjs new file mode 100644 index 0000000000..9715dbccb9 --- /dev/null +++ b/scripts/test/anthropic-cache-fixtures.test.mjs @@ -0,0 +1,28 @@ +import assert from "node:assert/strict"; +import { spawnSync } from "node:child_process"; +import { createHash } from "node:crypto"; +import { readFileSync } from "node:fs"; +import test from "node:test"; +test("independent Anthropic cache oracle stays fresh, immutable and boundary-specific",()=>{ + const path="native/omk-providers/tests/fixtures/anthropic-cache.json"; + const digest=()=>createHash("sha256").update(readFileSync(path)).digest("hex"); const before=digest(); + const run=spawnSync(process.execPath,["scripts/record-anthropic-cache-fixtures.mjs","--check"],{encoding:"utf8",timeout:45000,maxBuffer:1024*1024,env:{...process.env,OMK_CACHE_RETENTION:"long",ANTHROPIC_API_KEY:"ambient-must-not-win"}}); + assert.equal(run.error,undefined); assert.equal(run.status,0,run.stderr); assert.match(run.stdout,/32 independent Node cache requests/); assert.equal(digest(),before); + const data=JSON.parse(readFileSync(path,"utf8")); assert.equal(data.schema,"omk.anthropic-cache.v1"); + const body=id=>JSON.parse(data.cases.find(c=>c.id===id).request.body); + assert.deepEqual(body("short").system[0].cache_control,{type:"ephemeral"}); + assert.deepEqual(body("long").system[0].cache_control,{type:"ephemeral",ttl:"1h"}); + assert.deepEqual(body("long-unsupported").system[0].cache_control,{type:"ephemeral"}); + assert.equal(body("none").system[0].cache_control,undefined); + assert.equal(body("tools-short").tools[0].cache_control,undefined); + assert.deepEqual(body("tools-short").tools[1].cache_control,{type:"ephemeral"}); + assert.equal(body("tools-no-cache-control").tools[1].cache_control,undefined); + for(const id of ["boundary-zero","boundary-negative","boundary-beyond","boundary-fraction","boundary-string","boundary-null","bypass-valid","bypass-no-boundary"]){ + assert.equal(body(id).system.length,1,id); assert.equal(body(id).system[0].cache_control,undefined,id); + } + assert.deepEqual(body("boundary-surrogate").system.map(b=>b.text),["A","B"]); + assert.deepEqual(body("tool-result").messages.at(-1).content.at(-1).cache_control,{type:"ephemeral"}); + assert.deepEqual(body("history-image").messages.at(-1).content.at(-1).cache_control,{type:"ephemeral"}); + assert.equal(body("last-assistant").messages.at(-1).role,"assistant"); + assert.equal(body("last-assistant").messages.at(-1).content.at(-1).cache_control,undefined); +}); diff --git a/scripts/test/anthropic-content-fixtures.test.mjs b/scripts/test/anthropic-content-fixtures.test.mjs new file mode 100644 index 0000000000..e046835eb5 --- /dev/null +++ b/scripts/test/anthropic-content-fixtures.test.mjs @@ -0,0 +1,53 @@ +import assert from "node:assert/strict"; +import { spawnSync } from "node:child_process"; +import { readFileSync } from "node:fs"; +import test from "node:test"; + +const read = (path) => readFileSync(new URL(`../../${path}`, import.meta.url), "utf8"); +const preserved = [ + "native/omk-providers/tests/fixtures/anthropic.json", + "native/omk-providers/tests/fixtures/anthropic-json.json", + "native/omk-providers/tests/fixtures/anthropic-history.json", + "native/omk-providers/tests/fixtures/anthropic-tool-history.json", + "native/omk-providers/tests/fixtures/anthropic-content.json", + "native/omk-providers/Cargo.toml", "native/omk-providers/Cargo.lock", + "native/omk-contract/tests/fixtures/manifest.json", +]; +test("content oracle is fresh, credential-isolated and preserves every existing corpus", () => { + const before = preserved.map(read); + const run = spawnSync(process.execPath, ["scripts/record-anthropic-content-fixtures.mjs", "--check"], { + cwd: new URL("../../", import.meta.url), encoding: "utf8", timeout: 40_000, + env: { ...process.env, ANTHROPIC_API_KEY: "synthetic-unused", ANTHROPIC_AUTH_TOKEN: "synthetic-unused", ANTHROPIC_CUSTOM_HEADERS: "authorization: synthetic-unused" }, + }); + assert.equal(run.status, 0, run.stdout + run.stderr); + assert.match(run.stdout, /26 content requests/); + assert.deepEqual(preserved.map(read), before); +}); +test("Node distinguishes user arrays from joined tool text and downgrades images before blank filtering", () => { + const fixture = JSON.parse(read("native/omk-providers/tests/fixtures/anthropic-content.json")); + const messages = (id) => JSON.parse(fixture.cases.find((row) => row.id === id).request.body).messages; + const userPlaceholder = "(image omitted: model does not support images)"; + const toolPlaceholder = "(tool image omitted: model does not support images)"; + assert.equal(messages("user-empty-array").length, 1); + assert.equal(messages("user-blank-array").length, 1); + assert.deepEqual(messages("user-text-array")[0].content.map((b) => b.text), ["First 한글", "Second 🌏"]); + assert.deepEqual(messages("user-ecma-whitespace")[0].content, [{ type: "text", text: "\u0085" }]); + assert.deepEqual(messages("user-adjacent-images")[0].content, [{ type: "text", text: userPlaceholder }]); + assert.equal(messages("user-placeholder-before")[0].content.length, 1); + assert.equal(messages("user-placeholder-after")[0].content.length, 2); + assert.equal(messages("user-blank-between-images")[0].content.length, 2); + assert.equal(messages("user-mime-data-ignored")[0].content[0].text, userPlaceholder); + assert.equal(messages("tool-empty-array")[1].content[0].content, ""); + assert.equal(messages("tool-blank-array")[1].content[0].content, "\n \t\n\uFEFF"); + assert.equal(messages("tool-text-array")[1].content[0].content, "First\n\nLast 한글"); + assert.equal(messages("tool-adjacent-images")[1].content[0].content, toolPlaceholder); + assert.equal(messages("tool-placeholder-before")[1].content[0].content, toolPlaceholder); + assert.equal(messages("tool-placeholder-after")[1].content[0].content, `${toolPlaceholder}\n${toolPlaceholder}`); + assert.equal(messages("tool-blank-between-images")[1].content[0].content, `${toolPlaceholder}\n\n${toolPlaceholder}`); + assert.equal(messages("tool-grouped-images")[1].content.length, 2); + assert.equal(messages("array-interrupts-tool")[1].content[0].content, "No result provided"); + assert.equal(messages("blank-array-separates-results").length, 4); + assert.equal(messages("orphan-image").length, 1); + assert.equal(messages("failed-assistant-image").length, 1); + for (const row of fixture.cases) assert.ok(!row.request.body.includes('"type":"image"')); +}); diff --git a/scripts/test/anthropic-policy-fixtures.test.mjs b/scripts/test/anthropic-policy-fixtures.test.mjs new file mode 100644 index 0000000000..ef19d731fe --- /dev/null +++ b/scripts/test/anthropic-policy-fixtures.test.mjs @@ -0,0 +1,18 @@ +import assert from "node:assert/strict"; +import { spawnSync } from "node:child_process"; +import { createHash } from "node:crypto"; +import { readFileSync } from "node:fs"; +import test from "node:test"; +test("independent Anthropic request-policy oracle stays fresh and immutable",()=>{ + const path="native/omk-providers/tests/fixtures/anthropic-policy.json"; + const digest=()=>createHash("sha256").update(readFileSync(path)).digest("hex"); const before=digest(); + const run=spawnSync(process.execPath,["scripts/record-anthropic-policy-fixtures.mjs","--check"],{encoding:"utf8",timeout:45000,maxBuffer:1024*1024}); + assert.equal(run.error,undefined); assert.equal(run.status,0,run.stderr); assert.match(run.stdout,/32 independent Node policy requests/); assert.equal(digest(),before); + const data=JSON.parse(readFileSync(path,"utf8")); assert.equal(data.schema,"omk.anthropic-policy.v1"); + const body=id=>JSON.parse(data.cases.find(c=>c.id===id).request.body); + assert.deepEqual(body("thinking-zero-budget").thinking,{type:"enabled",budget_tokens:1024,display:"summarized"}); + assert.deepEqual(body("adaptive-xhigh").output_config,{effort:"xhigh"}); + assert.equal(body("temperature-thinking-nonreasoning").temperature,undefined); + assert.equal(body("temperature-thinking-nonreasoning").thinking,undefined); + assert.deepEqual(body("tool-named").tool_choice,{type:"tool",name:"read"}); +}); diff --git a/scripts/test/anthropic-signature-fixtures.test.mjs b/scripts/test/anthropic-signature-fixtures.test.mjs new file mode 100644 index 0000000000..8ed6fd2cf6 --- /dev/null +++ b/scripts/test/anthropic-signature-fixtures.test.mjs @@ -0,0 +1,20 @@ +import assert from "node:assert/strict"; +import { spawnSync } from "node:child_process"; +import { createHash } from "node:crypto"; +import { readFileSync } from "node:fs"; +import test from "node:test"; +test("independent thinking-signature oracle stays fresh and immutable",()=>{ + const path="native/omk-providers/tests/fixtures/anthropic-signature.json"; + const digest=()=>createHash("sha256").update(readFileSync(path)).digest("hex");const before=digest(); + const run=spawnSync(process.execPath,["scripts/record-anthropic-signature-fixtures.mjs","--check"],{encoding:"utf8",timeout:45000,maxBuffer:1024*1024}); + assert.equal(run.error,undefined);assert.equal(run.status,0,run.stderr);assert.match(run.stdout,/18 independent Node signature requests/);assert.equal(digest(),before); + const data=JSON.parse(readFileSync(path,"utf8"));assert.equal(data.schema,"omk.anthropic-signature.v1"); + const body=id=>JSON.parse(data.cases.find(c=>c.id===id).request.body); + for(const s of ["missing","empty","space","BOM"]) { + assert.deepEqual(body(`true-${s}`).messages[0].content[0],{type:"thinking",thinking:"thought",signature:""}); + assert.deepEqual(body(`false-${s}`).messages[0].content[0],{type:"text",text:"thought"}); + } + assert.equal(body("true-NEL").messages[0].content[0].signature,"\u0085"); + assert.equal(body("true-empty-text").messages[0].role,"user"); + assert.deepEqual(body("true-redacted-empty").messages[0].content[0],{type:"redacted_thinking",data:""}); +}); diff --git a/scripts/test/anthropic-tool-history-fixtures.test.mjs b/scripts/test/anthropic-tool-history-fixtures.test.mjs new file mode 100644 index 0000000000..60fa31aaac --- /dev/null +++ b/scripts/test/anthropic-tool-history-fixtures.test.mjs @@ -0,0 +1,45 @@ +import assert from "node:assert/strict"; +import { spawnSync } from "node:child_process"; +import { readFileSync } from "node:fs"; +import test from "node:test"; + +const read = (path) => readFileSync(new URL(`../../${path}`, import.meta.url), "utf8"); +const preserved = [ + "native/omk-providers/tests/fixtures/anthropic.json", + "native/omk-providers/tests/fixtures/anthropic-json.json", + "native/omk-providers/tests/fixtures/anthropic-history.json", + "native/omk-providers/tests/fixtures/anthropic-tool-history.json", + "native/omk-providers/Cargo.toml", "native/omk-providers/Cargo.lock", + "native/omk-contract/tests/fixtures/manifest.json", +]; +test("tool history oracle is fresh, ignores inherited credentials and preserves prior corpora", () => { + const before = preserved.map(read); + const run = spawnSync(process.execPath, ["scripts/record-anthropic-tool-history-fixtures.mjs", "--check"], { + cwd: new URL("../../", import.meta.url), encoding: "utf8", timeout: 40_000, + env: { ...process.env, ANTHROPIC_API_KEY: "synthetic-unused", ANTHROPIC_AUTH_TOKEN: "synthetic-unused", ANTHROPIC_CUSTOM_HEADERS: "authorization: synthetic-unused" }, + }); + assert.equal(run.status, 0, run.stdout + run.stderr); + assert.match(run.stdout, /25 tool-history requests/); + assert.deepEqual(preserved.map(read), before); +}); +test("Node tool history preserves repairs, grouping, thinking and argument key order", () => { + const fixture = JSON.parse(read("native/omk-providers/tests/fixtures/anthropic-tool-history.json")); + const body = (id) => fixture.cases.find((row) => row.id === id).request.body; + const messages = (id) => JSON.parse(body(id)).messages; + assert.equal(messages("parallel-tools")[1].content.length, 2); + assert.equal(messages("missing-at-eof")[1].content.length, 2); + assert.equal(messages("missing-one-result")[1].content[1].content, "No result provided"); + assert.equal(messages("missing-one-result")[1].content[1].is_error, true); + assert.equal(messages("error-assistant").length, 1); + assert.equal(messages("aborted-assistant").length, 1); + assert.equal(messages("orphan-results").length, 1); + assert.equal(messages("trim-result-id")[1].content[0].tool_use_id, "call_1"); + assert.equal(messages("same-model-id-unchanged")[0].content[0].id, "call|🌍"); + assert.equal(messages("multiblock-error-result")[1].content[0].content, "First\n\nLast\n🌏"); + assert.equal(messages("signed-thinking")[0].content[0].type, "thinking"); + assert.equal(messages("unsigned-thinking")[0].content[0].type, "text"); + assert.equal(messages("blank-signature")[0].content[0].type, "text"); + assert.equal(messages("empty-thinking").length, 1); + assert.equal(messages("redacted-thinking")[0].content[0].type, "redacted_thinking"); + assert.ok(body("argument-key-order").includes('"input":{"2":2,"10":10,"z":1,"a":{"second":')); +}); diff --git a/scripts/test/anthropic-tool-schema-fixtures.test.mjs b/scripts/test/anthropic-tool-schema-fixtures.test.mjs new file mode 100644 index 0000000000..a7d1c3bc60 --- /dev/null +++ b/scripts/test/anthropic-tool-schema-fixtures.test.mjs @@ -0,0 +1,17 @@ +import assert from "node:assert/strict"; +import { spawnSync } from "node:child_process"; +import { createHash } from "node:crypto"; +import { readFileSync } from "node:fs"; +import test from "node:test"; +test("independent tool-schema oracle stays fresh and immutable",()=>{ + const path="native/omk-providers/tests/fixtures/anthropic-tool-schema.json"; + const digest=()=>createHash("sha256").update(readFileSync(path)).digest("hex");const before=digest(); + const run=spawnSync(process.execPath,["scripts/record-anthropic-tool-schema-fixtures.mjs","--check"],{encoding:"utf8",timeout:45000,maxBuffer:1024*1024}); + assert.equal(run.error,undefined);assert.equal(run.status,0,run.stderr);assert.match(run.stdout,/5 independent Node tool-schema requests and 25 schema literals/);assert.equal(digest(),before); + const data=JSON.parse(readFileSync(path,"utf8"));assert.equal(data.schema,"omk.anthropic-tool-schema.v1");assert.equal(data.locale,"en-US"); + const tools=id=>JSON.parse(data.cases.find(c=>c.id===id).request.body).tools; + assert.deepEqual(tools("collation-names").slice(0,7).map(t=>t.name),["_x","-x","9z","a","A","a_b","a-b"]); + assert.equal(tools("cache-last-sorted").at(-1).name,"write");assert.ok(tools("cache-last-sorted").at(-1).cache_control); + const literal=text=>data.schemas.find(s=>s.text===text).properties; + assert.equal(literal('{"v":1e21}'),'{"v":1e+21}');assert.equal(literal('{"v":-0}'),'{"v":0}');assert.equal(literal("[]"),"{}"); +}); diff --git a/scripts/test/anthropic-vision-fixtures.test.mjs b/scripts/test/anthropic-vision-fixtures.test.mjs new file mode 100644 index 0000000000..a299079dff --- /dev/null +++ b/scripts/test/anthropic-vision-fixtures.test.mjs @@ -0,0 +1,36 @@ +import assert from "node:assert/strict"; +import { spawnSync } from "node:child_process"; +import { createHash } from "node:crypto"; +import { readFileSync } from "node:fs"; +import { test } from "node:test"; + +const root = new URL("../../", import.meta.url); +const fixture = JSON.parse(readFileSync(new URL("native/omk-providers/tests/fixtures/anthropic-vision.json", root), "utf8")); +test("vision oracle is independent, synthetic and source pinned", () => { + assert.equal(fixture.schema, "omk.anthropic.vision.v1"); + assert.equal(fixture.cases.length, 50); + assert.equal(new Set(fixture.cases.map((entry) => entry.id)).size, 50); + for (const [path, digest] of Object.entries(fixture.source)) { + assert.equal(createHash("sha256").update(readFileSync(new URL(path, root))).digest("hex"), digest, path); + } + for (const entry of fixture.cases) { + assert.equal(entry.request.url, "https://synthetic.invalid/v1/messages"); + assert.equal(entry.request.headers["x-api-key"], "faux-key"); + assert.equal(entry.request.headers.authorization, undefined); + assert.equal(entry.input.model, "synthetic-anthropic-vision"); + JSON.parse(entry.request.body); + } + const body = (id) => JSON.parse(fixture.cases.find((entry) => entry.id === id).request.body); + assert.equal(body("png-limit").messages[0].content[0].type, "image"); + assert.match(body("png-wide").messages[0].content[0].text, /1901x1/); + const tool = body("tool-only-image").messages[1].content[0].content; + assert.equal(tool[0].text, "(see attached image)"); + assert.equal(tool[1].type, "image"); +}); +test("fresh Node SDK recording matches without rewriting", () => { + const run = spawnSync(process.execPath, ["scripts/record-anthropic-vision-fixtures.mjs", "--check"], { + cwd: root, encoding: "utf8", timeout: 45_000, + }); + assert.equal(run.error, undefined); + assert.equal(run.status, 0, run.stderr || run.stdout); +}); diff --git a/scripts/test/auth-fixtures.test.mjs b/scripts/test/auth-fixtures.test.mjs new file mode 100644 index 0000000000..b7384c8c45 --- /dev/null +++ b/scripts/test/auth-fixtures.test.mjs @@ -0,0 +1,33 @@ +import assert from "node:assert/strict"; +import { spawnSync } from "node:child_process"; +import { readFileSync } from "node:fs"; +import test from "node:test"; + +const read = path => readFileSync(new URL(`../../${path}`, import.meta.url), "utf8"); +const retained = [ + "native/omk-providers/Cargo.toml", "native/omk-providers/Cargo.lock", + "native/omk-providers/THIRD-PARTY-NOTICES.md", + ...['anthropic', 'anthropic-json', 'anthropic-history', 'anthropic-tool-history', 'anthropic-content', 'anthropic-vision', 'auth'].map(name => `native/omk-providers/tests/fixtures/${name}.json`), +]; +test("real Node authentication oracle remains fresh and ignores inherited credentials", () => { + const before = retained.map(read); + const run = spawnSync(process.execPath, ["scripts/record-auth-fixtures.mjs", "--check"], { + cwd: new URL("../../", import.meta.url), encoding: "utf8", timeout: 40_000, + env: { ...process.env, ANTHROPIC_API_KEY: "ambient-not-allowed", ANTHROPIC_OAUTH_TOKEN: "ambient-not-allowed", SYN_KEY: "ambient-not-allowed" }, + }); + assert.equal(run.status, 0, run.stdout + run.stderr); + assert.match(run.stdout, /52 independent auth cases/); + assert.deepEqual(retained.map(read), before); +}); +test("Node stored-key and unreadable-store boundaries cannot silently select another account", () => { + const corpus = JSON.parse(read("native/omk-providers/tests/fixtures/auth.json")); + const result = id => corpus.cases.find(row => row.id === id).expected; + assert.deepEqual(result("stored-unresolved-no-fallback"), { key: null, blocked: false }); + assert.deepEqual(result("stored-empty-stops-fallback"), { key: "", blocked: false }); + assert.deepEqual(result("unreadable-no-substitution"), { key: null, blocked: true }); + assert.deepEqual(result("malformed-no-substitution"), { key: null, blocked: true }); + assert.deepEqual(result("runtime-over-unreadable"), { key: "faux-runtime", blocked: false }); + assert.deepEqual(result("fallback-disabled"), { key: null, blocked: false }); + assert.deepEqual(result("runtime-not-interpolated"), { key: "$SYN_KEY", blocked: false }); + assert.ok(!JSON.stringify(corpus).includes("ambient-not-allowed")); +}); diff --git a/scripts/test/catalog-fixtures.test.mjs b/scripts/test/catalog-fixtures.test.mjs new file mode 100644 index 0000000000..24913e63ee --- /dev/null +++ b/scripts/test/catalog-fixtures.test.mjs @@ -0,0 +1,17 @@ +import assert from "node:assert/strict"; +import { spawnSync } from "node:child_process"; +import { createHash } from "node:crypto"; +import { readFileSync } from "node:fs"; +import test from "node:test"; + +test("independent Node catalog and overlay oracle remains fresh without rewriting", () => { + const files=["native/omk-providers/catalog.json","native/omk-providers/tests/fixtures/catalog.json"]; + const digest=()=>files.map(p=>createHash("sha256").update(readFileSync(p)).digest("hex")); + const before=digest(); + const run=spawnSync(process.execPath,["scripts/record-catalog-fixtures.mjs","--check"],{encoding:"utf8",timeout:45000,maxBuffer:1024*1024}); + assert.equal(run.error,undefined); assert.equal(run.status,0,run.stderr); assert.match(run.stdout,/2245 catalog models, 16 overlay cases/); assert.deepEqual(digest(),before); + const catalog=JSON.parse(readFileSync(files[0],"utf8")); const fixture=JSON.parse(readFileSync(files[1],"utf8")); + assert.equal(catalog.schema,"omk.model-catalog.v1"); assert.equal(fixture.schema,"omk.model-overlay.v1"); + assert.equal(fixture.cases.find(c=>c.id==="invalid-json").expected.invalid,true); + assert.equal(fixture.cases.find(c=>c.id==="custom-defaults").expected.models.find(m=>m.provider==="synthetic").maxTokens,16384); +}); diff --git a/scripts/test/dispatch-fixtures.test.mjs b/scripts/test/dispatch-fixtures.test.mjs new file mode 100644 index 0000000000..210ffd40e0 --- /dev/null +++ b/scripts/test/dispatch-fixtures.test.mjs @@ -0,0 +1,16 @@ +import assert from "node:assert/strict"; +import { spawnSync } from "node:child_process"; +import { createHash } from "node:crypto"; +import { readFileSync } from "node:fs"; +import test from "node:test"; + +test("independent authenticated Node dispatch recording remains fresh and immutable", () => { + const path="native/omk-providers/tests/fixtures/dispatch.json"; + const digest=()=>createHash("sha256").update(readFileSync(path)).digest("hex"); + const before=digest(); + const run=spawnSync(process.execPath,["scripts/record-dispatch-fixtures.mjs","--check"],{encoding:"utf8",timeout:45000,maxBuffer:1024*1024}); + assert.equal(run.error,undefined); assert.equal(run.status,0,run.stderr); assert.match(run.stdout,/10 independent authenticated SDK dispatch cases/); assert.equal(digest(),before); + const fixture=JSON.parse(readFileSync(path,"utf8")); + assert.equal(fixture.schema,"omk.authenticated-dispatch.v1"); assert.equal(fixture.cases.length,10); + for(const c of fixture.cases) { assert.match(c.request.url,/^https:\/\/synthetic\.invalid\//); assert.equal(c.result.stopReason,"stop"); } +}); diff --git a/scripts/test/openai-completions-fixtures.test.mjs b/scripts/test/openai-completions-fixtures.test.mjs new file mode 100644 index 0000000000..e591b8148e --- /dev/null +++ b/scripts/test/openai-completions-fixtures.test.mjs @@ -0,0 +1,29 @@ +import assert from "node:assert/strict"; +import { spawnSync } from "node:child_process"; +import { createHash } from "node:crypto"; +import { readFileSync } from "node:fs"; +import test from "node:test"; +test("independent openai-completions request oracle stays fresh and immutable",()=>{ + const path="native/omk-providers/tests/fixtures/openai-completions.json"; + const digest=()=>createHash("sha256").update(readFileSync(path)).digest("hex");const before=digest(); + const run=spawnSync(process.execPath,["scripts/record-openai-completions-fixtures.mjs","--check"],{encoding:"utf8",timeout:45000,maxBuffer:1024*1024}); + assert.equal(run.error,undefined);assert.equal(run.status,0,run.stderr);assert.match(run.stdout,/21 independent Node openai-completions requests/);assert.equal(digest(),before); + const data=JSON.parse(readFileSync(path,"utf8"));assert.equal(data.schema,"omk.openai-completions-request.v1"); + const body=id=>JSON.parse(data.cases.find(c=>c.id===id).request.body); + assert.equal(body("reasoning-developer").messages[0].role,"developer"); + assert.equal(body("legacy-fields").max_tokens,64);assert.equal(body("legacy-fields").store,undefined); + assert.deepEqual(body("tools-sorted").tools.map(t=>t.function.name),["read","Read","write"]); + assert.deepEqual(body("history").messages.map(m=>m.role),["system","user","assistant","user","assistant","user"]); + assert.equal(data.cases.find(c=>c.id==="base-root").request.url,"https://synthetic.invalid/chat/completions"); +}); + +for (const mode of ["images", "tools", "cross", "reasoning", "affinity"]) { + test(`${mode} history oracle is fresh without rewriting the fixture`, () => { + const path = `native/omk-providers/tests/fixtures/openai-completions-${mode}.json`; + const before = readFileSync(path, "utf8"); + const run = spawnSync(process.execPath, ["scripts/record-openai-completions-fixtures.mjs", `--${mode}`, "--check"], { encoding: "utf8", timeout: 45000 }); + assert.equal(run.error, undefined); + assert.equal(run.status, 0, run.stderr); + assert.equal(readFileSync(path, "utf8"), before); + }); +} diff --git a/scripts/test/openai-responses-fixtures.test.mjs b/scripts/test/openai-responses-fixtures.test.mjs new file mode 100644 index 0000000000..b1a3adbf58 --- /dev/null +++ b/scripts/test/openai-responses-fixtures.test.mjs @@ -0,0 +1,76 @@ +import assert from "node:assert/strict"; +import { spawnSync } from "node:child_process"; +import { readFileSync } from "node:fs"; +import test from "node:test"; + +test("independent openai-responses request oracle stays fresh and immutable", () => { + const path = "native/omk-providers/tests/fixtures/openai-responses.json"; + const before = readFileSync(path, "utf8"); + const run = spawnSync(process.execPath, ["scripts/record-openai-responses-fixtures.mjs", "--check"], { encoding: "utf8", timeout: 45000 }); + assert.equal(run.error, undefined); + assert.equal(run.status, 0, run.stderr); + assert.match(run.stdout, /47 independent Node openai-responses requests/); + assert.equal(readFileSync(path, "utf8"), before); + const data = JSON.parse(before); + assert.equal(data.schema, "omk.openai-responses-request.v1"); + const find = (id) => data.cases.find((c) => c.id === id).request; + const body = (id) => JSON.parse(find(id).body); + assert.equal(find("base-root").url, "https://synthetic.invalid/responses"); + assert.equal(body("reasoning-default").input[0].role, "developer"); + assert.deepEqual(body("reasoning-default").reasoning, { effort: "none" }); + assert.equal(body("off-null").reasoning, undefined); + assert.deepEqual(body("tools").tools.map((t) => t.name), ["Edit", "read", "write"]); + assert.equal(find("session-no-id-header").headers.session_id, undefined); + assert.equal(find("session-no-id-header").headers["x-client-request-id"], "sess-1"); + assert.equal(body("retention-long-unsupported").prompt_cache_retention, undefined); +}); + +test("openai-responses history oracle is fresh without rewriting the fixture", () => { + const path = "native/omk-providers/tests/fixtures/openai-responses-history.json"; + const before = readFileSync(path, "utf8"); + const run = spawnSync(process.execPath, ["scripts/record-openai-responses-fixtures.mjs", "--history", "--check"], { encoding: "utf8", timeout: 45000 }); + assert.equal(run.error, undefined); + assert.equal(run.status, 0, run.stderr); + assert.match(run.stdout, /19 independent Node openai-responses requests/); + assert.equal(readFileSync(path, "utf8"), before); + const data = JSON.parse(before); + assert.equal(data.schema, "omk.openai-responses-history.v1"); + const input = (id) => JSON.parse(data.cases.find((c) => c.id === id).request.body).input; + assert.deepEqual(input("same-reasoning")[2], { 2: 0, 10: 1.5, type: "reasoning", id: "rs_1", summary: [{ type: "summary_text", text: "s" }], encrypted_content: "enc" }); + assert.equal(input("message-index").at(-1).id, "msg_omk_3"); + assert.deepEqual(input("pairing").filter((i) => i.type === "function_call_output").map((i) => i.output), ["padded", "No result provided", "No result provided", "No result provided"]); + assert.equal(input("cross-openai-model").find((i) => i.call_id === "raw").id, "fc"); +}); + +test("openai-responses image oracle is fresh without rewriting the fixture", () => { + const path = "native/omk-providers/tests/fixtures/openai-responses-images.json"; + const before = readFileSync(path, "utf8"); + const run = spawnSync(process.execPath, ["scripts/record-openai-responses-fixtures.mjs", "--images", "--check"], { encoding: "utf8", timeout: 45000 }); + assert.equal(run.error, undefined); + assert.equal(run.status, 0, run.stderr); + assert.match(run.stdout, /10 independent Node openai-responses requests/); + assert.equal(readFileSync(path, "utf8"), before); + const data = JSON.parse(before); + assert.equal(data.schema, "omk.openai-responses-images.v1"); + const outputs = (id) => JSON.parse(data.cases.find((c) => c.id === id).request.body).input.filter((i) => i.type === "function_call_output").map((i) => i.output); + assert.deepEqual(outputs("vision-tool-results")[2], [{ type: "input_image", detail: "auto", image_url: "data:image/png;base64,cG5n" }]); + assert.equal(outputs("text-tool-results")[1], "a\n(tool image omitted: model does not support images)\nb"); +}); + +test("openai-responses header merge oracle is fresh without rewriting the fixture", () => { + const path = "native/omk-providers/tests/fixtures/openai-responses-headers.json"; + const before = readFileSync(path, "utf8"); + const run = spawnSync(process.execPath, ["scripts/record-openai-responses-fixtures.mjs", "--headers", "--check"], { encoding: "utf8", timeout: 45000 }); + assert.equal(run.error, undefined); + assert.equal(run.status, 0, run.stderr); + assert.match(run.stdout, /16 independent Node openai-responses requests/); + assert.equal(readFileSync(path, "utf8"), before); + const data = JSON.parse(before); + assert.equal(data.schema, "omk.openai-responses-headers.v1"); + const headers = (id) => data.cases.find((c) => c.id === id).request.headers; + assert.equal(headers("options-override-model")["x-shared"], "option"); + assert.equal(headers("case-collision-position")["x-a"], "2"); + assert.equal(headers("options-override-session").session_id, "opt-session"); + assert.equal(headers("content-type-is-sdk-owned")["content-type"], "application/json"); + assert.equal(headers("override-sdk-defaults").authorization, "Bearer synthetic-override"); +}); diff --git a/specs/120-rust-core/k1-auth-resolution.md b/specs/120-rust-core/k1-auth-resolution.md new file mode 100644 index 0000000000..3c8314d6d6 --- /dev/null +++ b/specs/120-rust-core/k1-auth-resolution.md @@ -0,0 +1,100 @@ +# K1 credential snapshot resolution + +Date: 2026-11-17. Baseline HEAD: `ab08eb635e1d3f2d4abd4d3be1569ea8112553af`. +Status: implemented and locally verified. This unit does not complete K1 or the +active objective to continue the complete Rust migration. + +## Contract and ownership + +The current Node owners are `core/auth-storage.ts`, `core/auth-storage-backend.ts` +and `core/resolve-config-value.ts` under `packages/coding-agent/src`, and +`packages/ai/src/env-api-keys.ts`. Rust adds the read-only `auth::Snapshot` and +`auth::resolve_config` in the existing unpublished provider crate. No dependency, +lock, existing corpus, notice, Node runtime or installed-state change is needed. + +A host supplies the complete store JSON or an explicit read-failure outcome, +provider ID, runtime key, already-selected environment key, optional model-config +fallback, and an environment lookup function. There is no ambient environment or +filesystem lookup. The host must load a fresh snapshot with its own locking and +retain refresh ownership. The resolver does not invent another credential store. + +Priority matches the recorded Node behavior: + +1. Nonempty runtime key wins, verbatim, even over an unreadable store. +2. A stored API key resolves its template. Empty and unresolved stored keys stop + selection; neither switches silently to an environment/fallback account. +3. An unreadable or malformed store blocks substitution. +4. A nonempty provider-selected environment key wins over fallback. +5. Optional fallback is resolved only when enabled and reached. + +Config values support ASCII environment names, `$NAME`, `${NAME}`, `$$` and `$!`. +Unknown/incomplete variable syntax remains literal. Empty environment values count +as missing. Unicode and control characters are retained, not normalized into +credentials for another account. Expanded results are never evaluated again. + +Inputs/results are bounded to 65536 bytes per config/key; store snapshots to +1 MiB. Wrong root types are unavailable stores. Invalid selected credentials and +unknown credential kinds fail closed. `Secret` deliberately has no serialization, +clone or ordinary print implementation, and its `Debug` is `[REDACTED]`. Exposing +a key requires an explicit `expose()` call. This is not memory zeroization. + +## Independent evidence + +`node scripts/record-auth-fixtures.mjs` recorded 52 cases by calling the actual +Node `AuthStorage.fromStorage` and `resolveConfigValue` before the Rust implementation. +The recorder uses an in-memory read-only backend, isolated home and allowlisted +environment; the initial run also disabled external networking with Bubblewrap. +The separate `tests/fixtures/auth.json` includes source hashes. `--check` never +rewrites an existing recording. Expected values are never passed to Rust. + +The temporary compiled negative implementation returned literals and selected +only environment/fallback values. `cargo test --test auth` exited 101 with three +failed tests and 68 library/executable mismatches. This is behavioral RED, not a +missing API, dependency or syntax failure. The same three tests then passed after +implementation. An additional test covers exact input/output/store/CLI bounds. +Initial formatting failure is retained separately, not counted as behavioral RED. + +`replay-auth` is an offline diagnostic executable. It resolves **supplied stdin +values and prints them**, so it is for synthetic recordings, not real credentials. +It never reads actual auth files, ambient environment or the network, and refuses +unknown/ambiguous input without partial stdout or reflecting input in diagnostics. +Its stdin limit is 2 MiB. Library secrets remain redacted; the diagnostic output is +an explicit test-only exposure, not a production credential-printing command. + +## Remaining required work + +OAuth refresh/account selection, cross-process file locks/storage, shell-command +execution and provider-specific environment-name selection remain host work. +Commands return `CommandRequiresHost`; OAuth entries return `OAuthRequiresHost`. +Those refusals are safety boundaries, not completed Node OAuth/command parity. +An unresolved shell/OAuth credential never selects a different account. + +Model catalog/overlay loading, authenticated Anthropic dispatch, remaining request +options and APIs, dependent K2-K8 stages, installed adoption and platform/provider +acceptance remain open. This API does not make the synthetic request/response +models into arbitrary live-model support. No real credential, paid inference, +installation, engine selection, commit, push or publication occurred. + +## Verification + +- `cargo check --offline --locked`: exit 0. +- `cargo fmt --check`: exit 0 after owned formatting fixes; initial exit 1 retained. +- `cargo clippy --offline --locked --all-targets -- -D warnings`: exit 0. +- `cargo test --offline --locked`: 45 passed, zero ignored. This includes the + four auth tests and all prior stream/transport/history/vision regressions. +- Seven focused Node regression files: 16 passed, zero skipped, with external + networking disabled and original source/recordings read-only. +- Strict recorder TypeScript (`tsgo --ignoreConfig --noEmit --strict`): exit 0. +- `npm run check`: exit 0, 291.969 seconds. Script discovery reports 745 total, + 715 passed, 30 skipped, zero failed. This is not the full product Vitest suite. +- Active LSP: two paths confirmed clean, three inconclusive; no all-clean claim. +- Documentation links and `git diff --check`: exit 0. +- Preservation audit: unchanged HEAD/index, exactly eleven owned paths, + `otherChanges: []`; earlier corpora, locks, notices and other lanes preserved. + +Private command logs, immutable baseline and per-command argv/cwd/exit/duration +records are under `/mnt/omkdata/tmp/omk-k1-auth-ghSvRKXm`, outside the repository. +No unresolved verification process remains. Direct self-review checked credential +priority, malformed/unreadable state, bounded expansion, no ambient reads/commands, +redacted library diagnostics and the explicit diagnostic-only value output. +No provider/network/platform/installed acceptance is inferred from these results. diff --git a/specs/120-rust-core/k1-catalog-dispatch.md b/specs/120-rust-core/k1-catalog-dispatch.md new file mode 100644 index 0000000000..457ce61284 --- /dev/null +++ b/specs/120-rust-core/k1-catalog-dispatch.md @@ -0,0 +1,106 @@ +# K1 catalog and explicit authenticated Anthropic dispatch + +Date: 2026-11-17 +Status: implemented and locally verified bounded unit. K1 and the full migration remain open. + +## Scope and owners + +The unpublished `native/omk-providers` crate embeds the public Node catalog and consumes +host-supplied models.json/credential/environment snapshots. It composes the existing +request converter, credential resolver, HTTP transport and incremental stream. It does +not replace the installed Node provider host or introduce another parser or agent loop. +No dependency, lockfile, notice, launcher, settings, credential file or installed engine +changes are part of this unit. J2/B1 dependency and distribution requirements still apply. + +Sources: `packages/ai/src/models.ts`, generated catalog and Grok thinking owner; +`packages/coding-agent/src/core/model-registry.ts`, schema and JSON parser; +`packages/ai/src/providers/anthropic.ts`, compatibility helpers and SDK; +`packages/coding-agent/src/core/provider-request-key.ts` and existing auth owners. +The frozen fixtures include source SHA-256 provenance. Root MIT licensing and the existing +native notices remain applicable; the generated catalog is public project data. + +## Independent expectations and behavioral evidence + +- Before Rust catalog implementation, the real Node `getModels`, `ModelRegistry` and + `AuthStorage` recorded 2,245 builtin models and 16 models.json overlay scenarios. +- Before dispatch implementation, real Node `streamAnthropic` and the Anthropic SDK + recorded 10 authenticated requests using synthetic credentials and in-memory fetch. +- Recorder subprocesses have isolated HOME/config/environment. Network fetch is replaced + with a synthetic URL-only recorder, never a provider. Creation is exclusive; `--check` + compares without rewriting. Rust receives inputs, not expected answers. +- Compiled catalog RED recorded 28 library/executable mismatches; compiled dispatch RED + refused the catalog model with `UnknownModel`. Both were followed by focused GREEN. +- Catalog scenarios compare total/model order/metadata/availability in library and CLI. + They cover custom defaults, builtin inheritance/replacement, duplicate IDs, provider and + model overrides, partial costs, compatibility, headers, visibility, retired provider, + invalid JSON/schema and missing custom API/auth configuration. +- Every dispatch case traverses real numeric-loopback HTTP through the library and + executable. Serialized SDK body bytes and non-runtime headers match. Semantic events, + final content and token usage match; runtime SDK headers, mutable snapshots, timestamps + and monetary costs are explicitly excluded. +- A real CLI/server handshake withholds later response bytes until flushed `text_delta` + is observed. A separate library test cancels at that event, retains partial content and + observes socket closure. These are not helper-only or whole-response-buffer tests. +- HTTP failures with empty/nonempty bodies produce one terminal error, no retry and no + echoed secret. Auth/header/catalog refusal and CLI limits are tested before dispatch. + +## API and security boundaries + +`Catalog::load` uses embedded builtins and optional overlay text bounded at 1 MiB. +Provider order follows Node integer-key/insertion order. Invalid overlays retain builtin +inspection but prohibit dispatch. Explicit invalid visibility blocks availability, including +commented/trailing-comma input. Authenticated provider IDs are host-supplied, not inferred. +Frozen catalog loading does not implement filesystem discovery, refresh, legacy migration, +dynamic provider registration or OAuth-driven model mutation. + +`dispatch::prepare` accepts the chosen catalog/provider, request input, credential snapshot, +`KeySources` and explicit environment lookup. Model-config fallback is used only when the +host enables `include_fallback`; an explicit supplied fallback takes precedence. Empty or +unresolved stored keys and malformed/unreadable stores do not switch accounts. This +fail-closed boundary is stricter than any higher-level Node models.json substitution after +an unresolved stored key; the positive dispatch recordings do not claim that error-policy +parity. Commands and stored OAuth still require unimplemented host ownership. Bearer OAuth +token strings and special Copilot/Cloudflare/Kimi client paths are refused. + +`Prepared` cannot be Debug/Serialize. Header values are marked sensitive; header/framing +and endpoint validation retain the transport boundary. Raw provider error bytes are not +returned as diagnostics. User content is necessarily present in successful response events. +The host owns output handling and must not log request headers/credential snapshots. + +This adapter is explicit single-attempt, API-key, no-cache Anthropic dispatch. It supports +recorded eager-tool/beta headers and configured header precedence. Request vision follows +catalog capability, but vision-response parity is unproven. New thinking/temperature/cache, +retry policies, cross-provider histories and all other API dispatchers remain outstanding. +Callbacks must return promptly; cancellation cannot preempt synchronous callbacks/output. + +`provider catalog` and `provider stream` are explicit stdin interfaces, not installed +product commands. Input is bounded at 2 MiB and unknown fields fail closed. Stream emits +flushed `{event: ...}` lines followed by `{result: ...}`. Its protocol exit status alone is +not provider success; callers inspect the terminal event/result. It consumes only supplied +snapshot values, including a supplied provider-selected environment key. It does not read +ambient keys/auth files, refresh OAuth, execute commands or choose an installed engine. + +## Verification + +Private evidence: `/mnt/omkdata/tmp/omk-k1-dispatch-NN8uZtix`. +The immutable baseline predates this unit. `verify.py` records argv/cwd/exit/duration and +compares HEAD, complete staged binary-diff digest and every Git-visible path to that +baseline, allowing only this unit's explicit paths. Prior corpora remain unchanged. + +Observed checks: + +- Cargo offline/locked tests: 54 passed, zero failed/ignored, including prior regressions. +- Cargo check, fmt and all-target Clippy with warnings denied: exit 0. +- Strict recorder TypeScript: exit 0. +- Nine Node regression files: 18 passed, zero failed/skipped, including both fresh oracles. +- `npm run check`: exit 0, 269.711 seconds; script tests 747 total, 717 passed, + 30 skipped, zero failed. This is not full product Vitest or platform acceptance. +- Initial formatting and one Clippy collapsible-if failure remain recorded; fixed locally. +- Active LSP: 11 paths, three confirmed clean, six inconclusive, two with five auxiliary + ast-grep findings. Synthetic URL literals and recorder-style hints are retained; this is + not an all-clean LSP claim. Strict recorder TypeScript and Rust compiler gates passed. + +No live credentials/provider inference, external networking in parity tests, TLS/proxy/root +store acceptance, macOS/Windows acceptance, installation, commit, push or publication. +Performance, memory and cost superiority are not measured. Remaining K1 and later migration +gates retain their original scope in [spec.md](spec.md) and [tasks.md](tasks.md). diff --git a/specs/120-rust-core/k1-content-history.md b/specs/120-rust-core/k1-content-history.md new file mode 100644 index 0000000000..45c2d9a2ae --- /dev/null +++ b/specs/120-rust-core/k1-content-history.md @@ -0,0 +1,98 @@ +# K1 user arrays and non-vision image downgrade + +Date: 2026-11-16. Request-start HEAD: `ab08eb635e` on `2.0.0`. +This bounded continuation preserves the preexisting uncommitted tool/thinking +slice and all prior corpora. It does not complete K1 or start K2. + +## Scope + +The existing text-only synthetic request model now accepts user history `content` +arrays and text/image blocks in tool results. The original user/assistant `text` +shapes and final `user` string remain supported. User arrays remain arrays with +blank text removed; tool text remains a newline-joined string with blanks intact. + +The shared conversion follows `transform-messages.ts`: replace images with the +role-specific omission text and collapse adjacent images or images immediately +after that exact placeholder. An intervening blank text resets adjacency before +user blank filtering. Explicit text placeholders are not themselves deduplicated. +Empty user arrays still interrupt pending tools and separate tool-result groups. +The existing pairing, missing-result synthesis and orphan/error filtering remain. + +This model cannot see images. Payloads and MIME strings must be present and typed, +but are never decoded or transmitted. This intentionally does not validate image +formats or base64 that Node also discards before conversion. No image URL is +fetched. Vision metadata, image transmission and oversized-image guards remain +outside this slice. A future vision slice must independently record those paths. +Unsupported/ambiguous fields and blocks are refused. The existing 4096-block bound +is applied before image deduplication, even for orphan tool results. + +## Independent oracle + +`scripts/record-anthropic-content-fixtures.mjs` invokes actual Node +`streamAnthropic` and the official SDK with an isolated home, allowlisted +environment, in-memory fetch, synthetic credential/endpoint and zero retries. +The model remains text-only; no existing recorder or corpus is changed. +The recorder refuses to overwrite an existing corpus; `--check` compares without +writing. Rust never generates expected values. + +The 26 requests cover blank/text/Unicode user arrays, ECMAScript whitespace, +single/adjacent/separated images, explicit omission text, blank adjacency, +discarded MIME/data, empty/blank/text tool results, grouped results, interrupted +tools, blank-array group boundaries and orphan/failed-assistant image results. +Both `build_request` and the real `replay-anthropic` executable compare each +captured request body string and non-runtime headers exactly. The Node fixture +assertions independently check omission, joining, blank filtering and grouping. + +## Verification + +The compiled RED failed two Rust tests with `unsupported or ambiguous history +message fields`, starting at `user-empty-array`; malformed-input refusal already +passed. The same three focused tests pass after implementation. They also check +malformed image/content refusal without partial stdout and the 4096/4097-block +boundary before deduplication for user and tool-result arrays. + +All runs use synthetic data. Focused offline Cargo runs use a read-only source/cache, +network-disabled sandbox and an owned writable target/temporary directory. +No dependency, lockfile, model catalog, Node provider, installed-runtime, auth, +workflow, staged-content, commit, push or release change is part of this unit. + +Final observed checks: + +- `cargo check --offline --locked`, `cargo fmt --check`, Clippy with `-D warnings` + and all 19 crate tests pass. The new corpus adds three tests and 26 request + comparisons through both library and executable. Existing request/SSE/JSON + corpora remain unchanged. +- The historical text-history refusal test treated an empty user array as + unsupported. It now rejects user `toolCall` blocks instead; the new positive + oracle covers empty arrays. The initial full-crate failure is retained. +- All 12 focused Node oracle/regression tests pass with zero skips. Strict recorder + TypeScript compilation passes; `tsgo` requires explicit `--ignoreConfig` when + files are supplied. Its first invocation failed with TS5112 and is not a pass. +- `npm run check` exits 0. It checks all six native crates, fresh K0 fixtures, + contracts, TypeScript and repository guards. Script tests: 741 total, 711 pass, + 30 skip, zero fail. This is not a whole-product Vitest or live-provider run. +- The first repository check hit the outer 120-second tool limit; no terminal + exit was observed. The retry completed in 236.598 seconds. Both logs remain. +- Scoped Biome processed no files because existing configuration excludes scripts; + that invocation is not a lint pass. Repository Biome and strict TypeScript + checks passed without changing those exclusions. Initial Rust format findings + were fixed only in this unit's changed lines. +- LSP checked six paths: one confirmed clean, one auxiliary synthetic-endpoint + warning, four inconclusive. This is not an all-clean LSP result. + +The final scoped preservation audit checks the request-start HEAD, staged diff +and every captured tracked/untracked path outside the 13 enumerated unit paths. +It reports no outside changes. No preservation exception or fixture rewrite was +used to obtain a passing check. `git diff --check` exits 0. + +Commands from the repository root (credential-free environment): + +```sh +node scripts/record-anthropic-content-fixtures.mjs --check +node --test scripts/test/anthropic-content-fixtures.test.mjs scripts/test/anthropic-tool-history-fixtures.test.mjs scripts/test/anthropic-history-fixtures.test.mjs scripts/test/anthropic-json-fixtures.test.mjs scripts/test/provider-fixtures.test.mjs +cargo check --locked --offline --manifest-path native/omk-providers/Cargo.toml +cargo fmt --check --manifest-path native/omk-providers/Cargo.toml +cargo clippy --locked --offline --manifest-path native/omk-providers/Cargo.toml --all-targets -- -D warnings +cargo test --locked --offline --manifest-path native/omk-providers/Cargo.toml +npm run check +``` diff --git a/specs/120-rust-core/k1-openai-completions-request.md b/specs/120-rust-core/k1-openai-completions-request.md new file mode 100644 index 0000000000..5ce91c5712 --- /dev/null +++ b/specs/120-rust-core/k1-openai-completions-request.md @@ -0,0 +1,300 @@ +# K1 OpenAI chat-completions request bytes + +Date: 2026-11-17 +Status: implemented bounded source unit; full K1 and migration remain open. + +This is the first non-Anthropic request slice in `native/omk-providers`. The new +oracle, `scripts/fixtures/openai-completions-recorder.ts`, runs the real Node +`streamOpenAICompletions` and `openai` SDK 6.49.0 with an in-memory fetch. That +fetch refuses retries and any credential other than `faux-key`. Each case answers +with a minimal synthetic SSE stream and must not end in `error`. The recorder runs +with an isolated HOME and allowlisted environment. Recording creates the corpus +exclusively; `--check` never rewrites it. Source files and the SDK package are +SHA-256 recorded. Twenty-one requests cover: + +- system/developer role selection by `reasoning` and `supportsDeveloperRole`, + empty system prompts with and without `requiresSystemMessageFirst` +- `max_completion_tokens` versus `max_tokens`, omitted and zero `maxTokens`, + `store`, `stream_options` +- temperature `0.7`, `0` and `1e-7` (ECMAScript number text) +- tools sorted by the existing `stableTools` port, full canonical `parameters`, + non-object `properties` and `strict: false` on and off +- tool choice `auto`, `none`, `required` and a named function +- history: user strings and text blocks, empty user text, empty block arrays, + assistant text joining, ECMAScript-blank (space, tab, BOM) versus NEL text +- base URLs with and without a trailing slash, a root URL and an HTTP loopback port + +`native/omk-providers/src/openai_completions.rs` builds `{url, headers, body}` with +typed serialization. It reuses the tool-schema canonicalizer, ECMAScript number +formatting and blank-text predicate from the existing crate. The new +`request-openai-completions` executable reads one bounded input (2 MiB), uses only +the fixed synthetic key and prints the request. It ignores ambient credentials. + +The caller supplies resolved compatibility (`supportsStore`, +`supportsDeveloperRole`, `supportsUsageInStreaming`, `maxTokensField`, +`supportsStrictMode`, `requiresSystemMessageFirst`). Node provider/URL detection, +thinking formats, routing preferences and provider-specific behavior are not +ported. Unknown fields are refused. These admission bounds are not Node parity +claims: + +- base URLs whose WHATWG serialization could differ from the input (uppercase + hosts, default ports, dot segments, queries, userinfo, non-canonical IPv4, + `xn--` labels, other schemes) +- `api.openai.com`, where Node adds `prompt_cache_key` (admitted since the + 2026-11-20 cache follow-up below) +- images, tool calls/results, thinking, assistant string content, invalid + tool-choice or temperature shapes, and the existing tool-name refusals + +Node's ambient `OMK_CACHE_RETENTION=long` can add cache fields. The isolated oracle +does not set it, and Rust does not read the environment. + +Compiled behavioral RED: with a stub that returned an error, the library and +executable corpus tests failed. The refusal test passed against the stub too, so it +shows only that refusals leave no partial output, not why each refusal happens. +After the implementation, all 21 requests match exactly through the library and +the actual executable. + +Verification evidence is in `/mnt/omkdata/tmp/omk-k1-oaicomp-kMB80C`. It holds the +baseline status/index/preserved hashes, before images, the first probe output, and +RED/GREEN logs and command receipts. + +- Rust: `cargo check`, `fmt --check` and all-target Clippy with `-D warnings` exit 0. + Tests: 66 passed, zero failed or ignored. +- Recorder strict TypeScript exits 0. +- Fifteen Node fixture regression files ran with networking disabled and an owned + TMPDIR: 23 passed, zero failed or skipped. +- `npm run check`: one invocation exit 0 in 388 s at load average about 66. + `check:constitution`: 724 passed, 30 skipped, zero failed. + +Scope: this is request-byte parity for a narrow API-key chat-completions surface. +It is not response/SSE parsing, catalog dispatch, transport wiring, OpenAI +responses API, provider detection, reasoning parameters, cache keys/control, +OAuth, retries, agent/session/core adoption, or platform or live acceptance. No +dependency, lock, notice, corpus or installed engine changed. No delegated agent, +provider inference, install, commit, push or publication occurred. See also +[tool schemas](k1-tool-schema.md). + +## Follow-up: user images (2026-11-18) + +The request replay now admits user image blocks when the caller supplies `vision` +from the model's input capabilities. With `true`, the converter keeps text and +image order and embeds the original MIME type and payload in `image_url.url`. +It does not decode or validate the payload. With `false`, it uses the shared Node +history downgrade rules: adjacent images collapse to one omission marker and a +literal marker suppresses another generated marker immediately after it. State +resets between messages. Missing capability still refuses images; assistant +images, tool-result images and image-bearing turns above 4096 blocks are refused. +The original text-only inputs require no new field. + +Reproduce the independent SDK check with +`node scripts/record-openai-completions-fixtures.mjs --images --check`. The new +corpus covers four histories with vision both on and off; the original 21-case +corpus is unchanged. Before the port, the library and replay executable both +refused the first image case. Both now match all 29 SDK requests, including the +serialized body string. `cargo test --locked` in `native/omk-providers` passed +66 tests; `cargo check`, `cargo fmt --check`, all-target Clippy with `-D warnings`, +strict recorder typechecking with `tsgo`, and `npm run check` passed. No live +provider or installed engine was used to verify this conversion. + +## Follow-up: same-model tool calls and results + +`openai_completions/{pairing,history,arguments}.rs` handles same-model calls with +object arguments, real and synthetic tool results, and consecutive image results. +Call IDs stay verbatim; result IDs use ECMAScript trim. Missing results are filled +before the next user or assistant turn, or at EOF. Results with no surviving +parent are dropped. Even when all such messages are dropped, tool history in the +original input requests `tools: []` if no definitions are supplied. The caller +can enable `requiresToolResultName` and `requiresAssistantAfterToolResult`. + +`node scripts/record-openai-completions-fixtures.mjs --tools --check` verifies 12 +independent SDK requests without rewriting them. `cargo test --locked --test +openai_completions` in `native/omk-providers` compares the actual `body` bytes +through both the library and replay executable. The fixture reader passes the raw +input, preserving insertion order. Cases cover parallel calls, reordered, +missing, late and repeated results, aborted/error assistants, mixed/empty text, +vision and non-vision results, and nested non-alphabetical argument keys. + +Scope is unsigned same-model history on the existing bounded replay surface. +Cross-model ID remapping, reasoning signatures and live transport are not covered. +Replayed object arguments refuse duplicate keys, depths above 64 and lone +surrogates rather than claiming byte parity for those inputs. + +## Follow-up: cross-model tool history + +`openai_completions/handoff.rs` compares each assistant's `source` (`provider`, +`api`, `model`) with the target before pairing. A foreign call and subsequent +results use the Node ID mapping, including UTF-16 sanitization and the short +hash for long pipe-separated IDs. OpenAI's 40-code-unit plain-ID limit applies +only to foreign calls targeting `openai`. Cross-model replay strips tool thought +signatures, drops redacted thinking, and converts visible thinking to text. For +the same model, parsed truthy tool signatures populate `reasoning_details` in +call order. Signed inputs need explicit identity; existing unsigned inputs do not. + +`node scripts/record-openai-completions-fixtures.mjs --cross --check` reproduces +8 SDK requests: a same-model control and independent changes of provider, API and +model for each of the `openai` and `synthetic` targets. The Rust crate's +`cargo test --locked --test openai_completions` compares the library and executable +with the captured request body, including eight parallel calls with reversed +results. Both targets use a synthetic URL and no network. Other explicit target +providers, nonstandard same-model reasoning fields (beyond `reasoning` and +`reasoning_content`), and truncation through a surrogate pair are not supported. +This is request replay, not verification of a live provider or installed runtime. + +## Follow-up: assistant reasoning history compatibility + +The caller may enable `requiresThinkingAsText` to emit nonblank thinking blocks +joined with two newlines as the first assistant text part, followed by the +original nonblank answer parts. Without any nonblank thinking, answer text stays +a string. `requiresReasoningContentOnAssistantMessages` adds `reasoning_content` +only for a reasoning model and only when the field is missing. The SDK adds the +empty fallback after tool calls and their reasoning details; signed nonempty +`reasoning_content` stays in its original position. Neither flag defaults on. + +`node scripts/record-openai-completions-fixtures.mjs --reasoning --check` checks +all eight combinations of the two flags and the model's reasoning capability. +Each request covers interleaved answer and thinking blocks, signed tool calls, +existing reasoning content, thinking-only, blank and empty turns. The Rust +library and replay executable match the recorded body bytes. This extends +request serialization only; no streaming response or installed runtime change. + +## Follow-up: reasoning-effort request parameters (2026-11-20) + +`openai_completions/effort.rs` ports the `thinkingFormat` branches of +`buildParams`: `openai`, `openrouter`, `deepseek`, `together`, `zai`, `qwen`, +`qwen-chat-template`, `string-thinking` and `ant-ling`. The input may set +`reasoningEffort` and `thinkingLevelMap`. The caller supplies +`compat.thinkingFormat` and `compat.supportsReasoningEffort`; if +`thinkingFormat` is absent, Node's documented default `openai` applies. Node's +provider/URL detection of these flags is still not ported. The Rust code does +reproduce the one host test `buildParams` performs itself: Model Studio +(`dashscope*`/`*.maas.aliyuncs.com`) decides whether `qwen` sends +`reasoning_effort`. Mapped values replace the level names. A `null` mapping falls +back to the level name, except `off: null`, which suppresses the off value. +The `deepseek-v4-` minimal-to-low fallback applies only to Model Studio `qwen`. + +These admission rules are not Node parity claims. Rust refuses a +`reasoningEffort` or `thinkingLevelMap` when `supportsReasoningEffort` is not +explicitly resolved. It also refuses `reasoningEffort: "off"`, which +`streamSimple` clamps away before Node's call, as well as unknown levels, +formats and non-string map values. + +`node scripts/record-openai-completions-fixtures.mjs --effort --check` reproduces +45 independent SDK requests across all nine formats. They cover effort on and +off, mapped, null and absent mappings, unsupported effort, non-reasoning models, +tools, and the Model Studio host. The 57 existing requests still match. Compiled +RED: the replay executable refused the first new input +(`unknown field supportsReasoningEffort`), and the other five tests passed. After +the port, the library and executable match all 45 body strings. Two hand-made +mutants failed the new test at the expected cases: the deepseek fallback and +OpenRouter off-null handling. + +Verification ran in a network-disabled sandbox with read-only source and an +owned HOME, TMPDIR, CARGO_HOME and target; evidence is in +`/mnt/omkdata/tmp/omk-k1-oaisse-xjYQvw/logs`. `cargo fmt --check`, `check`, +all-target Clippy with `-D warnings` and `test` exit 0, with 69 tests passed and +none failed or ignored. The first formatter run and one Clippy `some_filter` run +failed and are retained as non-passes. Strict recorder `tsgo` exits 0. One +`npm run check` invocation exited 1 at `check:pi-inventory`, because another +lane's tracked deletion of `packages/coding-agent/src/ci/verify-reporter.ts` is +outside this unit. Every earlier step passed, including `check:native`, +`check:contracts` and `check:constitution` (734 passed, 30 skipped, zero failed). +The skipped final steps, workspace `tsgo --noEmit` and `check:browser-smoke`, +then exited 0 separately. This is not one clean invocation. HEAD and the staged +diff are unchanged. + +Scope remains request serialization. `prompt_cache_key`/retention, +`api.openai.com`, OpenRouter/Vercel routing, `zaiToolStream`, cache control, +provider-specific model renaming, response parsing, transport, installed runtime +and live providers are not covered. + +## Follow-up: prompt cache key and retention (2026-11-20) + +`openai_completions/cache.rs` ports the `prompt_cache_key` and +`prompt_cache_retention` fields from `buildParams`, along with +`resolveOpenAIPromptCacheKey` and `deriveContextPromptCacheKey`. New input fields +are `cacheRetention` (`none`, `short` or `long`), `sessionId`, +`systemPromptCacheBoundary`, `systemPromptCacheBoundaryBypass` and +`compat.supportsLongCacheRetention`. Without `cacheRetention`, Rust uses Node's +default `short`. Rust never reads `OMK_CACHE_RETENTION`. + +The request includes a key when the base URL contains `api.openai.com` and +retention is not `none`, or when retention is `long` and long retention is +supported. The second condition also adds `prompt_cache_retention: "24h"`. A +valid boundary yields `omk-` plus `shortHash` of the canonical JSON +fingerprint (prefix, `provider/model` scope, stable tools, version 1). Any other +present boundary, including `null`, `0`, fractions and strings, or a bypass, +yields no key. Otherwise `sessionId` is clamped to 64 code points; an empty +string still sends an empty key. The previous `api.openai.com` refusal is +removed, and its negative example is replaced. + +The fingerprint reuses the existing `stableTools` canonicalizer and `shortHash` +port. `tool_schema::write` now takes the key order as a parameter. Plain +`canonicalJsonStringify` sorts all keys by UTF-16 code units. The request schema +keeps its index-first `JSON.parse` order. + +These admission rules are not Node parity claims. Rust refuses `long` without +an explicit `supportsLongCacheRetention`. It also refuses a content key without +`provider`, a boundary that splits a surrogate pair, non-boolean bypass values +and non-string session IDs. + +`node scripts/record-openai-completions-fixtures.mjs --cache --check` reproduces +35 independent SDK requests. The cases cover each retention against the +synthetic host, `api.openai.com` and a substring host; session clamps (ASCII and +astral); valid, invalid, `null` and string boundaries; bypass; empty prompts; +scope; and unsorted, index-like, astral and private-use schema keys with +`-0`/`1e21` numbers. The 102 existing requests still match. Compiled RED: the +executable refused the first new input (`unknown field cacheRetention`), and the +other six tests passed. The new refusals also passed before the port, so they +show only fail-closed behavior. After the port, the library and executable match +all 35 body strings. Four hand-made mutants each failed at the expected cases: +index-first fingerprint order, a missing `none` check, ignoring present +boundaries, and a 65-code-point clamp. + +Evidence is in `/mnt/omkdata/tmp/omk-k1-oaicache-nEdXGT/logs`, using the same +sandbox as the effort unit. `cargo fmt --check`, `check`, all-target Clippy +with `-D warnings` and `test` exit 0, with 70 tests passing and none failing or +ignored. The first formatter run failed on two owned files and is retained as a +non-pass. All seven oracle modes pass `--check`, and strict recorder `tsgo` exits +0. One `npm run check` invocation again exited 1 at `check:pi-inventory` +because of another lane's deleted `verify-reporter.ts`. Every earlier step +passed (`check:constitution`: 734 passed, 30 skipped, zero failed). Workspace +`tsgo --noEmit` and `check:browser-smoke` then exited 0 separately. HEAD, the +staged diff and 161 preserved paths are unchanged. + +This is not covered: session-affinity headers (`sendSessionAffinityHeaders` +remained a refused compat field until the follow-up below), Anthropic-format `cacheControlFormat`, +`OPENAI_ORG_ID`/`OPENAI_PROJECT_ID` SDK environment headers, response parsing, +transport, installed runtime and live providers. + +## Follow-up: session-affinity headers (2026-11-21) + +Node `createClient` adds `session_id`, `x-client-request-id` and +`x-session-affinity` with the full (unclamped) session ID when +`compat.sendSessionAffinityHeaders` is true and the session is non-empty, except +when cache retention resolves to `none`. Rust now accepts the caller-resolved +boolean (absent means false; Node detection never enables it) and adds the same +three headers. Values Fetch `Headers` would trim (leading/trailing space or tab), +Latin-1 encode or reject are refused instead of guessed. + +The oracle `scripts/fixtures/openai-completions-affinity-recorder.ts` +(`record-openai-completions-fixtures.mjs --affinity`, 12 cases) was recorded +before the port: flag true/false/absent, missing and empty sessions, retention +`none`/`short`/`long`, a 70-character session on `api.openai.com` (headers full, +`prompt_cache_key` clamped), internal space/tab and visible ASCII punctuation. +Compiled RED: the executable refused the first case +(`unknown field sendSessionAffinityHeaders`), the other seven tests passed. After +the port the library and executable match all 12 requests; five new refusals +cover padded, Latin-1, newline and non-boolean inputs. A hand mutant ignoring +retention `none` failed the new test. The affinity mode joins the fixture +freshness test. + +Commands: crate `cargo fmt --check`, all-target Clippy with `-D warnings` and +`cargo test` exit 0; strict recorder `tsgo --ignoreConfig` exits 0; the fixture +test passes 6/6. One `npm run check` invocation exited 1 only at +`check:pi-inventory` (another lane's deleted `verify-reporter.ts`), after +`check:native` and `check:constitution` (735 passed, 30 skipped, zero failed); +workspace `tsgo --noEmit` and `check:browser-smoke` then exited 0 separately. + +Not covered: caller `options.headers` overrides, `model.headers`, GitHub Copilot +dynamic headers, Cloudflare AI Gateway authorization, response parsing, +transport and live providers. diff --git a/specs/120-rust-core/k1-openai-responses-request.md b/specs/120-rust-core/k1-openai-responses-request.md new file mode 100644 index 0000000000..4db195bdab --- /dev/null +++ b/specs/120-rust-core/k1-openai-responses-request.md @@ -0,0 +1,240 @@ +# K1 OpenAI Responses request bytes + +Date: 2026-11-21. Scope: one K1 unit, the `{url, headers, body}` that +`streamOpenAIResponses` sends through the official `openai` SDK for system and +user-text history. Status: implemented and locally verified, uncommitted. Not +complete K1, live-provider, installed-runtime or release acceptance. + +## Surface + +`native/omk-providers/src/openai_responses.rs` and the +`request-openai-responses` executable port `buildParams` and `createClient` from +`packages/ai/src/providers/openai-responses.ts`, plus the system/user and tool +parts of `convertResponsesMessages`/`convertResponsesTools`: + +- `POST {baseUrl}/responses`, `store:false`, `stream:true`, system role + `developer` for reasoning models, user text as `input_text` parts (empty part + lists skipped, as in Node). +- `max_output_tokens` (only when truthy), `temperature` (ECMAScript number text), + `service_tier`, tools sorted and canonicalized by the existing + `tool_schema::stable`, always `strict:false`. +- Reasoning: explicit effort or summary gives `{effort, summary}` plus + `include:["reasoning.encrypted_content"]`; effort goes through + `thinkingLevelMap` with `??` fallback and summary defaults to `auto`. + Otherwise the model's `off` value or `none` is sent; `off:null` suppresses it. +- Cache: unlike chat completions, `prompt_cache_key` is sent for every host + when retention is not `none` (content key, boundary rules and the 64 code point + session clamp are reused from `openai_completions/cache.rs`). + `prompt_cache_retention:"24h"` needs `long` and + `supportsLongCacheRetention`, which defaults to true here. +- Headers: a non-empty session (retention not `none`) adds + `x-client-request-id`, and `session_id` unless `sendSessionIdHeader` is false. + +Shared helpers were made crate-visible rather than copied: `endpoint(base, +suffix)`, `cache::key`, `effort::Level`/`LevelMap` and `plain_header_value`. + +Refused without partial output: GitHub Copilot and Cloudflare providers, +`sendCodexTurnMetadata:true`, assistant and tool-result messages, images, text +signatures, unknown fields, `reasoningEffort:"off"`, explicit `null` for +`temperature`/`serviceTier`/`sessionId` (Node forwards these), header values Fetch +would trim, Latin-1 encode or reject (Node itself fails on non-Latin-1 sessions +because Responses always sends them), non-canonical base URLs and tool names +outside `[A-Za-z0-9_-]`. + +## Oracle and RED/GREEN + +`scripts/fixtures/openai-responses-recorder.ts`, run by +`scripts/record-openai-responses-fixtures.mjs` in an isolated home with an +allowlisted environment, records 47 requests through the real provider and SDK +with an in-memory fetch that rejects any other URL or credential. It was recorded +before the Rust port; `--check` compares without rewriting. +`scripts/test/openai-responses-fixtures.test.mjs` checks freshness and a few +branch facts. + +The first recording attempt failed on an astral session (`ByteString` error in +Node); that case became an ASCII clamp case plus a Rust refusal. + +Compiled RED: with a stub module the corpus test failed on the first case +(`request refused: not ported`) while the refusal test passed. GREEN: the library +and executable match all 47 requests byte for byte (executable run with a cleared +environment plus `OPENAI_API_KEY` and `OMK_CACHE_RETENTION=long`, which must not +win). Three hand mutants failed at the expected cases: ignoring `off:null` +(`off-null`), `sendSessionIdHeader` default false (`session-short`) and +`supportsLongCacheRetention` default false (`retention-long-default`). + +## Verification + +- Crate: `cargo fmt --check`, `cargo check --all-targets`, Clippy + `--all-targets -D warnings` and `cargo test` exit 0; 73 tests pass. The + chat-completions suite still passes after the `endpoint` refactor (a first + rerun failed because the new parameter shadowed a local `path`; fixed). +- Strict recorder `tsgo --ignoreConfig` exits 0; both fixture test files pass 7/7. +- One `npm run check` invocation exited 1 only at `check:pi-inventory`, because + of another lane's deleted `packages/coding-agent/src/ci/verify-reporter.ts`. + Earlier steps passed (`check:native`; `check:constitution` 736 passed, 30 + skipped, zero failed, including the new test). Workspace `tsgo --noEmit` and + `check:browser-smoke` then exited 0 separately. Host load average was about 50. + +## Not covered + +Assistant text/reasoning/tool-call history and tool results (covered by the +follow-up below), images, `options.headers`/`model.headers`, +Copilot dynamic headers, Cloudflare base URL and gateway auth, Codex turn +metadata, `onPayload`, response SSE parsing, service-tier pricing, transport and +live providers. + +## Follow-up: assistant, reasoning and tool history (2026-11-21) + +`native/omk-providers/src/openai_responses/history.rs` ports `transformMessages` +and the assistant/tool-result branches of `convertResponsesMessages`. Every +assistant carries an explicit `source {provider, api, model}`; there is no +implicit same-model default. + +- First pass (source differs from the target provider, `openai-responses` or + model): redacted and blank thinking dropped, other thinking becomes text, text + signatures dropped, tool-call IDs normalized as `normalizeToolCallId` does + (`normalizeIdPart` over UTF-16 units, `fc_` + `shortHash` item IDs for a + foreign provider/API, an `fc_` prefix otherwise, only for `openai`, + `openai-codex` and `opencode` targets) and later results remapped. +- Second pass: error/aborted assistants and their results dropped, results + without a live call or with a blank ID dropped, IDs trimmed with ECMAScript + whitespace, missing results synthesized as `No result provided`. +- Items: reasoning signatures re-serialized with JS key order (index keys first), + only for nonblank thinking; text messages with `{v:1,id,phase}` or legacy + signature IDs, over-64-unit IDs hashed to `msg_`, otherwise + `msg_omk_[_]` where the index skips turns that emit nothing, + as Node's `continue` does; `function_call` with the item ID dropped for a + same-provider different-model `fc_` item; `function_call_output` joining text + with `\n`, or `(see attached image)` when empty. + +Shared helpers made crate-visible: `openai_completions::arguments::stringify` and +`handoff::short_hash`. Refused without output: unparsable or non-object reasoning +signatures, duplicate keys, text signatures starting with `{` that serde cannot +parse (Node's JSON.parse also accepts lone surrogates and overflowing numbers, so +the port refuses rather than guesses), non-object arguments, images in assistant, +user or tool-result content, unknown block fields, assistants without source and +sources on other roles. + +Oracle: `scripts/fixtures/openai-responses-history-recorder.ts` +(`record-openai-responses-fixtures.mjs --history`, 19 cases: same-model tool +turn, reasoning items, 13 text signatures, message index skipping, pairing, +tool-result text, odd call IDs, and a 3 target × 4 source-change cross matrix with +10 IDs), recorded before the port. Compiled RED: the corpus test refused the first +case (`unknown variant assistant`), the other two tests passed. GREEN on the first +implementation run for all 19 cases; the 47 earlier requests still match. Eight +hand mutants each failed: index counting empty turns (`message-index`), foreign +check without API (`cross-openai-api`), ignoring the different-model item drop +(`cross-openai-model`), no trailing `_` strip (`cross-synthetic-provider`), code +point instead of UTF-16 ID length (`text-signatures`), space join +(`tool-results`), empty instead of blank thinking (`same-reasoning`) and keeping +redacted thinking cross-model (`cross-synthetic-provider`). + +Commands: crate `cargo fmt --check`, `check --all-targets`, Clippy `-D warnings` +and `cargo test` exit 0 (74 tests); strict recorder `tsgo --ignoreConfig` exit 0; +fixture test 2/2. One `npm run check` again exited 1 only at +`check:pi-inventory` (deleted `verify-reporter.ts`, another lane), after +`check:native` and `check:constitution` (737 passed, 30 skipped, zero failed); +workspace `tsgo --noEmit` and `check:browser-smoke` exit 0 separately. Load +average about 37. + +Not covered: images (user, tool-result and non-vision downgrade; covered by the +follow-up below), Copilot and Cloudflare clients, `options.headers`, response SSE parsing, transport and live +providers. + +## Follow-up: images (2026-11-21) + +`history.rs` now accepts `{type:"image", data, mimeType}` in user and tool-result +content. The caller resolves `vision` (Node: `model.input` includes `"image"`); +a request whose history contains any image without explicit `vision` is refused +before pairing, so a dropped orphan result cannot hide the missing capability. + +- Vision: user images become `{type:"input_image", detail:"auto", + image_url:"data:;base64,"}` in order, data and MIME type + verbatim (Responses has no image guard). Tool results with images become an + output list: one `input_text` with the `\n`-joined text when it is non-empty, + then the images; text-only results stay a string, empty ones + `(see attached image)`. +- Non-vision: `downgradeUnsupportedImages`, reusing `request_content::texts` + (user and tool placeholders, consecutive images collapsed, a literal + placeholder text suppressing the next one), then the text-only mapping. + +Oracle: `scripts/fixtures/openai-responses-images-recorder.ts` +(`record-openai-responses-fixtures.mjs --images`, 10 cases = 5 histories × +vision/non-vision: single, ordered, literal markers of both kinds, per-turn with +empty and string turns, and 9 tool results including empty MIME/data, newline and +U+2028 in data). Recorded before the port. Compiled RED: `unknown field vision` +on the first case, the other three tests passed. GREEN after one fix: the +existing refusal of a tool-result image without `vision` passed through because +the orphan result was dropped first; the up-front check above restored it. Five +new refusals: non-boolean `vision`, missing `mimeType`, unknown image field and +4097 blocks with either `vision` value. Six hand mutants failed: always adding +`input_text` (`vision-tool-results`), `detail:"high"` (`vision-user-only`), the +tool placeholder for users (`text-user-only`), the user placeholder for tool +results (`text-tool-results`), dropping the empty-text fallback +(`vision-tool-results`) and requiring `vision` without images (base corpus; it is +equivalent on the image corpus). + +Commands: crate `cargo fmt --check`, `check --all-targets`, Clippy `-D warnings` +and `cargo test` exit 0 (75 tests); strict recorder `tsgo --ignoreConfig` exit 0; +fixture test 3/3. One `npm run check` exited 1 only at `check:pi-inventory` +(another lane's deleted `verify-reporter.ts`) after `check:native` and +`check:constitution` (738 passed, 30 skipped, zero failed); workspace +`tsgo --noEmit` and `check:browser-smoke` exit 0 separately. Load average about +78. + +Not covered: Copilot vision headers, Cloudflare clients, `options.headers` +(covered by the follow-up below), response SSE parsing, transport and live providers. + +## Follow-up: model and option headers (2026-11-21) + +`native/omk-providers/src/openai_responses/headers.rs` ports the `createClient` +merge and the openai 6.49.0 SDK `buildHeaders` order. Input fields: +`modelHeaders` (`model.headers`) and `headers` (`options.headers`), both +`Record` in source key order. + +- `createClient` is `Object.assign` on case-sensitive keys: model headers, then + `session_id` (unless `sendSessionIdHeader` is false) and `x-client-request-id`, + then option headers. An existing key keeps its position and takes the new + value. +- `buildHeaders`: `accept` and `authorization` first, then the merged object + with lowercased names where the last entry per lowercase name wins, then + `content-type: application/json` from the body headers. So option and model + headers can override `accept` and `authorization` but not `content-type`, and a + later-cased key can beat an earlier key that was overwritten in place. +- Array-index keys reorder under `Object.entries`, but digits have no case + variants, so the result is the same without reordering (kept as a comment). + +Refused without output: non-string or null values, non-object header records, +duplicate keys, names outside the SDK's HTTP token set, values Fetch would trim, +Latin-1 encode or reject, and `user-agent`/`x-stainless-*` (SDK-owned and outside +the recorded headers). The old negative example that refused any `headers` field +was replaced by these. + +Oracle: `scripts/fixtures/openai-responses-headers-recorder.ts` +(`record-openai-responses-fixtures.mjs --headers`). The first 15 cases were +recorded before the port: model only, option only, option over model in the same +and a different case, case-collision position, index keys, model session keys +replaced by the session, option over session, `sendSessionIdHeader:false` keeping +the model's `session_id`, retention `none`, `accept`/`authorization` overrides, +SDK-owned `content-type`, empty and inner-whitespace values, token punctuation +and empty records. Compiled RED: `unknown field modelHeaders` on the first case, +the other four tests passed. GREEN on the first run. Hand mutants: appending +instead of in-place assign (`case-collision-position`), no `content-type` last +(`model-only`), ignoring option headers (`options-only`) and first-wins +lowercasing (`options-override-other-case`) failed. A mutant setting the session +under a different-cased key survived, so a 16th Node case +(`session-in-place-before-cased-key`, model `session_id` then `SESSION_ID`) was +recorded after the port; it kills that mutant. The 15-case recording is retained +at `/tmp/openai-responses-headers.v15.json`, and its 15 cases are unchanged in the +16-case fixture. + +Commands: crate `cargo fmt --check`, `check --all-targets`, Clippy `-D warnings` +and `cargo test` exit 0 (76 tests); strict recorder `tsgo --ignoreConfig` exit 0; +fixture test 4/4. One `npm run check` exited 1 only at `check:pi-inventory` +(another lane's deleted `verify-reporter.ts`) after `check:native` and +`check:constitution` (739 passed, 30 skipped, zero failed); workspace +`tsgo --noEmit` and `check:browser-smoke` exit 0 separately. + +Not covered: Copilot dynamic headers, Cloudflare gateway authorization, +`OPENAI_ORG_ID`/`OPENAI_PROJECT_ID`, `onPayload`, response SSE parsing, transport +and live providers. diff --git a/specs/120-rust-core/k1-request-cache.md b/specs/120-rust-core/k1-request-cache.md new file mode 100644 index 0000000000..34cb1ec28e --- /dev/null +++ b/specs/120-rust-core/k1-request-cache.md @@ -0,0 +1,68 @@ +# K1 explicit Anthropic request cache + +Date: 2026-11-17 +Status: implemented bounded source unit; full K1 and migration remain incomplete. + +## Independent expectations + +The real Node `streamAnthropic`, model registry, in-memory AuthStorage and SDK recorded +32 new requests before any Rust implementation. Sources include actual cache-boundary, +Unicode sanitization, compatibility, message transformation and tool-schema owners, with +SHA-256 provenance. Numeric-loopback library and actual executable tests each compare +all 74 requests (the earlier 10 dispatch/32 policy requests plus 32 cache requests), exact +body bytes/non-runtime headers, projected semantic events/results. Rust receives inputs, +not expected outputs. Original corpora, catalog artifact and dependency graph are unchanged. + +Recording uses isolated homes, synthetic API keys, network-isolated synthetic-only fetch, +explicit retention and zero retries. Freshness checks are non-rewriting. Unknown/failed +expectations never become new golden output generated by Rust. + +## Implementation + +- Explicit `options.cacheRetention`: none, short or long. Long uses `ttl:"1h"` only when + compatible; Fireworks defaults to no long TTL and no tool cache unless explicitly overridden. +- Final supplied tool cache follows compatibility. Existing raw tool-schema/argument + serialization is retained. Tool definitions in this corpus are already Node-stable; + arbitrary schema normalization/order/locale collation is not implemented by this unit. +- Cache the final converted user text/image/tool-result block, after existing filtering, + orphan resolution and grouping. A last assistant or empty conversation stays uncached. + Wrapping the existing typed block preserves wire key order and raw arguments. +- System cache uses `systemPromptCacheBoundary` in UTF-16 units and optional boolean + `systemPromptCacheBoundaryBypass`. Missing metadata permits whole-system caching. + Valid positive integral metadata caches only the stable prefix. Invalid explicit + metadata, including null, disables system cache without disabling message/tool cache. + End-of-string creates no empty suffix. Split surrogate pairs lose unpaired units, + matching actual Node sanitizeSurrogates rather than inserting replacement characters. +- Boundary deserialization retains missing versus present null. Invalid cache enum/shape, + null retention and nonboolean bypass are refused locally; refusal equivalence to every + malformed Node caller value is not claimed. Synthetic replay still refuses new policies. + +Omitted retention deliberately preserves the bounded adapter's old no-cache behavior. +No ambient/default-retention inference, cache-affinity/session key, OAuth client, provider +billing/cache hit or real API acceptance is implemented. Complete arbitrary-tool request +parity, remaining providers/APIs/authentication storage and later core/session/platform +migration requirements remain open in [spec.md](spec.md) and [tasks.md](tasks.md). + +## Verification + +Evidence root: `/mnt/omkdata/tmp/omk-k1-cache-tnLTztWK`. +Immutable baseline and before images, command receipts/logs, original failures and scoped +preservation checks are retained there. Changes are limited to fourteen allowlisted paths. + +- Compiled behavioral RED: old options reject cacheRetention, exit 101. +- Second independent failure: surrogate splits inserted U+FFFD where Node removes lone + units. Fixed via decode_utf16 filtering, without changing recorded expected data. +- Both library/executable socket parity tests pass all 74 cases. +- Crate regression: 60 passed, zero failed/ignored. Eleven Node files: 20 passed, zero + failed/skipped. Recorder strict TypeScript, all-target Clippy with warnings denied and + format checks passed. `npm run check` exited 0 in 411.272 seconds: 749 script tests, + 719 passed, 30 skipped and zero failed. It is not full product Vitest. +- Active LSP returned no diagnostics but six inconclusive paths, zero confirmed clean. +- Final documentation links/diff and scoped preservation checks are recorded in evidence. + +The initial formatting failure is retained, not counted as behavioral RED. Full product +Vitest, live TLS/provider/cache-billing behavior, other platforms and installed adoption +are not established by this unit. No credentials, launchers, installed state, settings, +notices, locks, other worktrees or unrelated code were changed. No commit/push/publication, +delegation or provider inference was performed. See also the preceding +[request-policy record](k1-request-policy.md) and [catalog/dispatch record](k1-catalog-dispatch.md). diff --git a/specs/120-rust-core/k1-request-policy.md b/specs/120-rust-core/k1-request-policy.md new file mode 100644 index 0000000000..9eabe199c4 --- /dev/null +++ b/specs/120-rust-core/k1-request-policy.md @@ -0,0 +1,80 @@ +# K1 explicit Anthropic request policies + +Date: 2026-11-17 +Status: implemented bounded source unit; full K1 and migration remain open. + +## Independent contract and scope + +The actual Node `streamAnthropic` and SDK recorded 32 new synthetic requests before Rust +policy implementation. Expectations are separate from every earlier corpus and carry +source SHA-256 provenance. Isolated temporary homes, explicit fake runtime keys, an +in-memory synthetic-only fetch and network-isolated recording prevent provider execution. +The recorder creates exclusively; `--check` compares without rewriting expected data. + +A compiled behavioral RED rejected the recorded `options` field. The minimal implementation +adds typed `request_policy::Options`, attaches it to the existing request input, and uses +one `Policy` during the existing body serialization. It does not round-trip tool schemas or +raw arguments through serde_json::Value. Existing transport, authentication, headers, +incremental reducer and executable remain the owners. + +Every new case now traverses both actual library and executable numeric-loopback HTTP. +The shared dispatch tests run the original 10 cases plus these 32, comparing exact SDK body +bytes/non-runtime headers and projected semantic events/results. Expected outputs are not +supplied to Rust. This is no-cache API-key request parity on those cases, not all Anthropic +options, arbitrary model acceptance, monetary-cost or full provider-response parity. + +## Implemented options + +- `temperature`: serialized before tools when supplied, thinking was not requested, and + model compatibility permits it. A thinking request suppresses it even for nonreasoning + models, matching observed Node behavior. Numeric spellings of zero/one are canonicalized. +- `thinkingEnabled`, `thinkingBudgetTokens`, `thinkingDisplay`: gated by model reasoning; + classic thinking uses `enabled`, a default/zero budget of 1024 and summarized default. + Adaptive compatibility uses `adaptive` with optional low/medium/high/xhigh/max `effort`. +- Explicit disabled thinking respects the compatibility override and the Node-derived + Fable/Opus model-name default. Eight separately observed real Node helper outputs test + prefix/segment/digit-boundary behavior and explicit override precedence. +- `metadata`: emits only a string `user_id`, including empty strings; other values/fields + do not appear on the wire. +- `toolChoice`: auto/any/none strings or the strict `{type:"tool",name}` form, serialized + after thinking/output config/metadata in the SDK's property order. + +Unknown fields/enums/shapes fail before dispatch. Temperature outside 0 through 1, +non-u32 budgets, and empty/over-256-byte named tools are explicit local admission limits; +Node may send such values to an API, so refusal equivalence is not claimed. Synthetic +`build_request`/replay refuse options rather than pretending to execute new model policy. +The original replay inputs/corpora remain byte-unchanged. + +No ambient cache preference or simple-reasoning inference is introduced. Cache retention, +stable system-prompt boundaries, empty-thinking signatures, OAuth/bearer clients, all other +provider APIs, retry/error semantics, credential storage/locking/refresh, agent/session/core +adoption and platform/live acceptance remain outstanding. + +## Verification and preservation + +Evidence: `/mnt/omkdata/tmp/omk-k1-policy-YwYkCdpa` with immutable baseline, before images, +command argv/cwd/exit/duration, logs and scoped preservation audit. Previous catalog, +dispatch and all original corpora/dependencies/notices are preserved from this baseline. + +- Rust crate: 58 passed, zero failed/ignored, including the original 54 tests and four + policy boundary/default tests. The two dispatch tests each exercise all 42 requests. +- Strict recorder TypeScript passed; ten Node regression files passed, 19 tests with zero + failures/skips, including non-rewriting checks for all prior oracles and the new 32 cases. +- Cargo check, fmt and all-target Clippy with warnings denied passed offline/locked. +- `npm run check`: exit 0, 577.024 seconds; script tests 748 total, 718 passed, + 30 skipped, zero failed. This is not full product Vitest/platform acceptance. +- Active LSP: six paths inconclusive, no confirmed-clean paths and no returned diagnostics. + Compiler checks passed; this is not an all-clean LSP claim. +- Scoped preservation: unchanged HEAD/index, twelve owned paths, no other Git-visible change. + +Retained non-passes: first recorder attempt lacked writable child /tmp, a standalone Node +helper command had an extra parenthesis, added test code initially lacked an explicit +serde_json::Value annotation, and formatting needed correction. A 120-second tool wait +expired during compilation without an observed terminal exit; no owned process remained. +The successful offline Cargo rerun used two jobs and a longer wait, without weakening a +test or guard. None of those infrastructure/compiler failures is counted as behavioral RED. + +No real user authentication file was read or changed. No dependency, lock, notice, +launcher/installed engine/default/settings mutation, provider inference, delegated agent, +commit, push or publication. Remaining requirements stay open in [spec.md](spec.md), +[tasks.md](tasks.md) and the preceding [catalog/dispatch record](k1-catalog-dispatch.md). diff --git a/specs/120-rust-core/k1-stream.md b/specs/120-rust-core/k1-stream.md new file mode 100644 index 0000000000..93c9992545 --- /dev/null +++ b/specs/120-rust-core/k1-stream.md @@ -0,0 +1,74 @@ +# K1 incremental Anthropic semantic stream + +Status: implemented and locally verified. Not full K1, RC2, installed +adoption or a selectable Rust core. The full migration objective remains open. + +## Scope and callers + +- `native/omk-providers/src/anthropic_stream.rs`: the existing SSE decoder and + reducer now have a single incremental owner. `Stream::new` accepts only the + recorded text model. `feed` counts original bytes against 8 MiB and latches + failures. `take_events` moves semantic events out once. Consuming `finish` + flushes EOF and produces exactly one terminal event and final message. +- `anthropic.rs`: replay uses that owner instead of a second batch-only state + machine. Existing upfront replay bounds, cancellation-boundary validation, + opt-in argument observations, and request-only vision refusal are unchanged. +- `src/lib.rs`: private module registration; public API remains under `anthropic`. +- `tests/anthropic_stream.rs`: all 16 independently recorded Node terminal + projections, incremental delivery/exactly-once draining, parser-error latching, + total byte bound, unrecorded-model refusals, and real loopback transport delivery + before EOF plus cancellation/socket closure at partial text. +- Crate README documents ownership and limits. No Node source, original corpus, + model catalog, dependency/lock/notice, installed configuration, launcher, + workflow, K0 fixture or another lane is changed. + +The existing `replay-anthropic` executable consumes the new state machine through +its actual replay caller. Its library/CLI parity suites still compare expected +requests/results/events without supplying expected output to Rust. Live-provider +HTTP dispatch is not wired by this change. The loopback integration uses real +`Transport::post`, its deadline/cancellation and frozen synthetic SDK SSE bytes. +No credentials or external network are used. + +## Oracle and RED + +The independent Node provider/SDK recording was freshly checked, without rewriting, +before implementation in an isolated HOME and network-disabled sandbox. Expected +request/event/result bytes are unchanged. + +A temporary batch-only adapter delegated to the existing replay, so terminal +parity already passed while new incremental behavior was missing. The compiled +RED ran four tests: one passed, three failed for absent early events, absent feed +failure and absent total-byte refusal. It is retained as `rust-red.log`; the +adapter was then replaced, not left as an alternate implementation. + +The existing Node-derived frame consumer was moved unchanged into the incremental +owner. Replay still validates its complete input before constructing this owner. +Parser failures remain visible and take precedence over a generic later consumer +error; cancellation preserves the existing Node partial/incomplete outcome. + +## Verification + +- `cargo check --offline --locked`, fmt `--check`, Clippy `--all-targets -- -D + warnings`, and full crate tests: exit 0. The crate runs 41 tests, including five + new incremental tests. Linux Cargo checks use read-only source/cache and an + external-network-disabled sandbox with isolated target, HOME and temp roots. +- Six focused independent Node fixture files: 14 passed, zero skipped, in a + network-disabled sandbox; no corpus rewrite. +- `npm run check`: exit 0 in 264.869 seconds, including six native crates, + independently refreshed Node oracles, contract recordings and repository guards. + This is not the full product Vitest suite or native platform acceptance. +- Active LSP: two paths confirmed clean, one existing inactive-cfg hint and one + inconclusive. Not an all-clean claim. +- Documentation links and `git diff --check`: exit 0. +- Preservation audit: HEAD and complete staged-diff digest unchanged; exactly six + owned paths differ from this unit's baseline and `otherChanges` is empty. Prior + transport/history/vision work, corpora, manifests, locks and notices are unchanged. +- Initial formatter failures were corrected only in owned code and retained as + non-passes. The compiled batch-adapter RED remains separate from those failures. +- Direct review checked single ownership, byte/error latching, event draining, + terminal/cancellation/EOF ordering, real replay and transport consumers, and + absence of copied decoder/reducer logic or changed package/runtime settings. + +This unit does not supply mutable partial snapshots, timestamp/cost parity, +full provider model/auth/cache/override/HTTP-error/retry policy, complete K1, +K2-K5 or the later platform/extension/Pi-independence gates. diff --git a/specs/120-rust-core/k1-thinking-signature.md b/specs/120-rust-core/k1-thinking-signature.md new file mode 100644 index 0000000000..1b74d28cfa --- /dev/null +++ b/specs/120-rust-core/k1-thinking-signature.md @@ -0,0 +1,44 @@ +# K1 same-model thinking signature compatibility + +Date: 2026-11-17 +Status: implemented bounded source unit; full K1 and migration remain open. + +The real Node streamAnthropic/SDK recorded eighteen new requests before Rust changes. +The independent oracle crosses allowEmptySignature false/true with missing, empty, +space-only, BOM-only, NEL, valid, blank-thinking, opaque redacted and empty redacted +signatures. Node runtime source and SDK package provenance are SHA-256 recorded. Only +synthetic keys/content, isolated homes, in-memory synthetic-only fetch and zero retries +are used. The recorder creates exclusively; --check never rewrites expected data. + +Catalog model compatibility is resolved before the optional request-options early return, +so absent options cannot drop the model flag. The existing request/history/block owners +thread a single allow_empty_signature boolean; no parallel converter or parser is added. +Missing/ECMAScript-blank signatures on nonblank same-model thinking become an empty +thinking signature only when compatibility permits. Otherwise they stay plain text. +Existing signed, redacted, blank, error/aborted and original-block-bound behavior is reused. +The legacy synthetic replay still defaults false and rejects a caller-injected compat +field. Missing redacted signatures remain invalid; opaque empty data stays supported. + +The shared socket harness now handles synthetic base URLs with or without /v1 before +numeric-loopback dispatch. Its first attempt timed out awaiting a socket because the +new oracle used the already-supported root URL spelling, not the previous /v1/ spelling. +Networking was isolated and no provider ran. This harness failure is not behavioral RED. +After correcting only URL substitution, the compiled behavioral RED showed exact text +versus thinking wire mismatch. Expectations were not changed. The subsequent library +and executable tests each match all 92 recorded requests, including prior 74 cases. + +Verification evidence: `/mnt/omkdata/tmp/omk-k1-signature-PSLmd94A`, with immutable baseline, +before images, command receipts/logs, retained failures and scoped preservation audit. +Rust: 61 passed, zero failed/ignored. Twelve Node regression files: 21 passed, zero +failed/skipped. Recorder strict TypeScript, Cargo check/fmt and all-target Clippy with +warnings denied passed. Repository/documentation/final preservation gates are recorded +in evidence. The initial formatting failure remains retained. + +This is API-key same-model request compatibility, not full K1/RC2, cross-model signature +handling, arbitrary tool normalization/collation, other provider APIs, OAuth/storage/ +refresh, complete response parity, agent/session/core adoption or platform/live acceptance. +Original corpora, dependencies/locks/notices, installed engines/settings/credentials and +unrelated work are outside this unit. No delegated agent, provider inference, install, +commit, push or publication occurred. Remaining requirements stay open in [spec.md](spec.md) +and [tasks.md](tasks.md); see also [request policies](k1-request-policy.md) and +[explicit request caching](k1-request-cache.md). diff --git a/specs/120-rust-core/k1-tool-history.md b/specs/120-rust-core/k1-tool-history.md new file mode 100644 index 0000000000..16ba851130 --- /dev/null +++ b/specs/120-rust-core/k1-tool-history.md @@ -0,0 +1,106 @@ +# K1 tool and thinking request history + +Date: 2026-11-15. Request-start HEAD: `ab08eb635e` on `2.0.0`. +This continues the owner's full Rust migration direction under spec 120. It does +not complete K1, start K2, select a Rust agent, change the installed engine or +remove Node. The existing staged decision-assistance work is outside this unit. + +## Scope + +The existing `history` request input now accepts same-model assistant content +blocks and text tool results in addition to the original user/assistant `text`. +The request builder ports the existing Node transformations rather than changing +them: retain same-model IDs, synthesize missing results, drop orphan results and +failed/aborted assistant turns, trim result IDs with ECMAScript whitespace rules, +and group consecutive results in one user message. Signed and redacted thinking +are retained; unsigned thinking falls back to text. Blank blocks are omitted. + +The Rust replay library and `replay-anthropic` executable both reach the same +request builder. This is request conversion, not tool execution, HTTP dispatch, +a session store or an agent loop. No side effect runs twice for comparison. + +No dependency, feature, lockfile, compatibility default, workflow, model catalog, +authentication setting or installed runtime changes. Existing MIT provenance, +root LICENSE/NOTICE and dependency notices remain intact. The new source modules +name their Node source. No commit, push, release or provider inference is performed. + +## Independent oracle + +The Node-only recorder invokes the actual `streamAnthropic` and official SDK. +It uses an isolated home, allowlisted environment, only the synthetic endpoint +and credential, an in-memory fetch and no retries. It records the 25 request +bodies before Rust implementation, with non-runtime headers. It never reads Rust +or creates expected output from Rust. Original provider, JSON, text-history and +K0 corpora are unchanged. + +The fixture covers single/multiple tools, reversed and duplicate results, missing +all/one/end-of-history results, interruptions by user/assistant/error, orphaned +results, error/aborted turns, trimmed IDs, same-model special-character IDs, +empty and multiblock error results, nested arguments with nonalphabetic/numeric +key order, signed/unsigned/blank/redacted thinking, blank blocks and two tool turns. + +The recorded oracle SHA-256 is +`a4cf07b87b02c43d4d0385eff83e9b1d8f7c347860c8f1cbadbf46ec16cd5972`. +The `--check` runner compares fresh Node bytes without rewriting it. The repository's +normal script-test discovery runs freshness, credential-isolation and preservation +checks. Library tests and real child-process tests compare every recorded request. + +## Boundaries + +- At most 4096 history messages and 4096 blocks per assistant/tool-result message. +- Tool argument validation reuses the 1 MiB, 64-level, finite/safe-integer JSON guard. + Unpaired surrogate escapes remain refused rather than silently sanitized. +- Raw argument serialization preserves Node-recorded key order, without adding a + serde feature or dependency. Arbitrary alternate JSON number/escape spellings + are outside the byte-parity claim. Input is a bounded synthetic request surface, + not the full session or production provider schema. +- Images, cross-provider/model transformations, cache/OAuth/model policies, live + networking, native macOS/Windows and full RC2/PL1 acceptance remain unverified. + +## Verification + +The first isolated build failed because the linker had no writable temporary +path; this is setup failure, not behavioral RED. It is retained separately. +Setting `TMPDIR` to the already-owned writable directory kept the source/cache +read-only and network disabled. The actual compiled behavioral RED then failed +at `single-tool` with `unknown field content, expected text`, exit 101. + +After implementation, the three focused Rust tests pass: all 25 request byte +comparisons through both library and executable, unsupported-input refusals with +no partial stdout, and size/safe-number refusals. The new Node tests pass 2/2. +The recorder's strict TypeScript compilation passes. The focused Node suite passes +10/10 with zero skipped cases. Credential-free, network-disabled Rust checks pass: +`cargo check`, formatting, Clippy with warnings denied, and all 16 crate tests +with zero ignored tests. The crate tests also retain the original 16-stream, +17-JSON-stream, 331-JSON-value and 12-text-history comparisons. + +Primary LSP coverage was inconclusive. Its auxiliary hardcoded-URL warning is the +intentionally fixed synthetic endpoint, not a production configuration setting. +Compiler, Clippy and tests provide the independent completed checks. + +The initial full repository check passed native checks for all six crates and +then stopped because the chosen `TMPDIR` was too long for K0's fixed-width path +fixture. That is a setup failure, not golden drift. The retry uses a short +private recorder directory under `/tmp`, without altering the fixture or guard. +With `TMPDIR=/tmp`, the full credential-free `npm run check` exits 0. All six +native crates pass their configured gates; generated contracts, capability matrix +and all ten fresh K0 fixture files match. Repository script tests report 729 total: +698 passed, 31 skipped, zero failures. TypeScript and the remaining repository +checks pass. Skipped tool/platform/live cases are not acceptance evidence. + +A formatting-only attempt and the interrupted superseded repository run are +retained as non-acceptance logs. The final passing checks use the corrected source; +no fixture was rewritten to make Rust pass. The request-start snapshot verifies +43 existing files and the entire preexisting staged diff unchanged. + +Commands from the repository root: + +```sh +node scripts/record-anthropic-tool-history-fixtures.mjs --check +node --test scripts/test/anthropic-tool-history-fixtures.test.mjs scripts/test/anthropic-history-fixtures.test.mjs scripts/test/anthropic-json-fixtures.test.mjs scripts/test/provider-fixtures.test.mjs +cargo check --locked --offline --manifest-path native/omk-providers/Cargo.toml +cargo fmt --manifest-path native/omk-providers/Cargo.toml --check +cargo clippy --locked --offline --manifest-path native/omk-providers/Cargo.toml --all-targets -- -D warnings +cargo test --locked --offline --manifest-path native/omk-providers/Cargo.toml +npm run check +``` diff --git a/specs/120-rust-core/k1-tool-schema.md b/specs/120-rust-core/k1-tool-schema.md new file mode 100644 index 0000000000..afa4ff3dd2 --- /dev/null +++ b/specs/120-rust-core/k1-tool-schema.md @@ -0,0 +1,90 @@ +# K1 Anthropic tool schema canonicalization and collation + +Date: 2026-11-17 +Status: implemented bounded source unit; full K1 and migration remain open. + +Before this unit, the Rust request builder sent tools in caller order with raw +`properties`, so callers had to pre-apply Node `stableTools`. The new oracle, +`scripts/fixtures/anthropic-tool-schema-recorder.ts`, calls the real Node +`streamAnthropic` and SDK with an in-memory fetch. That fetch refuses other URLs, +credentials and retries. The recorder also calls `stableToolSchema` directly on 25 +JSON literals. The Node default collation locale is asserted as `en-US`. Recording +creates the corpus exclusively, and `--check` never rewrites it. The source and SDK +package are SHA-256 recorded. + +Five request cases cover these inputs: + +- 64 single-character names in the full `[A-Za-z0-9_-]` alphabet +- 24 mixed-case, punctuated and numeric names +- one nested schema with array-index keys, `__proto__`, empty/emoji/U+FFFD keys, + nullish `required`, numbers and control-character strings +- non-object `properties` +- short cache on the last tool after sorting + +The 25 literals cover JavaScript number formatting, overflow to `null`, `-0`, +duplicate keys, whitespace, nested `required: null` removal and non-object +roots. The first local recording wrapped scalar literals in a non-object root, +so it recorded only `{}`. That recording was discarded before any Rust test used +it and is retained in evidence. + +`native/omk-providers/src/tool_schema.rs` ports the Node behavior inside the +existing request path. No parallel builder is added. + +- Object keys are re-emitted in JSON.parse property order: array-index keys + ascending, then UTF-16 code-unit order. +- The last duplicate key wins. `required: null` is dropped at every level. +- Numbers use ECMAScript `Number::toString`, and non-finite values become `null`. +- Strings are re-escaped. +- Non-object `properties` become `{}`. +- Tools are sorted with the ICU root/en-US collation for `[A-Za-z0-9_-]`: primary + `_ - 0-9 a-z`, then lowercase before uppercase. + +Admission bounds are explicit refusals, not Node parity claims: + +- tool names outside that alphabet, where locale collation is not implemented +- duplicate names, which Node would tie-break on description/schema +- lone surrogate strings, which Rust strings cannot hold + +One older boundary test asserted the order of the raw caller schema. It became +obsolete because Node sorts keys. Only that expectation was replaced, with a +comment. Unknown-field refusal and string-space preservation remain. + +Compiled behavioral RED, before the implementation: the library and executable +dispatch tests failed on exact request bytes (Rust sent `z` first; Node sent `_` +first). The new literal and refusal tests failed, and the obsolete boundary +expectation failed. Afterwards both the library and the actual `provider stream` +executable match all 97 recorded dispatch requests, including the five new ones. + +Verification evidence is in `/mnt/omkdata/tmp/omk-k1-toolschema-67A228`. It holds +the baseline status/index/preserved hashes, before images, RED/GREEN logs, the +discarded recording and command receipts. + +- Rust: `cargo check`, `fmt --check` and all-target Clippy with `-D warnings` exit + 0. Tests: 63 passed, zero failed or ignored. +- Recorder strict TypeScript (`tsgo --ignoreConfig --strict`) exits 0. +- Thirteen Node fixture regression files, including the new one, ran with + networking disabled: 22 passed, zero failed or skipped. A first sandbox attempt + failed with EROFS because TMPDIR was read-only. It is retained and is not + behavioral evidence. +- `npm run check`: exit 1 after 434 s, at load average about 65. Biome, native, + contracts and drift passed. In `check:constitution`, 722 passed, 30 skipped and + 1 failed. The failure is `contract-fixtures.test.mjs` "fresh contract recordings": + its 80 s child timeout returned status `null`. Run directly, the same K0 + recorder passes in 157 s. That recorder does not touch `omk-providers`. In a + standalone run, the test file failed once more (12/13) and then passed 13/13 + without changes. The timeout was not raised. The failed runs are retained. The + steps that `npm run check` skipped after the failure (Biome rerun, + release/readme/doc-links/openwiki/feature-claims/private-home/release-surface/ + shrinkwrap/pi-inventory, `tsgo --noEmit`, browser smoke) each exit 0 when run + separately. This is not one clean `npm run check` invocation. + +Scope: this is Anthropic API-key request tool ordering and schema canonicalization +only. It is not full K1/RC2. Other provider APIs (OpenAI completions/responses +also use `stableTools`), prompt-cache affinity keys, OAuth tool-name mapping, +non-ASCII or other-locale collation, description/schema tie-breaks, complete +response parity, agent/session/core adoption, and platform or live acceptance +all remain open. Original corpora, dependencies, locks, notices, installed +engines/settings/credentials and other lanes' changes are outside this unit. No +delegated agent, provider inference, install, commit, push or publication +occurred. See also [explicit request caching](k1-request-cache.md) and +[thinking signatures](k1-thinking-signature.md). diff --git a/specs/120-rust-core/k1-transport.md b/specs/120-rust-core/k1-transport.md new file mode 100644 index 0000000000..9a20fe76bc --- /dev/null +++ b/specs/120-rust-core/k1-transport.md @@ -0,0 +1,77 @@ +# K1 explicit HTTP byte-stream transport + +Status: implemented and locally verified. This is not complete +K1, RC2, PL1, a selectable Rust core or installed adoption. + +## Scope and ownership + +The previous `transport::build_client` only constructed the B1-approved client. +`Transport::post` reuses it to send one explicit POST and deliver response chunks +with response status/headers. No new dependency, feature, lockfile, crypto owner, +provider model, credential store, production Node caller or engine selection is +introduced. Ring, native certificate verification, disabled redirects/retries and +inherited proxies, and the existing 30-second client ceiling are preserved. + +The caller supplies an absolute Tokio deadline, response byte cap and irreversible +cancellation handle. One future owns headers and body; dropping it releases local +I/O, with no detached request task. Cancellation does not undo server-side work +already dispatched. Cancellation wins a ready race with the operation. A response +consumer is synchronous and must return promptly; it cannot be preempted. + +Requests above 8 MiB, response limits above 8 MiB, URL credentials/fragments, +non-HTTPS endpoints except numeric loopback HTTP, and caller-controlled HTTP +framing headers are refused before dispatch. The body cap is cumulative and +checked before delivery, including unknown-length chunked responses. Zero and +exact limits are supported. Typed errors omit endpoints, secrets and raw client +errors. HTTP error statuses/bodies are returned once without automatic retry or +redirect; provider-specific handling remains with its future provider owner. + +## Independent data and actual socket checks + +The existing `tests/fixtures/anthropic.json` remains unchanged. The first request +in that independently recorded Node/SDK oracle is sent through a real loopback +socket; the server compares exact body bytes and synthetic auth. The recorded SSE +bytes return through the real HTTP parser, then existing Anthropic replay matches +recorded semantic events and final output. Physical TCP chunk boundaries are not +claimed to match the Node recording. Remaining tests exercise transport contracts, +not Node SDK retry/proxy/error-message parity. No expected output is supplied to +production transport code. + +Thirteen tests cover request transmission, streamed delivery before EOF, pre-dispatch +cancellation/expiry with zero connections, cancellation waiting for headers, +cancellation during delivery, stalled header/body deadlines, declared/chunked byte +caps, 307/429/503 with no follow/retry, sink failure, truncated-body failure, +endpoint/request/framing refusal, secret-free errors and zero/exact byte limits. +Socket closure is observed after cancellation and sink failure. Each server task +is joined; test runtime teardown owns any task left by a failing assertion. + +## Verification record + +- `cargo check --offline --locked`, `cargo fmt --check`, Clippy `--all-targets + -- -D warnings`, and full crate tests: exit 0. The crate runs 36 tests, including + all 13 new socket tests. Check/test/Clippy use a read-only network-isolated Linux + sandbox with the evidence directory as the writable build/temp/home mount. +- Six focused independent Node fixture test files: 14 passed, zero skipped, + network-isolated, without rewriting a corpus. +- `npm run check`: final exit 0 in 225.933 seconds, including all six native crates, + fresh Node provider/JSON recordings, K0 contract recordings and repository guards. + This is not the full product Vitest suite or platform/provider acceptance. +- Preservation audit: HEAD and complete staged-diff digest unchanged; exactly six + owned paths changed, no other Git-visible file changes. Original provider/history/ + content/vision corpora, manifests, locks and notices are unchanged. +- Active LSP probe: two paths confirmed clean, one existing inactive-cfg hint, + one inconclusive path. Compiler success does not turn that into an all-clean LSP + claim. Documentation links and `git diff --check` pass. +- Retained non-passes: initial missing-API RED (101); first compiled run failed from + the test-server assumption that empty requests always include Content-Length, + then passed after fixing only the test server; initial fmt check (1), corrected + only owned files; initial repository check (1) because the isolated TMPDIR path + exceeded the K0 recorder's fixed path width, then passed using short `/tmp`. +- Compiled negative control: disabling cancellation polling fails the real + header-wait cancellation test (101), including its socket-closure assertion. + The mutation was undone before all final GREEN checks. + +The full active migration objective remains open: remaining Anthropic/provider +auth/catalog/policies and Node parity, other APIs, K2-K5 and later roadmap gates. +No live API, OAuth, TLS handshake/revocation, proxy parity, native macOS/Windows, +packaging, install, commit, push or release occurred. diff --git a/specs/120-rust-core/k1-vision-history.md b/specs/120-rust-core/k1-vision-history.md new file mode 100644 index 0000000000..1d7cc92472 --- /dev/null +++ b/specs/120-rust-core/k1-vision-history.md @@ -0,0 +1,99 @@ +# K1 synthetic Anthropic vision requests + +## Scope + +This is one request-conversion continuation, not completed K1, live image delivery, +an agent loop or installed-engine adoption. It adds only the independently recorded +`synthetic-anthropic-vision` model. The existing `synthetic-anthropic` text-only +model and all earlier request/SSE/JSON/history corpora remain unchanged. + +The shared checkout already contained the tool/thinking and non-vision content +slices plus a transport build-only probe. Those are preserved prerequisites, not +new work in this unit. No manifest, dependency, lockfile, notice, production Node +provider, model catalog, capability matrix, launcher or setting is changed. + +## Independent Node oracle + +- `scripts/fixtures/anthropic-vision-cases.ts` builds synthetic header samples. +- `scripts/fixtures/anthropic-vision-recorder.ts` invokes actual `streamAnthropic` + and the official SDK with a distinct image-capable synthetic model. +- `scripts/record-anthropic-vision-fixtures.mjs` isolates HOME and allowlists the + environment. Fetch is intercepted in memory, only `synthetic.invalid` and + `faux-key` are accepted, and unexpected requests/retries are refused. +- `native/omk-providers/tests/fixtures/anthropic-vision.json` contains 50 captured + SDK requests and source hashes. Expected bodies are SDK-serialized strings, not + Rust output. Runtime/OS headers alone are projected out. +- `--check` compares fresh Node output without rewriting. Initial creation uses + exclusive creation and refuses an existing corpus. + +The initial compiled Rust tests failed twice: `png-limit` was refused as an +unsupported synthetic model, and the valid 4096-block vision boundary was refused. +The two Node oracle tests passed before implementation. A separate Node observation +recorded low UTF-16 byte handling for permissive base64 before the Rust decoder. +No expected request is supplied to the executable: its input is only +`{input, chunks: [], abort: false}`. + +## Conversion + +`request_content.rs` now converts image-capable user/tool blocks while retaining +the existing non-vision downgrade. `request_images.rs` ports the Node header guard +from `packages/ai/src/providers/anthropic-image-guard.ts`, retaining its MIT source +attribution. Existing wire blocks gain borrowed image sources and owned/borrowed +text for generated omission messages. + +- User images preserve order and the original base64/MIME strings. Blank text is + filtered after guarding; empty arrays still interrupt pending tool flow. +- Tool results become mixed arrays if any images remain. Image-only results gain + `(see attached image)`; an existing empty text block prevents that insertion. +- Tool results with no remaining images become newline-joined text. Multiple + oversized images retain separate omission messages, without non-vision dedup. +- Recognized PNG/JPEG/GIF/WebP dimensions above 1900px use the exact Node omission + text. MIME labels do not select the sniffed header format. +- Header decoding examines only the first 87384 UTF-16 code units, permitting at + most 65538 decoded bytes. JPEG marker scanning is bounded to that window. +- Base64 reproduces Node's URL alphabet, ignored characters, unpadded input, + padding termination and low UTF-16 bytes. Unknown/short/malformed formats pass + through unchanged, as Node does. This is not complete image validation and does + not establish downstream API acceptance. +- The 4096-block limit counts original blocks, including orphan tool results. + Strict tagged input still refuses missing/wrong/extra fields without CLI stdout. +- Vision replay permits only the empty response used to exercise the request + entrypoint. Nonempty responses and cancellation are explicitly refused until + an independent response oracle exists. + +The 50 cases include 1900/1901 boundaries, u32/u24 dimensions, JPEG segment skips, +excluded markers, the last readable/beyond-window SOF positions, each WebP layout, +base64 variants, user/tool mixtures, image-only tool placeholders, orphan/error +filtering, missing-result synthesis and tool-group boundaries. + +## Verification + +Private logs, exact commands/exits, baseline hashes and before-images are in +`/tmp/omk-k1-vision-HqCnwn/README.md` and `verify.py`. + +- Offline/locked Cargo tests pass: 23 tests, including 50 exact requests compared + through both `build_request` and the actual executable. +- Cargo format and Clippy (`--all-targets -- -D warnings`) pass. +- Four new Rust tests cover request parity, invalid/bounded input, replay refusal + and the bounded permissive base64 decoder. +- Strict recorder TypeScript compilation passes with `--ignoreConfig`. +- Six focused Node files pass in a read-only, network-disabled sandbox: 14 tests, + zero skips. Fresh Node recording includes the new and earlier corpora. +- `npm run check` exits 0 in 257.986 seconds, including six native crates and + repository guards. Its script subrun reports 743 total, 713 passed, 30 skipped, + zero failures. This is not the full product Vitest suite or a live-provider run. +- Preservation audit passes: HEAD/index unchanged, exactly the 15 owned repository + paths differ from the captured baseline, and `otherChanges` is empty. +- LSP probes are inconclusive for all seven paths. Compiler/test success is not a + confirmed-clean LSP result. + +The initial behavioral RED, subsequent intermediate compile error and initial +format findings remain non-passing evidence, not reclassified by final passes. + +## Remaining work + +No actual provider inference, HTTP image delivery, credential access, image +resizing, model-catalog/capability selection, cross-provider history, installed +runtime switch, commit or publication occurs here. Full K1, later Rust stages and +native platform acceptance remain incomplete. The standalone transport probe +remains build-only and receives no dispatch integration from this unit.